fix npcs to make ClientVersion statements

This commit is contained in:
ErikasKontenis
2020-03-04 21:17:00 +02:00
parent 25864a162c
commit 6624800f1c
4 changed files with 10 additions and 4 deletions

View File

@@ -572,6 +572,9 @@ NpcBehaviourNode* BehaviourDatabase::readValue(ScriptReader& script)
node = new NpcBehaviourNode();
node->type = BEHAVIOUR_TYPE_SLOTITEM;
searchType = BEHAVIOUR_PARAMETER_ONE;
} else if (identifier == "clientversion") {
node = new NpcBehaviourNode();
node->type = BEHAVIOUR_TYPE_CLIENTVERSION;
}
if (searchType == BEHAVIOUR_PARAMETER_ONE) {
@@ -1221,6 +1224,8 @@ int32_t BehaviourDatabase::evaluate(NpcBehaviourNode* node, Player* player, cons
return checkOperation(player, node, message);
case BEHAVIOUR_TYPE_BALANCE:
return player->getBankBalance();
case BEHAVIOUR_TYPE_CLIENTVERSION:
return g_game.getClientVersion();
case BEHAVIOUR_TYPE_MESSAGE_TRANSFERTOPLAYERNAME_STATE: {
std::string lowerMessage = asLowerCaseString(message);
if (lowerMessage.find("to ") != std::string::npos) {

View File

@@ -94,6 +94,7 @@ enum NpcBehaviourType_t
BEHAVIOUR_TYPE_EXPIRINGQUESTVALUE, // get/set expiring quest value
BEHAVIOUR_TYPE_SLOTITEM, // get slot item
BEHAVIOUR_TYPE_PZFREE, // is player pz not locked
BEHAVIOUR_TYPE_CLIENTVERSION, // get client version
};
enum NpcBehaviourOperator_t