- Implemented Compound engine.

- Created Launcher files to use debugger in eclipse.
This commit is contained in:
erlandys56
2015-01-25 21:51:18 +00:00
parent fbd425faf0
commit 56db1f21cf
22 changed files with 837 additions and 6 deletions

View File

@ -1599,22 +1599,22 @@ public final class L2GamePacketHandler implements IPacketHandler<L2GameClient>,
// msg = new NotifyTrainingRoomEnd();
break;
case 0xF4:
// msg = new RequestNewEnchantPushOne();
msg = new RequestNewEnchantPushOne();
break;
case 0xF5:
// msg = new RequestNewEnchantRemoveOne();
msg = new RequestNewEnchantRemoveOne();
break;
case 0xF6:
// msg = new RequestNewEnchantPushTwo();
msg = new RequestNewEnchantPushTwo();
break;
case 0xF7:
// msg = new RequestNewEnchantRemoveTwo();
msg = new RequestNewEnchantRemoveTwo();
break;
case 0xF8:
// nsg = new RequestNewEnchantClose();
msg = new RequestNewEnchantClose();
break;
case 0xF9:
// msg = new RequestNewEnchantTry();
msg = new RequestNewEnchantTry();
break;
case 0xFE:
// msg = new ExSendSelectedQuestZoneID();

View File

@ -0,0 +1,52 @@
/*
* Copyright (C) 2004-2015 L2J Server
*
* This file is part of L2J Server.
*
* L2J Server 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.
*
* L2J Server 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.l2jserver.gameserver.network.clientpackets;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
/**
* @author Erlandys
*/
public final class RequestNewEnchantClose extends L2GameClientPacket
{
private static final String _C__D0_F8_REQUESTNEWENCHANTCLOSE = "[C] D0:F8 RequestNewEnchantClose";
@Override
protected void readImpl()
{
}
@Override
protected void runImpl()
{
L2PcInstance activeChar = getClient().getActiveChar();
if (activeChar == null)
{
return;
}
activeChar.setFirstCompoundOID(-1);
activeChar.setSecondCompoundOID(-1);
}
@Override
public String getType()
{
return _C__D0_F8_REQUESTNEWENCHANTCLOSE;
}
}

View File

@ -0,0 +1,73 @@
/*
* Copyright (C) 2004-2015 L2J Server
*
* This file is part of L2J Server.
*
* L2J Server 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.
*
* L2J Server 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.l2jserver.gameserver.network.clientpackets;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.items.L2Item;
import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
import com.l2jserver.gameserver.network.serverpackets.ExEnchantOneFail;
import com.l2jserver.gameserver.network.serverpackets.ExEnchantOneOK;
/**
* @author Erlandys
*/
public final class RequestNewEnchantPushOne extends L2GameClientPacket
{
private static final String _C__D0_F4_REQUESTNEWENCHANTPUSHONE = "[C] D0:F4 RequestNewEnchantPushOne";
int _itemId;
@Override
protected void readImpl()
{
_itemId = readD();
}
@Override
protected void runImpl()
{
L2PcInstance activeChar = getClient().getActiveChar();
if (activeChar == null)
{
return;
}
L2ItemInstance item = activeChar.getInventory().getItemByObjectId(_itemId);
if (item == null)
{
return;
}
int secondCompoundOID = activeChar.getSecondCompoundOID();
L2ItemInstance secondItem = activeChar.getInventory().getItemByObjectId(secondCompoundOID);
if ((item.getItem().getBodyPart() != L2Item.SLOT_BROOCH_JEWEL) || ((secondItem != null) && ((secondItem.getObjectId() == item.getObjectId()) || (secondItem.getId() != item.getId()))) || ((item.getId() == 38931) || ((item.getId() % 10) == 4) || ((item.getId() % 10) == 9)))
{
activeChar.sendPacket(new ExEnchantOneFail());
}
else
{
activeChar.setFirstCompoundOID(_itemId);
activeChar.sendPacket(new ExEnchantOneOK());
}
}
@Override
public String getType()
{
return _C__D0_F4_REQUESTNEWENCHANTPUSHONE;
}
}

