Removed javaengine and more misc fixes.

Source: L2jUnity free release
This commit is contained in:
MobiusDev
2016-10-22 09:57:31 +00:00
parent f9f769d0ef
commit f1557eb587
24 changed files with 975 additions and 113 deletions

View File

@@ -62,6 +62,7 @@ import com.l2jmobius.gameserver.model.events.impl.character.player.OnPlayerKarma
import com.l2jmobius.gameserver.model.events.impl.character.player.OnPlayerLevelChanged;
import com.l2jmobius.gameserver.model.events.impl.character.player.OnPlayerLogin;
import com.l2jmobius.gameserver.model.events.impl.character.player.OnPlayerLogout;
import com.l2jmobius.gameserver.model.events.impl.character.player.OnPlayerMoveRequest;
import com.l2jmobius.gameserver.model.events.impl.character.player.OnPlayerPKChanged;
import com.l2jmobius.gameserver.model.events.impl.character.player.OnPlayerProfessionChange;
import com.l2jmobius.gameserver.model.events.impl.character.player.OnPlayerPvPChanged;
@@ -221,6 +222,7 @@ public enum EventType
ON_PLAYER_LOGIN(OnPlayerLogin.class, void.class),
ON_PLAYER_LOGOUT(OnPlayerLogout.class, void.class),
ON_PLAYER_PK_CHANGED(OnPlayerPKChanged.class, void.class),
ON_PLAYER_MOVE_REQUEST(OnPlayerMoveRequest.class, void.class, TerminateReturn.class),
ON_PLAYER_PROFESSION_CHANGE(OnPlayerProfessionChange.class, void.class),
ON_PLAYER_CHANGE_TO_AWAKENED_CLASS(OnPlayerChangeToAwakenedClass.class, void.class),
ON_PLAYER_PVP_CHANGED(OnPlayerPvPChanged.class, void.class),

View File

@@ -0,0 +1,53 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.gameserver.model.events.impl.character.player;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.events.EventType;
import com.l2jmobius.gameserver.model.events.impl.IBaseEvent;
/**
* @author UnAfraid
*/
public class OnPlayerMoveRequest implements IBaseEvent
{
private final L2PcInstance _activeChar;
private final Location _location;
public OnPlayerMoveRequest(L2PcInstance activeChar, Location loc)
{
_activeChar = activeChar;
_location = loc;
}
public L2PcInstance getActiveChar()
{
return _activeChar;
}
public Location getLocation()
{
return _location;
}
@Override
public EventType getType()
{
return EventType.ON_PLAYER_MOVE_REQUEST;
}
}

View File

