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

@ -18,9 +18,9 @@
"barrel" -> Type=2793, Amount=1, Price=12, "Do you want to buy a barrel for %P gold?", Topic=81
"trough" -> Type=2792, Amount=1, Price=7, "Do you want to buy a trough for %P gold?", Topic=81
"trunk" -> Type=2794, Amount=1, Price=10, "Do you want to buy a trunk for %P gold?", Topic=81
"armor","rack" -> Type=6114, Amount=1, Price=90, "Do you want to buy an armor rack for %P gold?", Topic=81
"weapon","rack" -> Type=6115, Amount=1, Price=90, "Do you want to buy a weapon rack for %P gold?", Topic=81
"bookcase" -> Type=6372, Amount=1, Price=70, "Do you want to buy a bookcase for %P gold?", Topic=81
"armor","rack" -> Type=6114, Amount=1, Price=90, "Do you want to buy an armor rack for %P gold?", Topic=81
"weapon","rack" -> Type=6115, Amount=1, Price=90, "Do you want to buy a weapon rack for %P gold?", Topic=81
"bookcase",ClientVersion>=790 -> Type=6372, Amount=1, Price=70, "Do you want to buy a bookcase for %P gold?", Topic=81
Topic=81,"yes",Premium,CountMoney>=Price -> "Here you are.", DeleteMoney, Create(Type)
Topic=81,"yes",CountMoney>=Price -> "I'm sorry, but you need a premium account if you want to buy furniture."

View File

@ -13,7 +13,7 @@
"large", "amphora" -> Type=2805, Amount=1, Price=50, "Do you want to buy a large amphora for %P gold?", Topic=81
"amphora" -> Type=2893, Amount=1, Price=4, "Do you want to buy an amphora for %P gold?", Topic=81
"coal","basin" -> Type=2806, Amount=1, Price=25, "Do you want to buy a coal basin for %P gold?", Topic=81
"oven" -> Type=6371, Amount=1, Price=80, "Do you want to buy an oven for %P gold?", Topic=81
"oven",ClientVersion>=790 -> Type=6371, Amount=1, Price=80, "Do you want to buy an oven for %P gold?", Topic=81
Topic=81,"yes",Premium,CountMoney>=Price -> "Here you are.", DeleteMoney, Create(Type)
Topic=81,"yes",CountMoney>=Price -> "I'm sorry, but you need a premium account if you want to buy furniture."

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