PHP код:
public void run()
{
if (this._phantom.isDead())
this._phantom.kick();
if (this._phantom.isInWater())
this._phantom.teleToClosestTown();
if ((Rnd.get(100) < 10) &&
(Rnd.get(100) < 10) &&
(this._phantom.isSitting()))
this._phantom.standUp();
if (Rnd.get(100) < 80)
for (NpcInstance npc : World.getAroundNpc(this._phantom, 100, 100))
for (int buffers_id : PhantomPlayers._buffers)
if ((npc.getNpcId() == buffers_id) && (!this._phantom.isSitting()))
{
if ((!this._phantom.getClassId().isMage()) || (this._phantom.getClassId().getRace() == Race.orc))
for (int[] buff : PhantomPlayers._warrBuff)
npc.broadcastPacket(new L2GameServerPacket[] { new MagicSkillUse(npc, this._phantom, buff[2], buff[3], 0, 0L) });
if ((this._phantom.getClassId().isMage()) && (this._phantom.getClassId().getRace() != Race.orc))
for (int[] buff : PhantomPlayers._mageBuff)
npc.broadcastPacket(new L2GameServerPacket[] { new MagicSkillUse(npc, this._phantom, buff[2], buff[3], 0, 0L) });
}
Say2 cs3;
if (Rnd.get(100) < 5)
{
Say2 cs;
Say2 cs2;
switch (Rnd.get(1, 3))
{
case 1:
cs = new Say2(this._phantom.getObjectId(), ChatType.SHOUT, this._phantom.getName(), PhantomPlayers.this.getRandomEnchantPhrase());
for (Player player : World.getAroundPlayers(this._phantom, 10000, 3000))
if ((player != null) &&
(!player.isBlockAll()))
player.sendPacket(cs);
break;
case 2:
cs2 = new Say2(this._phantom.getObjectId(), ChatType.TRADE, this._phantom.getName(), PhantomPlayers.this.getRandomEnchantPhrase());
for (Player player : World.getAroundPlayers(this._phantom, 5000, 2000))
if ((player != null) &&
(!player.isBlockAll()))
player.sendPacket(cs2);
break;
case 3:
cs3 = new Say2(this._phantom.getObjectId(), ChatType.ALL, this._phantom.getName(), PhantomPlayers.this.getRandomEnchantPhrase());
for (Player player : World.getAroundPlayers(this._phantom, 1200, 1000)) {
if ((player != null) &&
(!player.isBlockAll()))
player.sendPacket(cs3);
}
}
}
if (Rnd.get(100) < 10)
{
if ((!this._phantom.getClassId().isMage()) || (this._phantom.getClassId().getRace() == Race.orc))
this._phantom.broadcastPacket(new L2GameServerPacket[] { new MagicSkillUse(this._phantom, this._phantom, 2153, 1, 0, 0L) });
if ((this._phantom.getClassId().isMage()) && (this._phantom.getClassId().getRace() != Race.orc))
this._phantom.broadcastPacket(new L2GameServerPacket[] { new MagicSkillUse(this._phantom, this._phantom, 2158, 1, 0, 0L) });
}
if (Rnd.get(100) < 70)
{
if ((!this._phantom.getClassId().isMage()) || (this._phantom.getClassId().getRace() == Race.orc))
for (Player player : World.getAroundPlayers(this._phantom, 100, 100))
if ((GeoEngine.canSeeTarget(this._phantom, player, false)) && (!player.isDead()) && (!player.isInZonePeace()) && (!this._phantom.isInZonePeace()) && ((player.getKarma() != 0) || (player.getPvpFlag() > 0)))
{
if (this._phantom.getRealDistance3D(player) <= this._phantom.getPhysicalAttackRange() + 40)
{
this._phantom.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
try {
Thread.sleep(500L);
}
catch (InterruptedException e) {
e.printStackTrace();
}
if (this._phantom.getClassId().getRace() == Race.human)
this._phantom.doCast(SkillTable.getInstance().getInfo(3, 2), player, true);
if (this._phantom.getClassId().getRace() == Race.elf)
this._phantom.doCast(SkillTable.getInstance().getInfo(3, 2), player, true);
if (this._phantom.getClassId().getRace() == Race.darkelf)
this._phantom.doCast(SkillTable.getInstance().getInfo(3, 2), player, true);
if (this._phantom.getClassId().getRace() == Race.orc)
this._phantom.doCast(SkillTable.getInstance().getInfo(29, 2), player, true);
if (this._phantom.getClassId().getRace() == Race.dwarf)
this._phantom.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
if (this._phantom.getClassId().getRace() == Race.kamael)
this._phantom.doCast(SkillTable.getInstance().getInfo(468, 2), player, true);
try {
Thread.sleep(2000L);
}
catch (InterruptedException e) {
e.printStackTrace();
}
this._phantom.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
}
else {
try {
Thread.sleep(500L);
}
catch (InterruptedException e) {
e.printStackTrace();
}
}
this._phantom.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
}
if ((this._phantom.getClassId().isMage()) && (this._phantom.getClassId().getRace() != Race.orc))
for (Player player : World.getAroundPlayers(this._phantom, 100, 100))
if ((GeoEngine.canSeeTarget(this._phantom, player, false)) && (!player.isDead()) && (!player.isInZonePeace()) && (!this._phantom.isInZonePeace()) && ((player.getKarma() != 0) || (player.getPvpFlag() > 0)))
{
this._phantom.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
this._phantom.doCast(SkillTable.getInstance().getInfo(1177, 2), player, true);
}
}
if (Rnd.get(100) < 10)
{
if ((!this._phantom.getClassId().isMage()) || (this._phantom.getClassId().getRace() == Race.orc))
for (NpcInstance npc : World.getAroundNpc(this._phantom, 800, 200))
if ((GeoEngine.canSeeTarget(this._phantom, npc, false)) && (npc.isMonster()) && (!npc.isDead()))
this._phantom.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, npc);
if ((this._phantom.getClassId().isMage()) && (this._phantom.getClassId().getRace() != Race.orc))
for (NpcInstance npc : World.getAroundNpc(this._phantom, 800, 200))
if ((GeoEngine.canSeeTarget(this._phantom, npc, false)) && (npc.isMonster()) && (!npc.isDead()))
{
this._phantom.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, npc);
this._phantom.doCast(SkillTable.getInstance().getInfo(1177, 2), npc, true);
}
}
if (Rnd.get(100) < 5)
{
if ((!this._phantom.getClassId().isMage()) || (this._phantom.getClassId().getRace() == Race.orc))
for (Player player : World.getAroundPlayers(this._phantom, 600, 200))
if ((GeoEngine.canSeeTarget(this._phantom, player, false)) && (!player.isDead()) && (!player.isInZonePeace()) && (!this._phantom.isInZonePeace()))
this._phantom.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
if ((this._phantom.getClassId().isMage()) && (this._phantom.getClassId().getRace() != Race.orc))
for (Player player : World.getAroundPlayers(this._phantom, 600, 200))
if ((GeoEngine.canSeeTarget(this._phantom, player, false)) && (!player.isDead()) && (!player.isInZonePeace()) && (!this._phantom.isInZonePeace()))
{
this._phantom.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
this._phantom.doCast(SkillTable.getInstance().getInfo(1177, 2), player, true);
}
}
if ((Rnd.get(100) < 10) && (
(this._phantom.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK) || (this._phantom.getAI().getIntention() != CtrlIntention.AI_INTENTION_CAST)))
for (GameObject obj : World.getAroundObjects(this._phantom, 800, 200))
if (obj.isItem())
this._phantom.getAI().setIntention(CtrlIntention.AI_INTENTION_PICK_UP, obj);
if ((this._phantom.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK) || (this._phantom.getAI().getIntention() != CtrlIntention.AI_INTENTION_CAST))
this._phantom.rndWalk();
PhantomPlayers.this.startWalk(this._phantom);
}
}