@@ -40,6 +40,12 @@ public final class L2Armor extends L2Item
public L2Armor(StatsSet set)
{
super(set);
}
@Override
public void set(StatsSet set)
{
super.set(set);
_type = set.getEnum("armor_type", ArmorType.class, ArmorType.NONE);
final int _bodyPart = getBodyPart();

View File

@@ -32,11 +32,11 @@ public final class L2EtcItem extends L2Item
{
private String _handler;
private EtcItemType _type;
private final boolean _isBlessed;
private final List<L2ExtractableProduct> _extractableItems;
private final int _extractableCountMin;
private final int _extractableCountMax;
private final boolean _isInfinite;
private boolean _isBlessed;
private List<L2ExtractableProduct> _extractableItems;
private int _extractableCountMin;
private int _extractableCountMax;
private boolean _isInfinite;
/**
* Constructor for EtcItem.
@@ -45,6 +45,12 @@ public final class L2EtcItem extends L2Item
public L2EtcItem(StatsSet set)
{
super(set);
}
@Override
public void set(StatsSet set)
{
super.set(set);
_type = set.getEnum("etcitem_type", EtcItemType.class, EtcItemType.NONE);
// l2j custom - L2EtcItemType.SHOT

View File

@@ -66,7 +66,7 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
public static final int TYPE1_WEAPON_RING_EARRING_NECKLACE = 0;
public static final int TYPE1_SHIELD_ARMOR = 1;
public static final int TYPE1_ITEM_QUESTITEM_ADENA = 4;
public static final int TYPE2_WEAPON = 0;
public static final int TYPE2_SHIELD_ARMOR = 1;
public static final int TYPE2_ACCESSORY = 2;
@@ -112,43 +112,43 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
public static final int SLOT_MULTI_ALLWEAPON = SLOT_LR_HAND | SLOT_R_HAND;
private final int _itemId;
private final int _displayId;
private final String _name;
private final String _additionalName;
private final String _icon;
private final int _weight;
private final boolean _stackable;
private final MaterialType _materialType;
private final CrystalType _crystalType;
private final int _equipReuseDelay;
private final int _duration;
private final int _time;
private final int _autoDestroyTime;
private final int _bodyPart;
private final int _referencePrice;
private final int _crystalCount;
private final boolean _sellable;
private final boolean _dropable;
private final boolean _destroyable;
private final boolean _tradeable;
private final boolean _depositable;
private final boolean _auctionable;
private final int _enchantable;
private final boolean _elementable;
private final boolean _questItem;
private final boolean _freightable;
private final boolean _allow_self_resurrection;
private final boolean _is_oly_restricted;
private final boolean _for_npc;
private final boolean _common;
private final boolean _heroItem;
private final boolean _pvpItem;
private final boolean _immediate_effect;
private final boolean _ex_immediate_effect;
private final int _defaultEnchantLevel;
private final ActionType _defaultAction;
private final boolean _isBlessedItem;
private int _itemId;
private int _displayId;
private String _name;
private String _additionalName;
private String _icon;
private int _weight;
private boolean _stackable;
private MaterialType _materialType;
private CrystalType _crystalType;
private int _equipReuseDelay;
private int _duration;
private int _time;
private int _autoDestroyTime;
private int _bodyPart;
private int _referencePrice;
private int _crystalCount;
private boolean _sellable;
private boolean _dropable;
private boolean _destroyable;
private boolean _tradeable;
private boolean _depositable;
private boolean _auctionable;
private int _enchantable;
private boolean _elementable;
private boolean _questItem;
private boolean _freightable;
private boolean _allow_self_resurrection;
private boolean _is_oly_restricted;
private boolean _for_npc;
private boolean _common;
private boolean _heroItem;
private boolean _pvpItem;
private boolean _immediate_effect;
private boolean _ex_immediate_effect;
private int _defaultEnchantLevel;
private ActionType _defaultAction;
private boolean _isBlessedItem;
protected int _type1; // needed for item list (inventory)
protected int _type2; // different lists for armor, weapon, etc
@@ -159,13 +159,13 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
private SkillHolder _unequipSkill = null;
private SkillHolder _equipSkill = null;
private final int _useSkillDisTime;
private final int _reuseDelay;
private final int _sharedReuseGroup;
private int _useSkillDisTime;
private int _reuseDelay;
private int _sharedReuseGroup;
private final CommissionItemType _commissionItemType;
private final int _compoundItem;
private final float _compoundChance;
private CommissionItemType _commissionItemType;
private int _compoundItem;
private float _compoundChance;
/**
* Constructor of the L2Item that fill class variables.<BR>
@@ -173,6 +173,11 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
* @param set : StatsSet corresponding to a set of couples (key,value) for description of the item
*/
protected L2Item(StatsSet set)
{
set(set);
}
public void set(StatsSet set)
{
_itemId = set.getInt("item_id");
_displayId = set.getInt("displayId", _itemId);

View File

@@ -40,19 +40,19 @@ import com.l2jmobius.util.StringUtil;
*/
public final class L2Weapon extends L2Item
{
private final WeaponType _type;
private final boolean _isMagicWeapon;
private final int _rndDam;
private final int _soulShotCount;
private final int _spiritShotCount;
private final int _mpConsume;
private final int _baseAttackRange;
private final int _baseAttackAngle;
private WeaponType _type;
private boolean _isMagicWeapon;
private int _rndDam;
private int _soulShotCount;
private int _spiritShotCount;
private int _mpConsume;
private int _baseAttackRange;
private int _baseAttackAngle;
/**
* Skill that activates when item is enchanted +4 (for duals).
*/
private SkillHolder _enchant4Skill = null;
private final int _changeWeaponId;
private int _changeWeaponId;
// Attached skills for Special Abilities
private SkillHolder _skillsOnMagic;
@@ -60,15 +60,15 @@ public final class L2Weapon extends L2Item
private SkillHolder _skillsOnCrit;
private Condition _skillsOnCritCondition = null;
private final int _reducedSoulshot;
private final int _reducedSoulshotChance;
private int _reducedSoulshot;
private int _reducedSoulshotChance;
private final int _reducedMpConsume;
private final int _reducedMpConsumeChance;
private int _reducedMpConsume;
private int _reducedMpConsumeChance;
private final boolean _isForceEquip;
private final boolean _isAttackWeapon;
private final boolean _useWeaponSkillsOnly;
private boolean _isForceEquip;
private boolean _isAttackWeapon;
private boolean _useWeaponSkillsOnly;
/**
* Constructor for Weapon.
@@ -77,6 +77,12 @@ public final class L2Weapon extends L2Item
public L2Weapon(StatsSet set)
{
super(set);
}
@Override
public void set(StatsSet set)
{
super.set(set);
_type = WeaponType.valueOf(set.getString("weapon_type", "none").toUpperCase());
_type1 = L2Item.TYPE1_WEAPON_RING_EARRING_NECKLACE;
_type2 = L2Item.TYPE2_WEAPON;

View File

@@ -125,7 +125,7 @@ public class Quest extends AbstractScript implements IIdentifiable
QuestManager.getInstance().addScript(this);
}
loadGlobalData();
onLoad();
}
/**
@@ -151,17 +151,17 @@ public class Quest extends AbstractScript implements IIdentifiable
* Children of this class can implement this function in order to define what variables to load and what structures to save them in.<br>
* By default, nothing is loaded.
*/
protected void loadGlobalData()
protected void onLoad()
{
}
/**
* The function saveGlobalData is, by default, called at shutdown, for all quests, by the QuestManager.<br>
* The function onSave is, by default, called at shutdown, for all quests, by the QuestManager.<br>
* Children of this class can implement this function in order to convert their structures<br>
* into <var, value> tuples and make calls to save them to the database, if needed.<br>
* By default, nothing is saved.
*/
public void saveGlobalData()
public void onSave()
{
}
@@ -175,6 +175,14 @@ public class Quest extends AbstractScript implements IIdentifiable
return _questId;
}
/**
* @return the NpcStringId of the current quest, used in Quest link bypass
*/
public int getNpcStringId()
{
return _questId > 10000 ? _questId - 5000 : _questId;
}
/**
* Add a new quest state of this quest to the database.
* @param player the owner of the newly created quest state
@@ -2679,7 +2687,7 @@ public class Quest extends AbstractScript implements IIdentifiable
*/
public boolean unload(boolean removeFromList)
{
saveGlobalData();
onSave();
// cancel all pending timers before reloading.
// if timers ought to be restarted, the quest can take care of it
// with its code (example: save global data indicating what timer must be restarted).

View File

@@ -134,4 +134,14 @@ public class ZoneNPoly extends L2ZoneForm
GeoData.getInstance().getHeight(x, y, _z1)
};
}
public int[] getX()
{
return _p.xpoints;
}
public int[] getY()
{
return _p.ypoints;
}
}