Quest Request of the Seeker (10363).

Contributed by spider.
This commit is contained in:
MobiusDev 2015-08-12 12:48:47 +00:00
parent cd6d0d7188
commit d5a85ec14c
18 changed files with 391 additions and 68 deletions

View File

@ -0,0 +1,5 @@
<html><body>Nagel:<br>
Do you hear that?<br>
I've heard noises every since I came to this damned place. It's not just me, either. Others have heard it, and it freaks us all out.<br>
<button align=LEFT icon=NORMAL action="bypass -h Quest Q10363_RequestOfTheSeeker 33450-02.htm">"What do you hear exactly?"</button>
</body></html>

View File

@ -0,0 +1,6 @@
<html><body>Nagel:<br>
Crying, that's what.<br>
I can hear the cries of the people who've died here... the cries of the soldiers who were sacrificed to defend heir families and friends...<br>
Please - stop their suffering.<br>
<button align=LEFT icon=NORMAL action="bypass -h Quest Q10363_RequestOfTheSeeker 33450-03.htm">"I'll try."</button>
</body></html>

View File

@ -0,0 +1,5 @@
<html><body>Nagel:<br>
Thank you!<br>
Listen, you'll find the corpses <font color="LEVEL">beyond the cracked gap</font>. You must show <font color="LEVEL">sorrow</font> before <font color="LEVEL"> five corpses</font>, and show them that we grieve for them.<br>
(To show your grief, select a <font color="LEVEL">corpse</font>, and open your Action Window(Alt+C), then click <font color="LEVEL">Sorrow</font>.)
</body></html>

View File

@ -0,0 +1,3 @@
<html><body>Nagel:<br>
You can find <font color="LEVEL">the corpses beyond the cracked gap</font>.
</body></html>

View File

@ -0,0 +1,7 @@
<html><body>Nagel:<br>
Thank you!<br>
The pain will hopefully start to subside now... hopefully.<br>
Listen, I have one more favor to ask. The other rangers all knew I was suffering the most, and were all looking out for me, <font color="LEVEL">Celin</font> especially.<br>
Could you tell Celin what's happened? I'd appreciate it...<br>
<button align=LEFT icon=NORMAL action="bypass -h Quest Q10363_RequestOfTheSeeker 33450-06.html">"Of course."</button>
</body></html>

View File

@ -0,0 +1,4 @@
<html><body>Nagel:<br>
Thank you!<br>
<font color="LEVEL">Celin</font> is in <font color="LEVEL">Exploration Zone 3</font>. Thank you again!
</body></html>

View File

@ -0,0 +1,4 @@
<html><body>Celin:<br>
Did you hear crying on your way here? I think the noises have died down, but mayby I'm finally getting used to them...<br>
<button align=LEFT icon=NORMAL action="bypass -h Quest Q10363_RequestOfTheSeeker 33451-02.html">"I've seen them, and paid my condolences.</button>
</body></html>

View File

@ -0,0 +1,6 @@
<html><body>Celin:<br>
You have? Oh... oh thank you!<br>
Maybe now we can finally get some rest, and actually get some work done around here! The noises were so upsetting...<br>
Please, tell me how Nagel is? We all found it tough, but he dealt with everything much worse than the rest of us.<br>
<button align=LEFT icon=NORMAL action="bypass -h Quest Q10363_RequestOfTheSeeker 33451-03.html">"Don't worry. He's fine now."</button>
</body></html>

View File

@ -0,0 +1,4 @@
<html><body>Celin:<br>
Good! I'm glad to hear that.<br>
He hadn't slept or eaten in days, you know. Carry on the way you've been going and you'll be a great ranger.
</body></html>

View File

