Sync with L2JServer Feb 7th 2015.

This commit is contained in:
mobius
2015-02-07 23:48:56 +00:00
parent 1e166ca657
commit ecd17fdefb
1949 changed files with 3120 additions and 33466 deletions

View File

@@ -21,15 +21,12 @@ package gracia.AI;
import java.util.Map;
import javolution.util.FastMap;
import quests.Q00692_HowtoOpposeEvil.Q00692_HowtoOpposeEvil;
import ai.npc.AbstractNpcAI;
import com.l2jserver.Config;
import com.l2jserver.gameserver.ThreadPoolManager;
import com.l2jserver.gameserver.ai.CtrlIntention;
import com.l2jserver.gameserver.data.xml.impl.DoorData;
import com.l2jserver.gameserver.data.xml.impl.NpcData;
import com.l2jserver.gameserver.enums.QuestSound;
import com.l2jserver.gameserver.idfactory.IdFactory;
import com.l2jserver.gameserver.instancemanager.GraciaSeedsManager;
import com.l2jserver.gameserver.instancemanager.ZoneManager;
@@ -41,7 +38,6 @@ import com.l2jserver.gameserver.model.actor.instance.L2DoorInstance;
import com.l2jserver.gameserver.model.actor.instance.L2MonsterInstance;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate;
import com.l2jserver.gameserver.model.quest.QuestState;
import com.l2jserver.gameserver.model.skills.Skill;
import com.l2jserver.gameserver.model.zone.L2ZoneType;
import com.l2jserver.gameserver.network.SystemMessageId;
@@ -54,7 +50,6 @@ import com.l2jserver.gameserver.util.Util;
*/
public class EnergySeeds extends AbstractNpcAI
{
private static final int HOWTOOPPOSEEVIL_CHANCE = 60;
private static final int RATE = 1;
private static final int RESPAWN = 480000;
private static final int RANDOM_RESPAWN_OFFSET = 180000;
@@ -316,26 +311,9 @@ public class EnergySeeds extends AbstractNpcAI
{
return;
}
QuestState st = player.getQuestState(Q00692_HowtoOpposeEvil.class.getSimpleName());
switch (seedType)
{
case INFINITY:
if ((st != null) && st.isCond(3))
{
handleQuestDrop(player, 13798);
}
break;
case DESTRUCTION:
if ((st != null) && st.isCond(3))
{
handleQuestDrop(player, 13867);
}
break;
case ANNIHILATION_BISTAKON:
if ((st != null) && st.isCond(3))
{
handleQuestDrop(player, 15535);
}
if (getRandom(100) < 50)
{
L2MonsterInstance mob = spawnSupriseMob(seedEnergy, ANNIHILATION_SUPRISE_MOB_IDS[0][getRandom(ANNIHILATION_SUPRISE_MOB_IDS[0].length)]);
@@ -345,10 +323,6 @@ public class EnergySeeds extends AbstractNpcAI
}
break;
case ANNIHILATION_REPTILIKON:
if ((st != null) && st.isCond(3))
{
handleQuestDrop(player, 15535);
}
if (getRandom(100) < 50)
{
L2MonsterInstance mob = spawnSupriseMob(seedEnergy, ANNIHILATION_SUPRISE_MOB_IDS[1][getRandom(ANNIHILATION_SUPRISE_MOB_IDS[1].length)]);
@@ -358,10 +332,6 @@ public class EnergySeeds extends AbstractNpcAI
}
break;
case ANNIHILATION_COKRAKON:
if ((st != null) && st.isCond(3))
{
handleQuestDrop(player, 15535);
}
if (getRandom(100) < 50)
{
L2MonsterInstance mob = spawnSupriseMob(seedEnergy, ANNIHILATION_SUPRISE_MOB_IDS[2][getRandom(ANNIHILATION_SUPRISE_MOB_IDS[2].length)]);
@@ -386,22 +356,6 @@ public class EnergySeeds extends AbstractNpcAI
return monster;
}
private void handleQuestDrop(L2PcInstance player, int itemId)
{
double chance = HOWTOOPPOSEEVIL_CHANCE * Config.RATE_QUEST_DROP;
int numItems = (int) (chance / 100);
chance = chance % 100;
if (getRandom(100) < chance)
{
numItems++;
}
if (numItems > 0)
{
giveItems(player, itemId, numItems);
playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
}
private void addSpawnsToList()
{
// Seed of Destruction

View File

@@ -24,10 +24,10 @@ import java.util.GregorianCalendar;
import ai.npc.AbstractNpcAI;
import com.l2jserver.gameserver.datatables.SpawnTable;
import com.l2jserver.gameserver.enums.ChatType;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.network.NpcStringId;
import com.l2jserver.gameserver.network.clientpackets.Say2;
/**
* Lindvior Scene AI.
@@ -65,13 +65,13 @@ public class Lindvior extends AbstractNpcAI
switch (event)
{
case "tomaris_shout1":
broadcastNpcSay(npc, Say2.NPC_SHOUT, NpcStringId.HUH_THE_SKY_LOOKS_FUNNY_WHAT_S_THAT);
broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.HUH_THE_SKY_LOOKS_FUNNY_WHAT_S_THAT);
break;
case "artius_shout":
broadcastNpcSay(npc, Say2.NPC_SHOUT, NpcStringId.A_POWERFUL_SUBORDINATE_IS_BEING_HELD_BY_THE_BARRIER_ORB_THIS_REACTION_MEANS);
broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.A_POWERFUL_SUBORDINATE_IS_BEING_HELD_BY_THE_BARRIER_ORB_THIS_REACTION_MEANS);
break;
case "tomaris_shout2":
broadcastNpcSay(npc, Say2.NPC_SHOUT, NpcStringId.BE_CAREFUL_SOMETHING_S_COMING);
broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.BE_CAREFUL_SOMETHING_S_COMING);
break;
case "lindvior_scene":
if (npc != null)

View File

@@ -24,11 +24,11 @@ import java.util.concurrent.ConcurrentHashMap;
import ai.npc.AbstractNpcAI;
import com.l2jserver.gameserver.enums.ChatType;
import com.l2jserver.gameserver.model.L2Spawn;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.network.NpcStringId;
import com.l2jserver.gameserver.network.clientpackets.Say2;
import com.l2jserver.gameserver.network.serverpackets.NpcSay;
/**
@@ -70,13 +70,13 @@ public final class GeneralDilios extends AbstractNpcAI
int value = Integer.parseInt(event.substring(8));
if (value < 6)
{
_general.broadcastPacket(new NpcSay(_general.getObjectId(), Say2.NPC_ALL, GENERAL_ID, NpcStringId.STABBING_THREE_TIMES));
_general.broadcastPacket(new NpcSay(_general.getObjectId(), ChatType.NPC_GENERAL, GENERAL_ID, NpcStringId.STABBING_THREE_TIMES));
startQuestTimer("guard_animation_0", 3400, null, null);
}
else
{
value = -1;
_general.broadcastPacket(new NpcSay(_general.getObjectId(), Say2.NPC_SHOUT, GENERAL_ID, DILIOS_TEXT[getRandom(DILIOS_TEXT.length)]));
_general.broadcastPacket(new NpcSay(_general.getObjectId(), ChatType.NPC_SHOUT, GENERAL_ID, DILIOS_TEXT[getRandom(DILIOS_TEXT.length)]));
}
startQuestTimer("command_" + (value + 1), 60000, null, null);
}

View File

@@ -20,10 +20,10 @@ package gracia.AI.NPC.Seyo;
import ai.npc.AbstractNpcAI;
import com.l2jserver.gameserver.enums.ChatType;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.network.NpcStringId;
import com.l2jserver.gameserver.network.clientpackets.Say2;
/**
* Seyo AI.
@@ -68,7 +68,7 @@ public final class Seyo extends AbstractNpcAI
if (npc.isScriptValue(1))
{
npc.setScriptValue(0);
broadcastNpcSay(npc, Say2.NPC_ALL, TEXT[getRandom(TEXT.length)]);
broadcastNpcSay(npc, ChatType.NPC_GENERAL, TEXT[getRandom(TEXT.length)]);
}
break;
}
@@ -89,11 +89,11 @@ public final class Seyo extends AbstractNpcAI
if (getRandom(100) == 0)
{
giveItems(player, STONE_FRAGMENT, 100);
broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.AMAZING_S1_TOOK_100_OF_THESE_SOUL_STONE_FRAGMENTS_WHAT_A_COMPLETE_SWINDLER, player.getName());
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.AMAZING_S1_TOOK_100_OF_THESE_SOUL_STONE_FRAGMENTS_WHAT_A_COMPLETE_SWINDLER, player.getName());
}
else
{
broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.HMM_HEY_DID_YOU_GIVE_S1_SOMETHING_BUT_IT_WAS_JUST_1_HAHA, player.getName());
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.HMM_HEY_DID_YOU_GIVE_S1_SOMETHING_BUT_IT_WAS_JUST_1_HAHA, player.getName());
}
startQuestTimer("TRICKERY_TIMER", 5000, npc, null);
}
@@ -116,18 +116,18 @@ public final class Seyo extends AbstractNpcAI
final int chance = getRandom(100);
if (chance < 20)
{
broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.AHEM_S1_HAS_NO_LUCK_AT_ALL_TRY_PRAYING, player.getName());
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.AHEM_S1_HAS_NO_LUCK_AT_ALL_TRY_PRAYING, player.getName());
}
else if (chance < 80)
{
giveItems(player, STONE_FRAGMENT, 1);
broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.IT_S_BETTER_THAN_LOSING_IT_ALL_RIGHT_OR_DOES_THIS_FEEL_WORSE);
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.IT_S_BETTER_THAN_LOSING_IT_ALL_RIGHT_OR_DOES_THIS_FEEL_WORSE);
}
else
{
final int itemCount = getRandom(10, 16);
giveItems(player, STONE_FRAGMENT, itemCount);
broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.S1_PULLED_ONE_WITH_S2_DIGITS_LUCKY_NOT_BAD, player.getName(), String.valueOf(itemCount));
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.S1_PULLED_ONE_WITH_S2_DIGITS_LUCKY_NOT_BAD, player.getName(), String.valueOf(itemCount));
}
startQuestTimer("TRICKERY_TIMER", 5000, npc, null);
}
@@ -151,17 +151,17 @@ public final class Seyo extends AbstractNpcAI
if (chance == 0)
{
giveItems(player, STONE_FRAGMENT, 10000);
broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.AH_IT_S_OVER_WHAT_KIND_OF_GUY_IS_THAT_DAMN_FINE_YOU_S1_TAKE_IT_AND_GET_OUTTA_HERE, player.getName());
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.AH_IT_S_OVER_WHAT_KIND_OF_GUY_IS_THAT_DAMN_FINE_YOU_S1_TAKE_IT_AND_GET_OUTTA_HERE, player.getName());
}
else if (chance < 10)
{
giveItems(player, STONE_FRAGMENT, 1);
broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.YOU_DON_T_FEEL_BAD_RIGHT_ARE_YOU_SAD_BUT_DON_T_CRY);
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.YOU_DON_T_FEEL_BAD_RIGHT_ARE_YOU_SAD_BUT_DON_T_CRY);
}
else
{
giveItems(player, STONE_FRAGMENT, getRandom(1, 100));
broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.A_BIG_PIECE_IS_MADE_UP_OF_LITTLE_PIECES_SO_HERE_S_A_LITTLE_PIECE);
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.A_BIG_PIECE_IS_MADE_UP_OF_LITTLE_PIECES_SO_HERE_S_A_LITTLE_PIECE);
}
startQuestTimer("TRICKERY_TIMER", 5000, npc, null);
}