Sync with L2jServer HighFive May 19th 2015.

This commit is contained in:
MobiusDev
2015-05-19 14:57:13 +00:00
parent 0337dd64a2
commit 6b9ed81821
17 changed files with 146 additions and 124 deletions

View File

@@ -380,6 +380,7 @@ public final class MinionSpawnManager extends AbstractNpcAI
NPC.add(27266); // Fallen Angel Haures
NPC.add(27267); // Fallen Angel Haures
NPC.add(27290); // White Wing Commander
NPC.add(29001); // Queen Ant
NPC.add(29030); // Fenril Hound Kerinne
NPC.add(29033); // Fenril Hound Freki
NPC.add(29037); // Fenril Hound Kinaz

View File

@@ -520,7 +520,7 @@ public final class Antharas extends AbstractNpcAI
}
else
{
player.sendMessage(getClass().getSimpleName() + ": You cant skip waiting time right now!");
player.sendMessage(getClass().getSimpleName() + ": You can't skip waiting time right now!");
}
break;
}
@@ -535,7 +535,7 @@ public final class Antharas extends AbstractNpcAI
}
else
{
player.sendMessage(getClass().getSimpleName() + ": You cant respawn antharas while antharas is alive!");
player.sendMessage(getClass().getSimpleName() + ": You can't respawn antharas while antharas is alive!");
}
break;
}
@@ -553,12 +553,12 @@ public final class Antharas extends AbstractNpcAI
}
if (player != null) // Player dont will be null just when is this event called from GM command
{
player.sendMessage(getClass().getSimpleName() + ": All minions has been deleted!");
player.sendMessage(getClass().getSimpleName() + ": All minions have been deleted!");
}
}
else if (player != null) // Player dont will be null just when is this event called from GM command
{
player.sendMessage(getClass().getSimpleName() + ": You cant despawn minions right now!");
player.sendMessage(getClass().getSimpleName() + ": You can't despawn minions right now!");
}
break;
}
@@ -594,7 +594,7 @@ public final class Antharas extends AbstractNpcAI
}
else
{
player.sendMessage(getClass().getSimpleName() + ": You cant abort fight right now!");
player.sendMessage(getClass().getSimpleName() + ": You can't abort fight right now!");
}
break;
}
@@ -713,6 +713,7 @@ public final class Antharas extends AbstractNpcAI
{
cancelQuestTimer("SET_REGEN", npc, null);
startQuestTimer("SET_REGEN", 60000, npc, null);
((L2Attackable) npc).setOnKillDelay(0);
}
else
{

View File

@@ -564,27 +564,28 @@ public final class RainbowSpringsChateau extends ClanHallSiegeEngine
}
}
}
else if (event.startsWith("getItem"))
{
if (!_pendingItemToGet.containsKey(clan))
{
html = "yeti_cannot_exchange.htm";
}
int left = _pendingItemToGet.get(clan);
if (left > 0)
{
int itemId = Integer.parseInt(event.split("_")[1]);
player.addItem("Rainbow Spring Chateau Siege", itemId, 1, npc, true);
--left;
_pendingItemToGet.put(clan, left);
html = "yeti_main.htm";
}
else
{
html = "yeti_cannot_exchange.htm";
}
}
// TODO(Zoey76): Rewrite this to prevent exploits...
// else if (event.startsWith("getItem"))
// {
// if (!_pendingItemToGet.containsKey(clan))
// {
// html = "yeti_cannot_exchange.htm";
// }
//
// int left = _pendingItemToGet.get(clan);
// if (left > 0)
// {
// int itemId = Integer.parseInt(event.split("_")[1]);
// player.addItem("Rainbow Spring Chateau Siege", itemId, 1, npc, true);
// --left;
// _pendingItemToGet.put(clan, left);
// html = "yeti_main.htm";
// }
// else
// {
// html = "yeti_cannot_exchange.htm";
// }
// }
return html;
}

View File