@ -0,0 +1,214 @@
/*
* 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 quests.Q10363_RequestOfTheSeeker;
import quests.Q10362_CertificationOfTheSeeker.Q10362_CertificationOfTheSeeker;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.holders.ItemHolder;
import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.model.quest.QuestState;
import com.l2jserver.gameserver.model.quest.State;
import com.l2jserver.gameserver.network.NpcStringId;
import com.l2jserver.gameserver.network.serverpackets.ExShowScreenMessage;
/**
* Request of the Seeker (10363)
* @author spider
*/
public class Q10363_RequestOfTheSeeker extends Quest
{
// NPCs
private static final int NAGEL = 33450;
private static final int CELIN = 33451;
private static final int[] CORPSES =
{
32961,
32962,
32963,
32964
};
// Rewards
private static final int ADENA_REWARD = 48000;
private static final int EXP_REWARD = 72000;
private static final int SP_REWARD = 16;
private static final ItemHolder HEALING_POTIONS = new ItemHolder(1060, 100);
private static final ItemHolder WOODEN_HELMET = new ItemHolder(43, 1);
// Others
private static final int SORROW_ID = 13;
private static final int MIN_LEVEL = 12;
private static final int MAX_LEVEL = 20;
public Q10363_RequestOfTheSeeker()
{
super(10363, Q10363_RequestOfTheSeeker.class.getSimpleName(), "Request of the Seeker");
addStartNpc(NAGEL);
addTalkId(NAGEL, CELIN);
addSocialActionSeeId(CORPSES);
addCondLevel(MIN_LEVEL, MAX_LEVEL, "no_level.htm");
addCondCompletedQuest(Q10362_CertificationOfTheSeeker.class.getSimpleName(), "no_prequest.html");
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
final QuestState qs = getQuestState(player, false);
if (qs == null)
{
return null;
}
String htmltext = null;
switch (event)
{
case "33450-02.htm":
{
htmltext = event;
break;
}
case "33450-03.htm": // start quest
{
qs.startQuest();
htmltext = event;
break;
}
case "33450-06.html":
{
if (qs.getCond() == 6)
{
qs.setCond(7);
htmltext = event;
}
break;
}
case "33451-02.html":
{
htmltext = event;
break;
}
case "33451-03.html":
{
if (qs.isCond(7))
{
giveAdena(player, ADENA_REWARD, true);
addExpAndSp(player, EXP_REWARD, SP_REWARD);
giveItems(player, WOODEN_HELMET);
giveItems(player, HEALING_POTIONS);
qs.exitQuest(false, true);
htmltext = event;
}
break;
}
}
return htmltext;
}
@Override
public String onTalk(L2Npc npc, L2PcInstance player)
{
final QuestState qs = getQuestState(player, true);
String htmltext = null;
switch (qs.getState())
{
case State.CREATED:
{
htmltext = npc.getId() == NAGEL ? "33450-01.htm" : getNoQuestMsg(player);
break;
}
case State.STARTED:
{
switch (qs.getCond())
{
case 1:
{
htmltext = npc.getId() == NAGEL ? "33450-04.html" : getNoQuestMsg(player);
break;
}
case 6:
{
htmltext = npc.getId() == NAGEL ? "33450-05.html" : getNoQuestMsg(player);
break;
}
case 7:
{
htmltext = npc.getId() == NAGEL ? "33450-06.html" : "33451-01.html";
break;
}
}
break;
}
case State.COMPLETED:
{
htmltext = getAlreadyCompletedMsg(player);
break;
}
}
return htmltext;
}
@Override
public String onSocialActionSee(L2Npc npc, L2PcInstance caster, int actionId)
{
final QuestState qs = getQuestState(caster, false);
if ((qs != null) && (qs.getCond() >= 1) && (qs.getCond() < 6) && (actionId == SORROW_ID) && (caster.getTarget().getObjectId() == npc.getObjectId()))
{
switch (qs.getCond())
{
case 1:
{
showOnScreenMsg(caster, NpcStringId.YOU_VE_SHOWN_YOUR_CONDOLENCES_TO_ONE_CORPSE, ExShowScreenMessage.TOP_CENTER, 5000);
qs.setCond(2);
npc.deleteMe();
break;
}
case 2:
{
showOnScreenMsg(caster, NpcStringId.YOU_VE_SHOWN_YOUR_CONDOLENCES_TO_A_SECOND_CORPSE, ExShowScreenMessage.TOP_CENTER, 5000);
qs.setCond(3);
npc.deleteMe();
break;
}
case 3:
{
showOnScreenMsg(caster, NpcStringId.YOU_VE_SHOWN_YOUR_CONDOLENCES_TO_A_THIRD_CORPSE, ExShowScreenMessage.TOP_CENTER, 5000);
qs.setCond(4);
npc.deleteMe();
break;
}
case 4:
{
showOnScreenMsg(caster, NpcStringId.YOU_VE_SHOWN_YOUR_CONDOLENCES_TO_A_FOURTH_CORPSE, ExShowScreenMessage.TOP_CENTER, 5000);
qs.setCond(5);
npc.deleteMe();
break;
}
case 5:
{
showOnScreenMsg(caster, NpcStringId.YOU_VE_SHOWN_YOUR_CONDOLENCES_TO_A_FIFTH_CORPSE, ExShowScreenMessage.TOP_CENTER, 5000);
qs.setCond(6);
npc.deleteMe();
break;
}
}
}
return super.onSocialActionSee(npc, caster, actionId);
}
}

View File

@ -0,0 +1,3 @@
<html><body>You don't meet level requirements<br>
(Quest available from level 10 to level 20)
</body></html>

View File

@ -0,0 +1,2 @@
<html><body>To begin this quest, you need to complete Roles of the Seeker quest first.
</body></html>

View File