View File

@ -0,0 +1,73 @@
/*
* Copyright (C) 2004-2015 L2J Server
*
* This file is part of L2J Server.
*
* L2J Server 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.
*
* L2J Server 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.l2jserver.gameserver.network.clientpackets;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.items.L2Item;
import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
import com.l2jserver.gameserver.network.serverpackets.ExEnchantTwoFail;
import com.l2jserver.gameserver.network.serverpackets.ExEnchantTwoOK;
/**
* @author Erlandys
*/
public final class RequestNewEnchantPushTwo extends L2GameClientPacket
{
private static final String _C__D0_F6_REQUESTNEWENCHANTPUSHTWO = "[C] D0:F6 RequestNewEnchantPushTwo";
int _itemId;
@Override
protected void readImpl()
{
_itemId = readD();
}
@Override
protected void runImpl()
{
L2PcInstance activeChar = getClient().getActiveChar();
if (activeChar == null)
{
return;
}
L2ItemInstance item = activeChar.getInventory().getItemByObjectId(_itemId);
if (item == null)
{
return;
}
int firstCompoundOID = activeChar.getFirstCompoundOID();
L2ItemInstance firstItem = activeChar.getInventory().getItemByObjectId(firstCompoundOID);
if ((item.getItem().getBodyPart() != L2Item.SLOT_BROOCH_JEWEL) || ((firstItem != null) && ((firstItem.getObjectId() == item.getObjectId()) || (firstItem.getId() != item.getId()))) || ((item.getId() == 38931) || ((item.getId() % 10) == 4) || ((item.getId() % 10) == 9)))
{
activeChar.sendPacket(new ExEnchantTwoFail());
}
else
{
activeChar.setSecondCompoundOID(_itemId);
activeChar.sendPacket(new ExEnchantTwoOK());
}
}
@Override
public String getType()
{
return _C__D0_F6_REQUESTNEWENCHANTPUSHTWO;
}
}

View File

@ -0,0 +1,54 @@
/*
* Copyright (C) 2004-2015 L2J Server
*
* This file is part of L2J Server.
*
* L2J Server 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.
*
* L2J Server 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.l2jserver.gameserver.network.clientpackets;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
/**
* @author Erlandys
*/
public final class RequestNewEnchantRemoveOne extends L2GameClientPacket
{
private static final String _C__D0_F5_REQUESTNEWENCHANTREMOVEONE = "[C] D0:F4 RequestNewEnchantRemoveOne";
int _itemId;
@Override
protected void readImpl()
{
_itemId = readD();
}
@Override
protected void runImpl()
{
L2PcInstance activeChar = getClient().getActiveChar();
if (activeChar == null)
{
return;
}
System.out.println(_C__D0_F5_REQUESTNEWENCHANTREMOVEONE);
}
@Override
public String getType()
{
return _C__D0_F5_REQUESTNEWENCHANTREMOVEONE;
}
}

View File

@ -0,0 +1,54 @@
/*
* Copyright (C) 2004-2015 L2J Server
*
* This file is part of L2J Server.
*
* L2J Server 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.
*
* L2J Server 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.l2jserver.gameserver.network.clientpackets;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
/**
* @author Erlandys
*/
public final class RequestNewEnchantRemoveTwo extends L2GameClientPacket
{
private static final String _C__D0_F7_REQUESTNEWENCHANTREMOVETWO = "[C] D0:F7 RequestNewEnchantRemoveTwo";
int _itemId;
@Override
protected void readImpl()
{
_itemId = readD();
}
@Override
protected void runImpl()
{
L2PcInstance activeChar = getClient().getActiveChar();
if (activeChar == null)
{
return;
}
System.out.println(_C__D0_F7_REQUESTNEWENCHANTREMOVETWO);
}
@Override
public String getType()
{
return _C__D0_F7_REQUESTNEWENCHANTREMOVETWO;
}
}

