Atavism Version 2018.1AGIS API

atavism.agis.objects
Class BasicQuestState

java.lang.Object
  extended by atavism.agis.objects.QuestState
      extended by atavism.agis.objects.BasicQuestState
All Implemented Interfaces:
MessageCallback, MessageDispatch, java.io.Serializable

public class BasicQuestState
extends QuestState

See Also:
Serialized Form

Nested Class Summary
static class BasicQuestState.CategoryKillGoalStatus
           
static class BasicQuestState.CollectionGoalStatus
           
static class BasicQuestState.KillGoalStatus
           
static class BasicQuestState.TaskGoalStatus
           
 
Field Summary
 
Fields inherited from class atavism.agis.objects.QuestState
lock
 
Fields inherited from interface atavism.msgsys.MessageCallback
NO_FLAGS, RESPONSE_EXPECTED
 
Constructor Summary
BasicQuestState()
           
BasicQuestState(AgisQuest quest, OID playerOid)
           
 
Method Summary
 void abandonQuest(OID playerOid)
           
 boolean activate()
          gets activated by QuestPlugin.
 void addDeliveryItem(int item)
           
protected  boolean checkInventory(boolean questUpdated, java.util.HashMap<java.lang.Integer,java.lang.Integer> itemList)
           
protected  void completeHandler()
          marks quest as completed if we just completed it
 void deactivate()
           
 java.util.List<BasicQuestState.CategoryKillGoalStatus> getCategoryKillGoalsStatus()
           
 int getCompletionLevel()
          Calculates what grades of the quest have been completed
 java.util.List<java.lang.Integer> getDeliveryItems()
           
 boolean getDeliveryItemsGiven()
           
 java.util.List<BasicQuestState.CollectionGoalStatus> getGoalsStatus()
           
 java.util.List<BasicQuestState.KillGoalStatus> getKillGoalsStatus()
           
 java.util.HashMap<java.lang.Integer,java.util.List<java.lang.String>> getObjectiveStatus()
          for client display: current state
 java.util.List<BasicQuestState.TaskGoalStatus> getTaskGoalsStatus()
           
 boolean handleConclude()
          called when the player is concluding (turning in) the quest returns false if the quest is not able to be concluded
 void handleInit()
          called after the queststate is initialized and set by the world server to the player
protected  void handleInitHelper()
           
 void handleInvUpdate()
          called when the player's inv changes
 void handleMessage(Message msg, int flags)
          process network messages
protected  void makeDeliveryItems()
          generate delivery items and give them to the player
protected  boolean processInvUpdate(AgisInventoryClient.QuestItemsListMessage msg)
           
protected  boolean processMobDeathUpdate(CombatClient.QuestMobDeath msg)
           
protected  boolean processTaskUpdate(QuestClient.TaskUpdateMessage msg)
           
protected  void sendItemUpdate()
          Sends out a message with the list of items still required to complete this Quest.
 void setCategoryKillGoalsStatus(java.util.List<BasicQuestState.CategoryKillGoalStatus> categoryKillGoalsStatus)
           
 void setDeliveryItems(java.util.List<java.lang.Integer> items)
          a list of items that the quest gives to the player when the player accepts the quest
 void setDeliveryItemsGiven(boolean given)
           
 void setGoalsStatus(java.util.List<BasicQuestState.CollectionGoalStatus> goalsStatus)
           
 void setKillGoalsStatus(java.util.List<BasicQuestState.KillGoalStatus> killGoalsStatus)
           
 void setTaskGoalsStatus(java.util.List<BasicQuestState.TaskGoalStatus> taskGoalsStatus)
           
 java.lang.String toString()
          returns the current state of this quest, ie, how many mobs to kill,etc
 boolean updateObjectiveStatus()
           
 void updateQuestLog()
          sends QuestLogInfo message for this quest
 
Methods inherited from class atavism.agis.objects.QuestState
addReward, addRewardToChoose, dispatchMessage, getCompleted, getConcluded, getCurrencyRewards, getGrades, getName, getPlayerOid, getQuestCompletionText, getQuestDesc, getQuestObjective, getQuestOid, getQuestProgressText, getQuestRef, getQuestTitle, getRepeatable, getRepRewards, getReqLevel, getRewards, getRewardsToChoose, getXpRewards, handleDeath, sendStateStatusChange, setCompleted, setConcluded, setCurrencyRewards, setGrades, setPlayerOid, setQuestCompletionText, setQuestDesc, setQuestObjective, setQuestOid, setQuestProgressText, setQuestRef, setQuestTitle, setRepeatable, setRepRewards, setReqLevel, setRewards, setRewardsToChoose, setupTransient, setXpRewards, updateQuestObjectives
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BasicQuestState