@ -206,6 +206,7 @@ import quests.Q10358_DividedSakumPoslof.Q10358_DividedSakumPoslof;
import quests.Q10359_SakumsTrace.Q10359_SakumsTrace;
import quests.Q10361_RolesOfTheSeeker.Q10361_RolesOfTheSeeker;
import quests.Q10362_CertificationOfTheSeeker.Q10362_CertificationOfTheSeeker;
import quests.Q10363_RequestOfTheSeeker.Q10363_RequestOfTheSeeker;
import quests.Q10365_SeekerEscort.Q10365_SeekerEscort;
import quests.Q10368_RebellionOfMonsters.Q10368_RebellionOfMonsters;
import quests.Q10390_KekropusLetter.Q10390_KekropusLetter;
@ -432,6 +433,7 @@ public class QuestMasterHandler
Q10359_SakumsTrace.class,
Q10361_RolesOfTheSeeker.class,
Q10362_CertificationOfTheSeeker.class,
Q10363_RequestOfTheSeeker.class,
Q10365_SeekerEscort.class,
Q10368_RebellionOfMonsters.class,
Q10390_KekropusLetter.class,

View File

@ -523,8 +523,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
/**
* Remove the L2Character from the world when the decay task is launched.<br>
* <FONT COLOR=#FF0000><B> <U>Caution</U> : This method DOESN'T REMOVE the object from _allObjects of L2World </B></FONT><BR>
* <FONT COLOR=#FF0000><B> <U>Caution</U> : This method DOESN'T SEND Server->Client packets to players</B></FONT>
* <FONT COLOR=#FF0000><B> <U>Caution</U> : This method DOESN'T REMOVE the object from _allObjects of L2World </B></FONT><BR> <FONT COLOR=#FF0000><B> <U>Caution</U> : This method DOESN'T SEND Server->Client packets to players</B></FONT>
*/
public void onDecay()
{
@ -3583,13 +3582,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
* A L2Character owns a table of Calculators called <B>_calculators</B>.<br>
* Each Calculator (a calculator per state) own a table of Func object.<br>
* A Func object is a mathematic function that permit to calculate the modifier of a state (ex : REGENERATE_HP_RATE...).<br>
* <FONT COLOR=#FF0000><B> <U>Caution</U> : This method is ONLY for L2PcInstance</B></FONT><br>
* <B><U>Example of use</U>:</B>
* <ul>
* <li>Equip an item from inventory</li>
* <li>Learn a new passive skill</li>
* <li>Use an active skill</li>
* </ul>
* <FONT COLOR=#FF0000><B> <U>Caution</U> : This method is ONLY for L2PcInstance</B></FONT><br> <B><U>Example of use</U>:</B> <ul> <li>Equip an item from inventory</li> <li>Learn a new passive skill</li> <li>Use an active skill</li> </ul>
* @param functions The list of Func objects to add to the Calculator corresponding to the state affected
*/
public final void addStatFuncs(List<AbstractFunction> functions)
@ -3679,12 +3672,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
* A L2Character owns a table of Calculators called <B>_calculators</B>.<br>
* Each Calculator (a calculator per state) own a table of Func object.<br>
* A Func object is a mathematic function that permit to calculate the modifier of a state (ex : REGENERATE_HP_RATE...).<br>
* <FONT COLOR=#FF0000><B> <U>Caution</U> : This method is ONLY for L2PcInstance</B></FONT><br>
* <B><U>Example of use</U>:</B>
* <ul>
* <li>Unequip an item from inventory</li>
* <li>Stop an active skill</li>
* </ul>
* <FONT COLOR=#FF0000><B> <U>Caution</U> : This method is ONLY for L2PcInstance</B></FONT><br> <B><U>Example of use</U>:</B> <ul> <li>Unequip an item from inventory</li> <li>Stop an active skill</li> </ul>
* @param functions The list of Func objects to add to the Calculator corresponding to the state affected
*/
public final void removeStatFuncs(AbstractFunction[] functions)
@ -4137,8 +4125,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
* That's why, client send regularly a Client->Server ValidatePosition packet to eventually correct the gap on the server.<br>
* But, it's always the server position that is used in range calculation. At the end of the estimated movement time,<br>
* the L2Character position is automatically set to the destination position even if the movement is not finished.<br>
* <FONT COLOR=#FF0000><B><U>Caution</U>: The current Z position is obtained FROM THE CLIENT by the Client->Server ValidatePosition Packet.<br>
* But x and y positions must be calculated to avoid that players try to modify their movement speed.</B></FONT>
* <FONT COLOR=#FF0000><B><U>Caution</U>: The current Z position is obtained FROM THE CLIENT by the Client->Server ValidatePosition Packet.<br> But x and y positions must be calculated to avoid that players try to modify their movement speed.</B></FONT>
* @return True if the movement is finished
*/
public boolean updatePosition()
@ -4220,7 +4207,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
double delta = (dx * dx) + (dy * dy);
if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided
&& !isFloating)
&& !isFloating)
{
delta = Math.sqrt(delta);
}
@ -4429,11 +4416,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
* <li>Add the L2Character to movingObjects of the GameTimeController</li>
* <li>Create a task to notify the AI that L2Character arrives at a check point of the movement</li>
* </ul>
* <FONT COLOR=#FF0000><B><U>Caution</U>: This method DOESN'T send Server->Client packet MoveToPawn/CharMoveToLocation.</B></FONT><br>
* <B><U>Example of use</U>:</B>
* <ul>
* <li>AI : onIntentionMoveTo(Location), onIntentionPickUp(L2Object), onIntentionInteract(L2Object)</li>
* <li>FollowTask</li>
* <FONT COLOR=#FF0000><B><U>Caution</U>: This method DOESN'T send Server->Client packet MoveToPawn/CharMoveToLocation.</B></FONT><br> <B><U>Example of use</U>:</B> <ul> <li>AI : onIntentionMoveTo(Location), onIntentionPickUp(L2Object), onIntentionInteract(L2Object)</li> <li>FollowTask</li>
* </ul>
* @param x The X position of the destination
* @param y The Y position of the destination
@ -4540,7 +4523,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
m.disregardingGeodata = false;
if (!isFlying() // flying chars not checked - even canSeeTarget doesn't work yet
&& (!isInsideZone(ZoneId.WATER) || isInsideZone(ZoneId.SIEGE))) // swimming also not checked unless in siege zone - but distance is limited
&& (!isInsideZone(ZoneId.WATER) || isInsideZone(ZoneId.SIEGE))) // swimming also not checked unless in siege zone - but distance is limited
{
final boolean isInVehicle = isPlayer() && (getActingPlayer().getVehicle() != null);
if (isInVehicle)
@ -4558,7 +4541,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
// Movement checks:
// when PATHFINDING > 0, for all characters except mobs returning home (could be changed later to teleport if pathfinding fails)
if (((Config.PATHFINDING > 0) && (!(isAttackable() && ((L2Attackable) this).isReturningToSpawnPoint()))) //
|| (isPlayer() && !(isInVehicle && (distance > 1500))))
|| (isPlayer() && !(isInVehicle && (distance > 1500))))
{
if (isOnGeodataPath())
{
@ -4862,7 +4845,8 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
}
/**
* <B><U> Overridden in </U> :</B> <li>L2PcInstance</li>
* <B><U> Overridden in </U> :</B>
* <li>L2PcInstance</li>
* @return True if arrows are available.
*/
protected boolean checkAndEquipArrows()
@ -4871,7 +4855,8 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
}
/**
* <B><U> Overridden in </U> :</B> <li>L2PcInstance</li>
* <B><U> Overridden in </U> :</B>
* <li>L2PcInstance</li>
* @return True if bolts are available.
*/
protected boolean checkAndEquipBolts()
@ -4881,7 +4866,9 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
/**
* Add Exp and Sp to the L2Character.<br>
* <B><U> Overridden in </U> :</B> <li>L2PcInstance</li> <li>L2PetInstance</li>
* <B><U> Overridden in </U> :</B>
* <li>L2PcInstance</li>
* <li>L2PetInstance</li>
* @param addToExp
* @param addToSp
*/
@ -4891,25 +4878,29 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
}
/**
* <B><U> Overridden in </U> :</B> <li>L2PcInstance</li>
* <B><U> Overridden in </U> :</B>
* <li>L2PcInstance</li>
* @return the active weapon instance (always equiped in the right hand).
*/
public abstract L2ItemInstance getActiveWeaponInstance();
/**
* <B><U> Overridden in </U> :</B> <li>L2PcInstance</li>
* <B><U> Overridden in </U> :</B>
* <li>L2PcInstance</li>
* @return the active weapon item (always equiped in the right hand).
*/
public abstract L2Weapon getActiveWeaponItem();
/**
* <B><U> Overridden in </U> :</B> <li>L2PcInstance</li>
* <B><U> Overridden in </U> :</B>
* <li>L2PcInstance</li>
* @return the secondary weapon instance (always equiped in the left hand).
*/
public abstract L2ItemInstance getSecondaryWeaponInstance();
/**
* <B><U> Overridden in </U> :</B> <li>L2PcInstance</li>
* <B><U> Overridden in </U> :</B>
* <li>L2PcInstance</li>
* @return the secondary {@link L2Item} item (always equiped in the left hand).
*/
public abstract L2Item getSecondaryWeaponItem();
@ -5161,7 +5152,8 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
/**
* Reduce the arrow number of the L2Character.<br>
* <B><U> Overridden in </U> :</B> <li>L2PcInstance</li>
* <B><U> Overridden in </U> :</B>
* <li>L2PcInstance</li>
* @param bolts
*/
protected void reduceArrowCount(boolean bolts)
@ -5523,7 +5515,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
{
switch (skill.getTargetType())
{
// only AURA-type skills can be cast without target
// only AURA-type skills can be cast without target
case AURA:
case FRONT_AURA:
case BEHIND_AURA:
@ -5564,7 +5556,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
// Healing party members should ignore LOS.
if (((skill.getTargetType() != L2TargetType.PARTY) || !skill.hasEffectType(L2EffectType.HEAL)) //
&& !GeoData.getInstance().canSeeTarget(this, target))
&& !GeoData.getInstance().canSeeTarget(this, target))
{
skipLOS++;
continue;
@ -5849,7 +5841,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
// Quest event ON_SPELL_FNISHED
protected void notifyQuestEventSkillFinished(Skill skill, L2Object target)
{
}
/**
@ -6599,7 +6591,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
*/
public void sendDamageMessage(L2Character target, int damage, boolean mcrit, boolean pcrit, boolean miss)
{
}
public byte getAttackElement()
@ -6658,15 +6650,16 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
{
return;
}
Collection<L2Object> objs = getKnownList().getKnownObjects().values();
for (L2Object npc : objs)
{
if ((npc != null) && npc.isNpc())
{
final L2Npc npcMob = (L2Npc) npc;
if ((npcMob.isInsideRadius(this, 150, true, true))) // 150 radius?
if (npcMob.isInsideRadius(this, 150, true, true)) // 150 radius?
{
EventDispatcher.getInstance().notifyEventAsync(new OnNpcSocialActionSee(getActingPlayer(), id), npcMob);
EventDispatcher.getInstance().notifyEventAsync(new OnNpcSocialActionSee(npcMob, getActingPlayer(), id), npcMob);
}
}
}

View File

@ -198,6 +198,7 @@ import com.l2jserver.gameserver.model.entity.L2Event;
import com.l2jserver.gameserver.model.entity.Siege;
import com.l2jserver.gameserver.model.entity.TvTEvent;
import com.l2jserver.gameserver.model.events.EventDispatcher;
import com.l2jserver.gameserver.model.events.impl.character.npc.OnNpcSocialActionSee;
import com.l2jserver.gameserver.model.events.impl.character.player.OnPlayerEquipItem;
import com.l2jserver.gameserver.model.events.impl.character.player.OnPlayerFameChanged;
import com.l2jserver.gameserver.model.events.impl.character.player.OnPlayerHennaRemove;
@ -4201,7 +4202,8 @@ public final class L2PcInstance extends L2Playable
}
/**
* Send packet StatusUpdate with current HP,MP and CP to the L2PcInstance and only current HP, MP and Level to all other L2PcInstance of the Party. <B><U> Actions</U> :</B> <li>Send the Server->Client packet StatusUpdate with current HP, MP and CP to this L2PcInstance</li><BR>
* Send packet StatusUpdate with current HP,MP and CP to the L2PcInstance and only current HP, MP and Level to all other L2PcInstance of the Party. <B><U> Actions</U> :</B>
* <li>Send the Server->Client packet StatusUpdate with current HP, MP and CP to this L2PcInstance</li><BR>
* <li>Send the Server->Client packet PartySmallWindowUpdate with current HP, MP and Level to all other L2PcInstance of the Party</li> <FONT COLOR=#FF0000><B> <U>Caution</U> : This method DOESN'T SEND current HP and MP to all L2PcInstance of the _statusListener</B></FONT>
*/
@Override
@ -4265,8 +4267,10 @@ public final class L2PcInstance extends L2Playable
/**
* Send a Server->Client packet UserInfo to this L2PcInstance and CharInfo to all L2PcInstance in its _KnownPlayers. <B><U> Concept</U> :</B> Others L2PcInstance in the detection area of the L2PcInstance are identified in <B>_knownPlayers</B>. In order to inform other players of this
* L2PcInstance state modifications, server just need to go through _knownPlayers to send Server->Client Packet <B><U> Actions</U> :</B> <li>Send a Server->Client packet UserInfo to this L2PcInstance (Public and Private Data)</li> <li>Send a Server->Client packet CharInfo to all L2PcInstance in
* _KnownPlayers of the L2PcInstance (Public data only)</li> <FONT COLOR=#FF0000><B> <U>Caution</U> : DON'T SEND UserInfo packet to other players instead of CharInfo packet. Indeed, UserInfo packet contains PRIVATE DATA as MaxHP, STR, DEX...</B></FONT>
* L2PcInstance state modifications, server just need to go through _knownPlayers to send Server->Client Packet <B><U> Actions</U> :</B>
* <li>Send a Server->Client packet UserInfo to this L2PcInstance (Public and Private Data)</li>
* <li>Send a Server->Client packet CharInfo to all L2PcInstance in _KnownPlayers of the L2PcInstance (Public data only)</li>
* <FONT COLOR=#FF0000><B> <U>Caution</U> : DON'T SEND UserInfo packet to other players instead of CharInfo packet. Indeed, UserInfo packet contains PRIVATE DATA as MaxHP, STR, DEX...</B></FONT>
*/
public final void broadcastUserInfo()
{
@ -4299,6 +4303,23 @@ public final class L2PcInstance extends L2Playable
broadcastPacket(new NicknameChanged(this));
}
public final void broadcastPacket(SocialAction sa)
{
Collection<L2Object> objs = getKnownList().getKnownObjects().values();
for (L2Object npc : objs)
{
if ((npc != null) && npc.isNpc())
{
final L2Npc npcMob = (L2Npc) npc;
if (npcMob.isInsideRadius(this, 100, true, true)) // 150 radius?
{
EventDispatcher.getInstance().notifyEventAsync(new OnNpcSocialActionSee(npcMob, getActingPlayer(), sa.getId()), npcMob);
}
}
}
broadcastPacket((L2GameServerPacket) sa);
}
@Override
public final void broadcastPacket(L2GameServerPacket mov)
{
@ -4448,8 +4469,10 @@ public final class L2PcInstance extends L2Playable
}
/**
* Manage Interact Task with another L2PcInstance. <B><U> Actions</U> :</B> <li>If the private store is a STORE_PRIVATE_SELL, send a Server->Client PrivateBuyListSell packet to the L2PcInstance</li> <li>If the private store is a STORE_PRIVATE_BUY, send a Server->Client PrivateBuyListBuy packet
* to the L2PcInstance</li> <li>If the private store is a STORE_PRIVATE_MANUFACTURE, send a Server->Client RecipeShopSellList packet to the L2PcInstance</li>
* Manage Interact Task with another L2PcInstance. <B><U> Actions</U> :</B>
* <li>If the private store is a STORE_PRIVATE_SELL, send a Server->Client PrivateBuyListSell packet to the L2PcInstance</li>
* <li>If the private store is a STORE_PRIVATE_BUY, send a Server->Client PrivateBuyListBuy packet to the L2PcInstance</li>
* <li>If the private store is a STORE_PRIVATE_MANUFACTURE, send a Server->Client RecipeShopSellList packet to the L2PcInstance</li>
* @param target The L2Character targeted
*/
public void doInteract(L2Character target)
@ -4523,9 +4546,13 @@ public final class L2PcInstance extends L2Playable
}
/**
* Manage Pickup Task. <B><U> Actions</U> :</B> <li>Send a Server->Client packet StopMove to this L2PcInstance</li> <li>Remove the L2ItemInstance from the world and send server->client GetItem packets</li> <li>Send a System Message to the L2PcInstance : YOU_PICKED_UP_S1_ADENA or
* YOU_PICKED_UP_S1_S2</li> <li>Add the Item to the L2PcInstance inventory</li> <li>Send a Server->Client packet InventoryUpdate to this L2PcInstance with NewItem (use a new slot) or ModifiedItem (increase amount)</li> <li>Send a Server->Client packet StatusUpdate to this L2PcInstance with
* current weight</li> <FONT COLOR=#FF0000><B> <U>Caution</U> : If a Party is in progress, distribute Items between party members</B></FONT>
* Manage Pickup Task. <B><U> Actions</U> :</B>
* <li>Send a Server->Client packet StopMove to this L2PcInstance</li>
* <li>Remove the L2ItemInstance from the world and send server->client GetItem packets</li>
* <li>Send a System Message to the L2PcInstance : YOU_PICKED_UP_S1_ADENA or YOU_PICKED_UP_S1_S2</li>
* <li>Add the Item to the L2PcInstance inventory</li>
* <li>Send a Server->Client packet InventoryUpdate to this L2PcInstance with NewItem (use a new slot) or ModifiedItem (increase amount)</li>
* <li>Send a Server->Client packet StatusUpdate to this L2PcInstance with current weight</li> <FONT COLOR=#FF0000><B> <U>Caution</U> : If a Party is in progress, distribute Items between party members</B></FONT>
* @param object The L2ItemInstance to pick up
*/
@Override
@ -5244,8 +5271,12 @@ public final class L2PcInstance extends L2Playable
}
/**
* Kill the L2Character, Apply Death Penalty, Manage gain/loss Karma and Item Drop. <B><U> Actions</U> :</B> <li>Reduce the Experience of the L2PcInstance in function of the calculated Death Penalty</li> <li>If necessary, unsummon the Pet of the killed L2PcInstance</li> <li>Manage Karma gain for
* attacker and Karam loss for the killed L2PcInstance</li> <li>If the killed L2PcInstance has Karma, manage Drop Item</li> <li>Kill the L2PcInstance</li>
* Kill the L2Character, Apply Death Penalty, Manage gain/loss Karma and Item Drop. <B><U> Actions</U> :</B>
* <li>Reduce the Experience of the L2PcInstance in function of the calculated Death Penalty</li>
* <li>If necessary, unsummon the Pet of the killed L2PcInstance</li>
* <li>Manage Karma gain for attacker and Karam loss for the killed L2PcInstance</li>
* <li>If the killed L2PcInstance has Karma, manage Drop Item</li>
* <li>Kill the L2PcInstance</li>
* @param killer
*/
@Override
@ -5736,7 +5767,11 @@ public final class L2PcInstance extends L2Playable
/**
* Reduce the Experience (and level if necessary) of the L2PcInstance in function of the calculated Death Penalty.<BR>
* <B><U> Actions</U> :</B> <li>Calculate the Experience loss</li> <li>Set the value of _expBeforeDeath</li> <li>Set the new Experience value of the L2PcInstance and Decrease its level if necessary</li> <li>Send a Server->Client StatusUpdate packet with its new Experience</li>
* <B><U> Actions</U> :</B>
* <li>Calculate the Experience loss</li>
* <li>Set the value of _expBeforeDeath</li>
* <li>Set the new Experience value of the L2PcInstance and Decrease its level if necessary</li>
* <li>Send a Server->Client StatusUpdate packet with its new Experience</li>
* @param killer
* @param atWar
*/
@ -5811,7 +5846,9 @@ public final class L2PcInstance extends L2Playable
}
/**
* Stop the HP/MP/CP Regeneration task. <B><U> Actions</U> :</B> <li>Set the RegenActive flag to False</li> <li>Stop the HP/MP/CP Regeneration task</li>
* Stop the HP/MP/CP Regeneration task. <B><U> Actions</U> :</B>
* <li>Set the RegenActive flag to False</li>
* <li>Stop the HP/MP/CP Regeneration task</li>
*/
public void stopAllTimers()
{
@ -6173,7 +6210,10 @@ public final class L2PcInstance extends L2Playable
}
/**
* Set the Private Store type of the L2PcInstance. <B><U> Values </U> :</B> <li>0 : STORE_PRIVATE_NONE</li> <li>1 : STORE_PRIVATE_SELL</li> <li>2 : sellmanage</li><BR>
* Set the Private Store type of the L2PcInstance. <B><U> Values </U> :</B>
* <li>0 : STORE_PRIVATE_NONE</li>
* <li>1 : STORE_PRIVATE_SELL</li>
* <li>2 : sellmanage</li><BR>
* <li>3 : STORE_PRIVATE_BUY</li><BR>
* <li>4 : buymanage</li><BR>
* <li>5 : STORE_PRIVATE_MANUFACTURE</li><BR>
@ -6190,7 +6230,10 @@ public final class L2PcInstance extends L2Playable
}
/**
* <B><U> Values </U> :</B> <li>0 : STORE_PRIVATE_NONE</li> <li>1 : STORE_PRIVATE_SELL</li> <li>2 : sellmanage</li><BR>
* <B><U> Values </U> :</B>
* <li>0 : STORE_PRIVATE_NONE</li>
* <li>1 : STORE_PRIVATE_SELL</li>
* <li>2 : sellmanage</li><BR>
* <li>3 : STORE_PRIVATE_BUY</li><BR>
* <li>4 : buymanage</li><BR>
* <li>5 : STORE_PRIVATE_MANUFACTURE</li><BR>
@ -7001,8 +7044,11 @@ public final class L2PcInstance extends L2Playable
}
/**
* Retrieve a L2PcInstance from the characters table of the database and add it in _allObjects of the L2world. <B><U> Actions</U> :</B> <li>Retrieve the L2PcInstance from the characters table of the database</li> <li>Add the L2PcInstance object in _allObjects</li> <li>Set the x,y,z position of
* the L2PcInstance and make it invisible</li> <li>Update the overloaded status of the L2PcInstance</li>
* Retrieve a L2PcInstance from the characters table of the database and add it in _allObjects of the L2world. <B><U> Actions</U> :</B>
* <li>Retrieve the L2PcInstance from the characters table of the database</li>
* <li>Add the L2PcInstance object in _allObjects</li>
* <li>Set the x,y,z position of the L2PcInstance and make it invisible</li>
* <li>Update the overloaded status of the L2PcInstance</li>
* @param objectId Identifier of the object to initialized
* @return The L2PcInstance loaded from the database
*/
@ -7872,8 +7918,10 @@ public final class L2PcInstance extends L2Playable
}
/**
* Add a skill to the L2PcInstance _skills and its Func objects to the calculator set of the L2PcInstance and save update in the character_skills table of the database. <B><U> Concept</U> :</B> All skills own by a L2PcInstance are identified in <B>_skills</B> <B><U> Actions</U> :</B> <li>Replace
* oldSkill by newSkill or Add the newSkill</li> <li>If an old skill has been replaced, remove all its Func objects of L2Character calculator set</li> <li>Add Func objects of newSkill to the calculator set of the L2Character</li>
* Add a skill to the L2PcInstance _skills and its Func objects to the calculator set of the L2PcInstance and save update in the character_skills table of the database. <B><U> Concept</U> :</B> All skills own by a L2PcInstance are identified in <B>_skills</B> <B><U> Actions</U> :</B>
* <li>Replace oldSkill by newSkill or Add the newSkill</li>
* <li>If an old skill has been replaced, remove all its Func objects of L2Character calculator set</li>
* <li>Add Func objects of newSkill to the calculator set of the L2Character</li>
* @param newSkill The L2Skill to add to the L2Character
* @param store
* @return The L2Skill replaced or null if just added a new L2Skill
@ -7904,8 +7952,10 @@ public final class L2PcInstance extends L2Playable
}
/**
* Remove a skill from the L2Character and its Func objects from calculator set of the L2Character and save update in the character_skills table of the database. <B><U> Concept</U> :</B> All skills own by a L2Character are identified in <B>_skills</B> <B><U> Actions</U> :</B> <li>Remove the
* skill from the L2Character _skills</li> <li>Remove all its Func objects from the L2Character calculator set</li> <B><U> Overridden in </U> :</B> <li>L2PcInstance : Save update in the character_skills table of the database</li>
* Remove a skill from the L2Character and its Func objects from calculator set of the L2Character and save update in the character_skills table of the database. <B><U> Concept</U> :</B> All skills own by a L2Character are identified in <B>_skills</B> <B><U> Actions</U> :</B>
* <li>Remove the skill from the L2Character _skills</li>
* <li>Remove all its Func objects from the L2Character calculator set</li> <B><U> Overridden in </U> :</B>
* <li>L2PcInstance : Save update in the character_skills table of the database</li>
* @param skill The L2Skill to remove from the L2Character
* @return The L2Skill removed
*/
@ -8839,7 +8889,7 @@ public final class L2PcInstance extends L2Playable
switch (sklTargetType)
{
// Target the player if skill type is AURA, PARTY, CLAN or SELF
// Target the player if skill type is AURA, PARTY, CLAN or SELF
case AURA:
case FRONT_AURA:
case BEHIND_AURA:
@ -9583,7 +9633,7 @@ public final class L2PcInstance extends L2Playable
}
if ((magic && (item.getItem().getDefaultAction() == ActionType.SPIRITSHOT)) //
|| (physical && (item.getItem().getDefaultAction() == ActionType.SOULSHOT)))
|| (physical && (item.getItem().getDefaultAction() == ActionType.SOULSHOT)))
{
handler.useItem(this, item, false);
}