View File

@ -0,0 +1,105 @@
/*
* Copyright (C) 2004-2015 L2J Server
*
* This file is part of L2J Server.
*
* L2J Server 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.
*
* L2J Server 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.l2jserver.gameserver.network.clientpackets;
import com.l2jserver.Config;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
import com.l2jserver.gameserver.network.serverpackets.ExEnchantFail;
import com.l2jserver.gameserver.network.serverpackets.ExEnchantSucess;
import com.l2jserver.util.Rnd;
/**
* @author Erlandys
*/
public final class RequestNewEnchantTry extends L2GameClientPacket
{
private static final String _C__D0_F9_REQUESTNEWENCHANTTRY = "[C] D0:F9 RequestNewEnchantTry";
@Override
protected void readImpl()
{
}
@Override
protected void runImpl()
{
L2PcInstance activeChar = getClient().getActiveChar();
if (activeChar == null)
{
return;
}
L2ItemInstance firstItem = activeChar.getInventory().getItemByObjectId(activeChar.getFirstCompoundOID());
L2ItemInstance secondItem = activeChar.getInventory().getItemByObjectId(activeChar.getSecondCompoundOID());
if ((firstItem == null) || (secondItem == null))
{
return;
}
int levelOfStone = 0;
if (firstItem.getId() < 38900)
{
levelOfStone = (firstItem.getId() % 5) + 1;
}
else
{
levelOfStone = (firstItem.getId() - 38926);
}
if ((levelOfStone == 0) || (levelOfStone == 5))
{
return;
}
int percent = 0;
switch (levelOfStone)
{
case 1:
percent = Config.SECOND_LEVEL_UPGRADE_CHANCE;
break;
case 2:
percent = Config.THIRD_LEVEL_UPGRADE_CHANCE;
break;
case 3:
percent = Config.FOURTH_LEVEL_UPGRADE_CHANCE;
break;
case 4:
percent = Config.FITH_LEVEL_UPGRADE_CHANCE;
break;
}
if (Rnd.get(100) <= percent)
{
int newItem = firstItem.getId() + 1;
activeChar.destroyItem("FirstCompoundItem", firstItem, null, true);
activeChar.destroyItem("SecondCompoundItem", secondItem, null, true);
activeChar.addItem("CompoundItem", newItem, 1, null, true);
activeChar.sendPacket(new ExEnchantSucess(newItem));
}
else
{
activeChar.sendPacket(new ExEnchantFail(firstItem.getId(), secondItem.getId()));
activeChar.destroyItem("SecondCompoundItem", secondItem, null, true);
}
activeChar.setFirstCompoundOID(-1);
activeChar.setSecondCompoundOID(-1);
}
@Override
public String getType()
{
return _C__D0_F9_REQUESTNEWENCHANTTRY;
}
}

View File

