mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-10-14 06:34:55 +02:00
finish npcs
This commit is contained in:
@@ -321,6 +321,9 @@ bool BehaviourDatabase::loadActions(ScriptReader& script, NpcBehaviour* behaviou
|
||||
} else if (identifier == "burning") {
|
||||
action->type = BEHAVIOUR_TYPE_BURNING;
|
||||
searchType = BEHAVIOUR_PARAMETER_TWO;
|
||||
} else if (identifier == "drunk") {
|
||||
action->type = BEHAVIOUR_TYPE_BURNING;
|
||||
searchType = BEHAVIOUR_PARAMETER_TWO;
|
||||
} else if (identifier == "setquestvalue") {
|
||||
action->type = BEHAVIOUR_TYPE_QUESTVALUE;
|
||||
searchType = BEHAVIOUR_PARAMETER_TWO;
|
||||
@@ -496,6 +499,9 @@ NpcBehaviourNode* BehaviourDatabase::readValue(ScriptReader& script)
|
||||
} else if (identifier == "burning") {
|
||||
node = new NpcBehaviourNode();
|
||||
node->type = BEHAVIOUR_TYPE_BURNING;
|
||||
} else if (identifier == "drunk") {
|
||||
node = new NpcBehaviourNode();
|
||||
node->type = BEHAVIOUR_TYPE_DRUNK;
|
||||
} else if (identifier == "level") {
|
||||
node = new NpcBehaviourNode();
|
||||
node->type = BEHAVIOUR_TYPE_LEVEL;
|
||||
@@ -1032,6 +1038,14 @@ int32_t BehaviourDatabase::evaluate(NpcBehaviourNode* node, Player* player, cons
|
||||
|
||||
return damage->getTotalDamage();
|
||||
}
|
||||
case BEHAVIOUR_TYPE_DRUNK: {
|
||||
Condition* condition = player->getCondition(CONDITION_DRUNK);
|
||||
if (!condition) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
case BEHAVIOUR_TYPE_POISON: {
|
||||
Condition* condition = player->getCondition(CONDITION_POISON);
|
||||
if (!condition) {
|
||||
|
@@ -85,6 +85,7 @@ enum NpcBehaviourType_t
|
||||
BEHAVIOUR_TYPE_BLESS, // add blessing to player
|
||||
BEHAVIOUR_TYPE_CREATECONTAINER, // create a container of an item in particular
|
||||
BEHAVIOUR_TYPE_TOWN, // change player town
|
||||
BEHAVIOUR_TYPE_DRUNK, // get/set drunk (set not done)
|
||||
};
|
||||
|
||||
enum NpcBehaviourOperator_t
|
||||
|
Reference in New Issue
Block a user