public BasicQuestState()

BasicQuestState

public BasicQuestState(AgisQuest quest,
                       OID playerOid)
Method Detail

toString

public java.lang.String toString()
returns the current state of this quest, ie, how many mobs to kill,etc

Overrides:
toString in class QuestState

activate

public boolean activate()
Description copied from class: QuestState
gets activated by QuestPlugin. the quest is typically created by the QuestBehavior and sent over to the QuestPlugin, which then adds it to the players quest states and also calls activate on the quest state object

Specified by:
activate in class QuestState

deactivate

public void deactivate()
Specified by:
deactivate in class QuestState

abandonQuest

public void abandonQuest(OID playerOid)
Specified by:
abandonQuest in class QuestState

handleMessage

public void handleMessage(Message msg,
                          int flags)
process network messages

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

processInvUpdate

protected boolean processInvUpdate(AgisInventoryClient.QuestItemsListMessage msg)

checkInventory

protected boolean checkInventory(boolean questUpdated,
                                 java.util.HashMap<java.lang.Integer,java.lang.Integer> itemList)

processMobDeathUpdate

protected boolean processMobDeathUpdate(CombatClient.QuestMobDeath msg)

processTaskUpdate

protected boolean processTaskUpdate(QuestClient.TaskUpdateMessage msg)

handleConclude

public boolean handleConclude()
called when the player is concluding (turning in) the quest returns false if the quest is not able to be concluded

Overrides:
handleConclude in class QuestState

updateObjectiveStatus

public boolean updateObjectiveStatus()

sendItemUpdate

protected void sendItemUpdate()
Sends out a message with the list of items still required to complete this Quest.


updateQuestLog

public void updateQuestLog()
sends QuestLogInfo message for this quest

Overrides:
updateQuestLog in class QuestState

makeDeliveryItems

protected void makeDeliveryItems()
generate delivery items and give them to the player


getObjectiveStatus

public java.util.HashMap<java.lang.Integer,java.util.List<java.lang.String>> getObjectiveStatus()
for client display: current state

Specified by:
getObjectiveStatus in class QuestState

setGoalsStatus

public void setGoalsStatus(java.util.List<BasicQuestState.CollectionGoalStatus> goalsStatus)

getGoalsStatus

public java.util.List<BasicQuestState.CollectionGoalStatus> getGoalsStatus()

setKillGoalsStatus

public void setKillGoalsStatus(java.util.List<BasicQuestState.KillGoalStatus> killGoalsStatus)

getKillGoalsStatus

public java.util.List<BasicQuestState.KillGoalStatus> getKillGoalsStatus()

setCategoryKillGoalsStatus

public void setCategoryKillGoalsStatus(java.util.List<BasicQuestState.CategoryKillGoalStatus> categoryKillGoalsStatus)

getCategoryKillGoalsStatus

public java.util.List<BasicQuestState.CategoryKillGoalStatus> getCategoryKillGoalsStatus()

setTaskGoalsStatus

public void setTaskGoalsStatus(java.util.List<BasicQuestState.TaskGoalStatus> taskGoalsStatus)

getTaskGoalsStatus

public java.util.List<BasicQuestState.TaskGoalStatus> getTaskGoalsStatus()

setDeliveryItems

public void setDeliveryItems(java.util.List<java.lang.Integer> items)
a list of items that the quest gives to the player when the player accepts the quest


addDeliveryItem

public void addDeliveryItem(int item)

getDeliveryItems

public java.util.List<java.lang.Integer> getDeliveryItems()

setDeliveryItemsGiven

public void setDeliveryItemsGiven(boolean given)

getDeliveryItemsGiven

public boolean getDeliveryItemsGiven()

handleInit

public void handleInit()
called after the queststate is initialized and set by the world server to the player

Overrides:
handleInit in class QuestState

handleInitHelper

protected void handleInitHelper()

handleInvUpdate

public void handleInvUpdate()
Description copied from class: QuestState
called when the player's inv changes

Overrides:
handleInvUpdate in class QuestState

completeHandler

protected void completeHandler()
marks quest as completed if we just completed it


getCompletionLevel

public int getCompletionLevel()
Calculates what grades of the quest have been completed

Overrides:
getCompletionLevel in class QuestState
Returns:
the highest secondary


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