@ -0,0 +1,39 @@
/*
* Copyright (C) 2004-2015 L2J Server
*
* This file is part of L2J Server.
*
* L2J Server 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.
*
* L2J Server 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.l2jserver.gameserver.network.serverpackets;
public class ExEnchantFail extends L2GameServerPacket
{
int _itemId1, _itemId2;
public ExEnchantFail(int itemId1, int itemId2)
{
_itemId1 = itemId1;
_itemId2 = itemId2;
}
@Override
protected final void writeImpl()
{
writeC(0xFE);
writeH(0x171);
writeD(_itemId1);
writeD(_itemId2);
}
}

View File

@ -0,0 +1,33 @@
/*
* Copyright (C) 2004-2015 L2J Server
*
* This file is part of L2J Server.
*
* L2J Server 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.
*
* L2J Server 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.l2jserver.gameserver.network.serverpackets;
public class ExEnchantOneFail extends L2GameServerPacket
{
public ExEnchantOneFail()
{
}
@Override
protected final void writeImpl()
{
writeC(0xFE);
writeH(0x169);
}
}

View File

@ -0,0 +1,33 @@
/*
* Copyright (C) 2004-2015 L2J Server
*
* This file is part of L2J Server.
*
* L2J Server 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.
*
* L2J Server 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.l2jserver.gameserver.network.serverpackets;
public class ExEnchantOneOK extends L2GameServerPacket
{
public ExEnchantOneOK()
{
}
@Override
protected final void writeImpl()
{
writeC(0xFE);
writeH(0x168);
}
}

View File

@ -0,0 +1,33 @@
/*
* Copyright (C) 2004-2015 L2J Server
*
* This file is part of L2J Server.
*
* L2J Server 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.
*
* L2J Server 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.l2jserver.gameserver.network.serverpackets;
public class ExEnchantOneRemoveFail extends L2GameServerPacket
{
public ExEnchantOneRemoveFail()
{
}
@Override
protected final void writeImpl()
{
writeC(0xFE);
writeH(0x16B);
}
}

View File

@ -0,0 +1,33 @@
/*
* Copyright (C) 2004-2015 L2J Server
*
* This file is part of L2J Server.
*
* L2J Server 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.
*
* L2J Server 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.l2jserver.gameserver.network.serverpackets;
public class ExEnchantOneRemoveOK extends L2GameServerPacket
{
public ExEnchantOneRemoveOK()
{
}
@Override
protected final void writeImpl()
{
writeC(0xFE);
writeH(0x16A);
}
}

View File

@ -0,0 +1,37 @@
/*
* Copyright (C) 2004-2015 L2J Server
*
* This file is part of L2J Server.
*
* L2J Server 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.
*
* L2J Server 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.l2jserver.gameserver.network.serverpackets;
public class ExEnchantSucess extends L2GameServerPacket
{
int _newItemId;
public ExEnchantSucess(int newItemId)
{
_newItemId = newItemId;
}
@Override
protected final void writeImpl()
{
writeC(0xFE);
writeH(0x170);
writeD(_newItemId);
}
}

View File

@ -0,0 +1,33 @@
/*
* Copyright (C) 2004-2015 L2J Server
*
* This file is part of L2J Server.
*
* L2J Server 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.
*
* L2J Server 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.l2jserver.gameserver.network.serverpackets;
public class ExEnchantTwoFail extends L2GameServerPacket
{
public ExEnchantTwoFail()
{
}
@Override
protected final void writeImpl()
{
writeC(0xFE);
writeH(0x16D);
}
}

View File

@ -0,0 +1,33 @@
/*
* Copyright (C) 2004-2015 L2J Server
*
* This file is part of L2J Server.
*
* L2J Server 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.
*
* L2J Server 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.l2jserver.gameserver.network.serverpackets;
public class ExEnchantTwoOK extends L2GameServerPacket
{
public ExEnchantTwoOK()
{
}
@Override
protected final void writeImpl()
{
writeC(0xFE);
writeH(0x16C);
}
}

View File

@ -0,0 +1,33 @@
/*
* Copyright (C) 2004-2015 L2J Server
*
* This file is part of L2J Server.
*
* L2J Server 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.
*
* L2J Server 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.l2jserver.gameserver.network.serverpackets;
public class ExEnchantTwoRemoveFail extends L2GameServerPacket
{
public ExEnchantTwoRemoveFail()
{
}
@Override
protected final void writeImpl()
{
writeC(0xFE);
writeH(0x16F);
}
}

View File

@ -0,0 +1,33 @@
/*
* Copyright (C) 2004-2015 L2J Server
*
* This file is part of L2J Server.
*
* L2J Server 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.
*
* L2J Server 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.l2jserver.gameserver.network.serverpackets;
public class ExEnchantTwoRemoveOK extends L2GameServerPacket
{
public ExEnchantTwoRemoveOK()
{
}
@Override
protected final void writeImpl()
{
writeC(0xFE);
writeH(0x16E);
}
}