Atavism Version 2018.1AGIS API

atavism.agis.behaviors
Class QuestBehavior

java.lang.Object
  extended by atavism.server.engine.Behavior
      extended by atavism.agis.behaviors.QuestBehavior
All Implemented Interfaces:
MessageCallback, MessageDispatch, java.io.Serializable

public class QuestBehavior
extends Behavior
implements MessageCallback

Controls both Quest and Dialogue interactions for an NPC. This needs to be given to any mob that can start or end Quests and Dialogues. Should be renamed to InteractionBehavior at some point in the future.

Author:
Andrew Harrison
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class atavism.server.engine.Behavior
Behavior.CommandMessage, Behavior.EventMessage
 
Field Summary
 
Fields inherited from class atavism.server.engine.Behavior
lock, MSG_TYPE_COMMAND, MSG_TYPE_EVENT, obj
 
Fields inherited from interface atavism.msgsys.MessageCallback
NO_FLAGS, RESPONSE_EXPECTED
 
Constructor Summary
QuestBehavior()
           
 
Method Summary
 void activate()
           
 void deactivate()
          Removes the subscriptions this behavior has.
 void endsQuest(AgisQuest quest)
           
 java.util.Collection<java.lang.Integer> getAllQuestRefs()
           
 java.util.Collection<AgisQuest> getAllQuests()
           
 AgisQuest getEndQuest(int questID)
           
 java.util.Collection<AgisQuest> getEndQuests()
           
 int getMerchantFaction()
           
 int getMerchantTable()
           
 java.util.ArrayList<java.lang.String> getOtherActions()
           
 AgisQuest getQuest(int questID)
           
 java.util.Collection<Dialogue> getStartDialogues()
           
 AgisQuest getStartQuest(java.lang.String questName)
           
 java.util.Collection<java.lang.Integer> getStartQuestRefs()
           
 java.util.Collection<AgisQuest> getStartQuests()
           
protected  void handleDialogueState(OID playerOid)
          Checks a players faction and/or rep to determine whether this npc will sell items to the player in question.
protected  void handleMerchantState(OID playerOid)
          Checks a players faction and/or rep to determine whether this npc will sell items to the player in question.
 void handleMessage(Message msg, int flags)
          Handle message.
protected  void handleOtherActionsState(OID playerOid)
          Checks a players faction and/or rep to determine whether this npc will sell items to the player in question.
protected  void handleQuestState(OID playerOid)
           
 void initialize()
          Sets up the subscription to receive messages the behavior needs to catch.
protected  void offerDialogueToPlayer(OID playerOid, Dialogue dialogue)
           
protected  void offerQuestToPlayer(OID playerOid, java.util.LinkedList<AgisQuest> quests)
           
 void processLevelChangeMsg(ClassAbilityClient.levelChangeMessage msg)
           
 void processSkillLevelChangeMsg(ClassAbilityClient.skillLevelChangeMessage msg)
           
 void processUpdateMsg(WorldManagerClient.UpdateMessage msg)
           
 void setMerchantFaction(int factionNum)
           
 void setMerchantTable(MerchantTable table)
           
 void setOtherActions(java.util.ArrayList<java.lang.String> otherActions)
           
 void startsDialogue(Dialogue dialogue)
           
 void startsQuest(AgisQuest quest)
           
 
Methods inherited from class atavism.server.engine.Behavior
dispatchMessage, getObjectStub, setObjectStub
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuestBehavior

public QuestBehavior()
Method Detail

initialize

public void initialize()
Sets up the subscription to receive messages the behavior needs to catch.

Overrides:
initialize in class Behavior

activate

public void activate()
Specified by:
activate in class Behavior

deactivate

public void deactivate()
Removes the subscriptions this behavior has.

Specified by:
deactivate in class Behavior

handleMessage

public void handleMessage(Message msg,
                          int flags)
Description copied from interface: MessageCallback
Handle message.

Specified by:
handleMessage in interface MessageCallback
Specified by:
handleMessage in class Behavior
Parameters:
msg - Message sent from other agent.
flags - Bitwise OR of MessageCallback.NO_FLAGS, MessageCallback.RESPONSE_EXPECTED.

offerQuestToPlayer

protected void offerQuestToPlayer(OID playerOid,
                                  java.util.LinkedList<AgisQuest> quests)

offerDialogueToPlayer

protected void offerDialogueToPlayer(OID playerOid,
                                     Dialogue dialogue)

processUpdateMsg

public void processUpdateMsg(WorldManagerClient.UpdateMessage msg)

processLevelChangeMsg

public void processLevelChangeMsg(ClassAbilityClient.levelChangeMessage msg)

processSkillLevelChangeMsg

public void processSkillLevelChangeMsg(ClassAbilityClient.skillLevelChangeMessage msg)

handleQuestState

protected void handleQuestState(OID playerOid)

handleMerchantState

protected void handleMerchantState(OID playerOid)
Checks a players faction and/or rep to determine whether this npc will sell items to the player in question.

Parameters:
playerOid -

handleOtherActionsState

protected void handleOtherActionsState(OID playerOid)
Checks a players faction and/or rep to determine whether this npc will sell items to the player in question.

Parameters:
playerOid -

handleDialogueState

protected void handleDialogueState(OID playerOid)
Checks a players faction and/or rep to determine whether this npc will sell items to the player in question.

Parameters:
playerOid -

startsQuest

public void startsQuest(AgisQuest quest)

endsQuest

public void endsQuest(AgisQuest quest)

getQuest

public AgisQuest getQuest(int questID)

getStartQuest

public AgisQuest getStartQuest(java.lang.String questName)

getEndQuest

public AgisQuest getEndQuest(int questID)

getStartQuests

public java.util.Collection<AgisQuest> getStartQuests()

getEndQuests

public java.util.Collection<AgisQuest> getEndQuests()

getAllQuests

public java.util.Collection<AgisQuest> getAllQuests()

getAllQuestRefs

public java.util.Collection<java.lang.Integer> getAllQuestRefs()

getStartQuestRefs

public java.util.Collection<java.lang.Integer> getStartQuestRefs()

startsDialogue

public void startsDialogue(Dialogue dialogue)

getStartDialogues

public java.util.Collection<Dialogue> getStartDialogues()

setMerchantTable

public void setMerchantTable(MerchantTable table)

getMerchantTable

public int getMerchantTable()

setMerchantFaction

public void setMerchantFaction(int factionNum)

getMerchantFaction

public int getMerchantFaction()

setOtherActions

public void setOtherActions(java.util.ArrayList<java.lang.String> otherActions)

getOtherActions

public java.util.ArrayList<java.lang.String> getOtherActions()


Copyright © 2018 Dragonsan Studios Sp. z o.o.