Sync with L2JServer Jan 26th 2015.
This commit is contained in:
@@ -190,7 +190,7 @@ public final class DragonValley extends AbstractNpcAI
|
||||
{
|
||||
spawnGhost(npc, killer, isSummon, 20);
|
||||
}
|
||||
else if (((L2Attackable) npc).isSweepActive())
|
||||
else if (((L2Attackable) npc).isSpoiled())
|
||||
{
|
||||
npc.dropItem(killer, getRandom(GREATER_HERB_OF_MANA, SUPERIOR_HERB_OF_MANA), 1);
|
||||
manageMoraleBoost(killer, npc);
|
||||
|
@@ -1,76 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2004-2015 L2J DataPack
|
||||
*
|
||||
* This file is part of L2J DataPack.
|
||||
*
|
||||
* L2J DataPack 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 DataPack 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 ai.individual;
|
||||
|
||||
import ai.npc.AbstractNpcAI;
|
||||
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.itemcontainer.Inventory;
|
||||
import com.l2jserver.gameserver.model.quest.QuestState;
|
||||
import com.l2jserver.gameserver.network.NpcStringId;
|
||||
import com.l2jserver.gameserver.network.clientpackets.Say2;
|
||||
|
||||
/**
|
||||
* Cat's Eye Bandit (Quest Monster) AI.
|
||||
* @author Gladicek
|
||||
*/
|
||||
public final class CatsEyeBandit extends AbstractNpcAI
|
||||
{
|
||||
// NPC ID
|
||||
private static final int MOB_ID = 27038;
|
||||
// Weapons
|
||||
private static final int BOW = 1181;
|
||||
private static final int DAGGER = 1182;
|
||||
|
||||
private CatsEyeBandit()
|
||||
{
|
||||
super(CatsEyeBandit.class.getSimpleName(), "ai/individual");
|
||||
addAttackId(MOB_ID);
|
||||
addKillId(MOB_ID);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isSummon)
|
||||
{
|
||||
final QuestState qs = attacker.getQuestState("403_PathToRogue"); // TODO: Replace with class name.
|
||||
if (npc.isScriptValue(0) && (qs != null) && ((qs.getItemEquipped(Inventory.PAPERDOLL_RHAND) == BOW) || (qs.getItemEquipped(Inventory.PAPERDOLL_RHAND) == DAGGER)))
|
||||
{
|
||||
broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.YOU_CHILDISH_FOOL_DO_YOU_THINK_YOU_CAN_CATCH_ME);
|
||||
npc.setScriptValue(1);
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isSummon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
|
||||
{
|
||||
final QuestState qs = killer.getQuestState("403_PathToRogue"); // TODO: Replace with class name.
|
||||
if (qs != null)
|
||||
{
|
||||
broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.I_MUST_DO_SOMETHING_ABOUT_THIS_SHAMEFUL_INCIDENT);
|
||||
}
|
||||
return super.onKill(npc, killer, isSummon);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new CatsEyeBandit();
|
||||
}
|
||||
}
|
@@ -197,7 +197,7 @@ public class MentorGuide extends AbstractNpcAI implements IXmlReader
|
||||
event.getMentor().sendPacket(new ExMentorList(event.getMentor()));
|
||||
|
||||
// Add the mentee skill
|
||||
event.getMentee().addSkill(MENTEE_MENTOR_SUMMON.getSkill(), false);
|
||||
event.getMentee().addSkill(MENTEE_MENTOR_SUMMON.getSkill(), true);
|
||||
|
||||
// Send mail with the headphone
|
||||
sendMail(event.getMentee(), MENTEE_ADDED_TITLE, MENTEE_ADDED_BODY, MENTEE_HEADPHONE, 1);
|
||||
@@ -400,6 +400,8 @@ public class MentorGuide extends AbstractNpcAI implements IXmlReader
|
||||
if (mentor != null)
|
||||
{
|
||||
MentorManager.getInstance().setPenalty(mentor.getObjectId(), Config.MENTOR_PENALTY_FOR_MENTEE_COMPLETE);
|
||||
MentorManager.getInstance().deleteMentor(mentor.getObjectId(), player.getObjectId());
|
||||
|
||||
if (mentor.isOnline())
|
||||
{
|
||||
mentor.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.S1_HAS_AWAKENED_AND_THE_MENTOR_MENTEE_RELATIONSHIP_HAS_ENDED_THE_MENTOR_CANNOT_OBTAIN_ANOTHER_MENTEE_FOR_ONE_DAY_AFTER_THE_MENTEE_S_GRADUATION).addPcName(player));
|
||||
@@ -411,8 +413,6 @@ public class MentorGuide extends AbstractNpcAI implements IXmlReader
|
||||
mentor.sendPacket(new ExMentorList(mentor.getPlayerInstance()));
|
||||
}
|
||||
|
||||
MentorManager.getInstance().deleteMentor(mentor.getObjectId(), player.getObjectId());
|
||||
|
||||
// Remove the mentee skills
|
||||
player.removeSkill(MENTEE_MENTOR_SUMMON.getSkillId());
|
||||
|
||||
@@ -445,13 +445,18 @@ public class MentorGuide extends AbstractNpcAI implements IXmlReader
|
||||
int amount = MENTEE_COINS.get(player.getLevel());
|
||||
if (amount > 0)
|
||||
{
|
||||
sendMail(player, LEVEL_UP_TITLE, String.format(LEVEL_UP_BODY, player.getName(), player.getLevel()), MENTEE_MARK, amount);
|
||||
sendMail(mentor.getObjectId(), player, LEVEL_UP_TITLE, String.format(LEVEL_UP_BODY, player.getName(), player.getLevel()), MENTEE_MARK, amount);
|
||||
}
|
||||
}
|
||||
|
||||
private void sendMail(L2PcInstance player, String title, String body, int itemId, long amount)
|
||||
{
|
||||
final Message msg = new Message(MENTOR_GUIDE, player.getObjectId(), title, body, MailType.MENTOR_NPC);
|
||||
sendMail(player.getObjectId(), player, title, body, itemId, amount);
|
||||
}
|
||||
|
||||
private void sendMail(int objectId, L2PcInstance player, String title, String body, int itemId, long amount)
|
||||
{
|
||||
final Message msg = new Message(MENTOR_GUIDE, objectId, title, body, MailType.MENTOR_NPC);
|
||||
msg.createAttachments().addItem(getName(), itemId, amount, null, player);
|
||||
|
||||
MailManager.getInstance().sendMessage(msg);
|
||||
|
@@ -69,9 +69,9 @@ public final class GrandBossTeleporters extends AbstractNpcAI
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
String htmltext = "";
|
||||
QuestState st = getQuestState(player, false);
|
||||
final QuestState st = getQuestState(player, false);
|
||||
|
||||
if (st.hasQuestItems(VACUALITE_FLOATING_STONE))
|
||||
if (hasQuestItems(player, VACUALITE_FLOATING_STONE))
|
||||
{
|
||||
player.teleToLocation(ENTER_HALL_OF_FLAMES);
|
||||
st.set("allowEnter", "1");
|
||||
@@ -87,12 +87,7 @@ public final class GrandBossTeleporters extends AbstractNpcAI
|
||||
public String onTalk(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
String htmltext = "";
|
||||
QuestState st = getQuestState(player, true);
|
||||
|
||||
if (st == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
final QuestState st = getQuestState(player, true);
|
||||
|
||||
switch (npc.getId())
|
||||
{
|
||||
|
Reference in New Issue
Block a user