View File

@ -18,6 +18,7 @@
*/
package com.l2jserver.gameserver.model.events.impl.character.npc;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.events.EventType;
import com.l2jserver.gameserver.model.events.impl.IBaseEvent;
@ -29,9 +30,11 @@ public class OnNpcSocialActionSee implements IBaseEvent
{
private final L2PcInstance _caster;
private final int _actionId;
private final L2Npc _npc;
public OnNpcSocialActionSee(L2PcInstance caster, int actionId)
public OnNpcSocialActionSee(L2Npc npc, L2PcInstance caster, int actionId)
{
_npc = npc;
_caster = caster;
_actionId = actionId;
}
@ -46,6 +49,11 @@ public class OnNpcSocialActionSee implements IBaseEvent
return _actionId;
}
public L2Npc getNpc()
{
return _npc;
}
@Override
public EventType getType()
{

View File

@ -761,15 +761,16 @@ public class Quest extends AbstractScript implements IIdentifiable
}
/**
* @param npc
* @param caster
* @param actionId
*/
public final void notifySocialActionSee(L2PcInstance caster, int actionId)
public final void notifySocialActionSee(L2Npc npc, L2PcInstance caster, int actionId)
{
String res = null;
try
{
res = onSocialActionSee(caster, actionId);
res = onSocialActionSee(npc, caster, actionId);
}
catch (Exception e)
{
@ -1226,11 +1227,12 @@ public class Quest extends AbstractScript implements IIdentifiable
}
/**
* @param caster the player who used the social action
* @param actionId the actual action id that was used
* @param npc the NPC that saw the social action.
* @param caster the player who used the social action.
* @param actionId the actual action id that was used.
* @return
*/
public String onSocialActionSee(L2PcInstance caster, int actionId)
public String onSocialActionSee(L2Npc npc, L2PcInstance caster, int actionId)
{
return null;
}
@ -2057,7 +2059,7 @@ public class Quest extends AbstractScript implements IIdentifiable
*/
public void addSocialActionSeeId(int... npcIds)
{
setNpcSocialActionSeeId(event -> notifySocialActionSee(event.getCaster(), event.getActionId()), npcIds);
setNpcSocialActionSeeId(event -> notifySocialActionSee(event.getNpc(), event.getCaster(), event.getActionId()), npcIds);
}
/**

View File

@ -43,4 +43,9 @@ public class SocialAction extends L2GameServerPacket
writeD(_actionId);
writeD(0x00); // TODO: Find me!
}
public int getId()
{
return _actionId;
}
}