@@ -183,6 +183,7 @@ public final class HallOfSuffering extends AbstractNpcAI
// Misc
private static final int TEMPLATE_ID = 115;
private static final int MIN_LEVEL = 75;
private static final int MAX_LEVEL = 82;
private static final boolean debug = false;
public HallOfSuffering()
@@ -219,7 +220,7 @@ public final class HallOfSuffering extends AbstractNpcAI
for (L2PcInstance partyMember : party.getMembers())
{
if (partyMember.getLevel() < MIN_LEVEL)
if ((partyMember.getLevel() < MIN_LEVEL) || (partyMember.getLevel() > MAX_LEVEL))
{
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_S_LEVEL_DOES_NOT_CORRESPOND_TO_THE_REQUIREMENTS_FOR_ENTRY);
sm.addPcName(partyMember);

View File

@@ -19,18 +19,18 @@
package handlers.actionhandlers;
import com.l2jserver.Config;
import com.l2jserver.gameserver.GeoData;
import com.l2jserver.gameserver.ai.CtrlIntention;
import com.l2jserver.gameserver.enums.InstanceType;
import com.l2jserver.gameserver.handler.IActionHandler;
import com.l2jserver.gameserver.model.L2Object;
import com.l2jserver.gameserver.model.actor.L2Character;
import com.l2jserver.gameserver.model.Location;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.entity.L2Event;
import com.l2jserver.gameserver.model.events.EventDispatcher;
import com.l2jserver.gameserver.model.events.EventType;
import com.l2jserver.gameserver.model.events.impl.character.npc.OnNpcFirstTalk;
import com.l2jserver.gameserver.network.serverpackets.ActionFailed;
import com.l2jserver.gameserver.network.serverpackets.MoveToPawn;
import com.l2jserver.util.Rnd;
@@ -79,23 +79,27 @@ public class L2NpcAction implements IActionHandler
else if (interact)
{
// Check if the activeChar is attackable (without a forced attack) and isn't dead
if (target.isAutoAttackable(activeChar) && !((L2Character) target).isAlikeDead())
if (target.isAutoAttackable(activeChar) && !((L2Npc) target).isAlikeDead())
{
// Check the height difference
if (Math.abs(activeChar.getZ() - target.getZ()) < 400) // this max heigth difference might need some tweaking
if (GeoData.getInstance().canSeeTarget(activeChar, target))
{
// Set the L2PcInstance Intention to AI_INTENTION_ATTACK
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
// activeChar.startAttack(this);
}
else
{
// Send a Server->Client ActionFailed to the L2PcInstance in order to avoid that the client wait another packet
activeChar.sendPacket(ActionFailed.STATIC_PACKET);
final Location destination = GeoData.getInstance().moveCheck(activeChar, target);
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, destination);
}
}
else if (!target.isAutoAttackable(activeChar))
{
if (GeoData.getInstance().canSeeTarget(activeChar, target))
{
final Location destination = GeoData.getInstance().moveCheck(activeChar, target);
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, destination);
return true;
}
// Calculate the distance between the L2PcInstance and the L2Npc
if (!((L2Npc) target).canInteract(activeChar))
{

View File

@@ -25,7 +25,6 @@ import com.l2jserver.gameserver.enums.PrivateStoreType;
import com.l2jserver.gameserver.handler.IActionHandler;
import com.l2jserver.gameserver.model.L2Object;
import com.l2jserver.gameserver.model.Location;
import com.l2jserver.gameserver.model.actor.L2Character;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.entity.TvTEvent;
import com.l2jserver.gameserver.network.SystemMessageId;
@@ -33,6 +32,8 @@ import com.l2jserver.gameserver.network.serverpackets.ActionFailed;
public class L2PcInstanceAction implements IActionHandler
{
private static final int CURSED_WEAPON_VICTIM_MIN_LEVEL = 21;
/**
* Manage actions when a player click on this L2PcInstance.<BR>
* <BR>
@@ -83,50 +84,48 @@ public class L2PcInstanceAction implements IActionHandler
}
else if (interact)
{
final L2PcInstance player = target.getActingPlayer();
// Check if this L2PcInstance has a Private Store
if (((L2PcInstance) target).getPrivateStoreType() != PrivateStoreType.NONE)
if (player.getPrivateStoreType() != PrivateStoreType.NONE)
{
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, target);
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, player);
}
else
{
// Check if this L2PcInstance is autoAttackable
if (target.isAutoAttackable(activeChar))
if (player.isAutoAttackable(activeChar))
{
// activeChar with lvl < 21 can't attack a cursed weapon holder
// And a cursed weapon holder can't attack activeChars with lvl < 21
if ((((L2PcInstance) target).isCursedWeaponEquipped() && (activeChar.getLevel() < 21)) || (activeChar.isCursedWeaponEquipped() && (((L2Character) target).getLevel() < 21)))
if ((player.isCursedWeaponEquipped() && (activeChar.getLevel() < CURSED_WEAPON_VICTIM_MIN_LEVEL)) //
|| (activeChar.isCursedWeaponEquipped() && (player.getLevel() < CURSED_WEAPON_VICTIM_MIN_LEVEL)))
{
activeChar.sendPacket(ActionFailed.STATIC_PACKET);
}
else
{
if (GeoData.getInstance().canSeeTarget(activeChar, target))
if (GeoData.getInstance().canSeeTarget(activeChar, player))
{
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
activeChar.onActionRequest();
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
}
else
{
final Location destination = GeoData.getInstance().moveCheck(activeChar.getX(), activeChar.getY(), activeChar.getZ(), target.getX(), target.getY(), target.getZ(), activeChar.getInstanceId());
final Location destination = GeoData.getInstance().moveCheck(activeChar, player);
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, destination);
activeChar.onActionRequest();
}
activeChar.onActionRequest();
}
}
else
{
// This Action Failed packet avoids activeChar getting stuck when clicking three or more times
activeChar.sendPacket(ActionFailed.STATIC_PACKET);
if (GeoData.getInstance().canSeeTarget(activeChar, target))
if (GeoData.getInstance().canSeeTarget(activeChar, player))
{
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, target);
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
}
else
{
final Location destination = GeoData.getInstance().moveCheck(activeChar.getX(), activeChar.getY(), activeChar.getZ(), target.getX(), target.getY(), target.getZ(), activeChar.getInstanceId());
final Location destination = GeoData.getInstance().moveCheck(activeChar, player);
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, destination);
activeChar.onActionRequest();
}
}
}

View File

@@ -35,7 +35,7 @@ public class Q10502_FreyaEmbroideredSoulCloak extends Quest
// NPC
private static final int OLF_ADAMS = 32612;
// Monster
private static final int FREYA = 29180;
private static final int FREYA = 29179;
// Items
private static final int FREYAS_SOUL_FRAGMENT = 21723;
private static final int SOUL_CLOAK_OF_FREYA = 21720;