OnNpcSocialActionSee.

This commit is contained in:
MobiusDev
2015-08-03 21:22:27 +00:00
parent 82318052e2
commit cb4955bafa
5 changed files with 135 additions and 0 deletions

View File

@@ -760,6 +760,26 @@ public class Quest extends AbstractScript implements IIdentifiable
showResult(caster, res);
}
/**
* @param npc
* @param caster
* @param actionId
*/
public final void notifySocialActionSee(L2Npc npc, L2PcInstance caster, int actionId)
{
String res = null;
try
{
res = onSocialActionSee(npc, caster, actionId);
}
catch (Exception e)
{
showError(caster, e);
return;
}
showResult(caster, res);
}
/**
* @param npc
* @param caller
@@ -1206,6 +1226,17 @@ public class Quest extends AbstractScript implements IIdentifiable
return null;
}
/**
* @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(L2Npc npc, L2PcInstance caster, int actionId)
{
return null;
}
/**
* This function is called whenever an NPC finishes casting a skill.
* @param npc the NPC that casted the skill.
@@ -2022,6 +2053,15 @@ public class Quest extends AbstractScript implements IIdentifiable
setNpcSkillSeeId(event -> notifySkillSee(event.getTarget(), event.getCaster(), event.getSkill(), event.getTargets(), event.isSummon()), npcIds);
}
/**
* Add this quest to the list of quests that the passed npc will respond to for social action see events.
* @param npcIds the IDs of the NPCs to register
*/
public void addSocialActionSeeId(int... npcIds)
{
setNpcSocialActionSeeId(event -> notifySocialActionSee(event.getTarget(), event.getCaster(), event.getActionId()), npcIds);
}
/**
* @param npcIds the IDs of the NPCs to register
*/