diff --git a/data/monster/790/juggernaut.xml b/data/monster/790/juggernaut.xml index 41e67a4..bbbe5a8 100644 --- a/data/monster/790/juggernaut.xml +++ b/data/monster/790/juggernaut.xml @@ -1,4 +1,4 @@ - + diff --git a/data/npc/daniel.npc b/data/npc/daniel.npc index 10945f6..d91660d 100644 --- a/data/npc/daniel.npc +++ b/data/npc/daniel.npc @@ -98,10 +98,10 @@ Topic=3,"rotworm" -> Amount=17635, "Maybe you have noticed the numerous rotworms Topic=3,"cyclop" -> Amount=17636, "We've successfully driven the minotaurs off this island, but the underground city of the cyclopes - Cyclopolis - is still standing. ...", "We're always looking for adventurers who'd help us decimate the number of cyclopes. Will you assist the city of Edron by killing 500 of them?", Topic=4 -"task",QuestValue(17633)=100 -> Amount=4000, Price=2000, "Very nice, %N. That will push the trolls' forces back a little. Here is your reward!", SetQuestValue(QuestValue(17632),99999), SetQuestValue(17632,0), Experience(Amount), CreateMoney -"task",QuestValue(17634)=150 -> Amount=5000, Price=2500, "Congratulations, you've fought well against the goblin plague. Thank you! Here is your reward!", SetQuestValue(QuestValue(17632),99999), SetQuestValue(17632,0), Experience(Amount), CreateMoney -"task",QuestValue(17635)=150 -> Amount=4000, Price=3000, "Well done! Thanks to you the city is a bit safer. Here's your reward!", SetQuestValue(QuestValue(17632),99999), SetQuestValue(17632,0), Experience(Amount), CreateMoney -"task",QuestValue(17636)=500 -> Amount=25000, Price=10000, "Very good job, %N. You've been a great help. Here's your reward!", SetQuestValue(QuestValue(17632),99999), SetQuestValue(17632,0), Experience(Amount), CreateMoney +"task",QuestValue(17633)=100 -> Amount=20*QuestValue(17633)*ExperienceStage(49)*5/100, Price=2000, "Very nice, %N. That will push the trolls' forces back a little. Here is your reward!", SetQuestValue(QuestValue(17632),99999), SetQuestValue(17632,0), Experience(Amount), CreateMoney +"task",QuestValue(17634)=150 -> Amount=25*QuestValue(17634)*ExperienceStage(49)*5/100, Price=2500, "Congratulations, you've fought well against the goblin plague. Thank you! Here is your reward!", SetQuestValue(QuestValue(17632),99999), SetQuestValue(17632,0), Experience(Amount), CreateMoney +"task",QuestValue(17635)=150 -> Amount=55*QuestValue(17635)*ExperienceStage(49)*5/100, Price=3000, "Well done! Thanks to you the city is a bit safer. Here's your reward!", SetQuestValue(QuestValue(17632),99999), SetQuestValue(17632,0), Experience(Amount), CreateMoney +"task",QuestValue(17636)=500 -> Amount=150*QuestValue(17636)*ExperienceStage(49)*5/100, Price=10000, "Very good job, %N. You've been a great help. Here's your reward!", SetQuestValue(QuestValue(17632),99999), SetQuestValue(17632,0), Experience(Amount), CreateMoney # Speaks "task",QuestValue(17632)>0 -> "Your current task is in progress. Follow the status of your task in the quest log. If you wish to cancel your in-progress task then don't be afraid and feel free to cancel." diff --git a/data/npc/grizzlyadams.npc b/data/npc/grizzlyadams.npc index 193fe26..90918d5 100644 --- a/data/npc/grizzlyadams.npc +++ b/data/npc/grizzlyadams.npc @@ -53,12 +53,12 @@ Topic=1,"tortoise" -> Amount=17613, "You'll find them on the Laguna Islands. Hun Topic=1,"gargoyle" -> Amount=17614, "They can be found all over Tibia. Hunt 65 of them. Interested?", Topic=2 Topic=1 -> "Maybe next time." -"task",QuestValue(17609)=100 -> Data=1, Amount=5000, Price=3000, "Spiffing work, old chap. What would you like to get for reward: %A EXP or %P gold?", Topic=4 -"task",QuestValue(17610)=100 -> Data=2, Amount=5000, Price=3000, "Spiffing work, old chap. What would you like to get for reward: %A EXP or %P gold?", Topic=4 -"task",QuestValue(17611)=50 -> Data=2, Amount=5000, Price=3000, "Spiffing work, old chap. What would you like to get for reward: %A EXP or %P gold?", Topic=4 -"task",QuestValue(17612)=100 -> Data=1, Amount=5000, Price=4000, "Spiffing work, old chap. What would you like to get for reward: %A EXP or %P gold?", Topic=4 -"task",QuestValue(17613)=100 -> Data=2, Amount=6000, Price=4000, "Spiffing work, old chap. What would you like to get for reward: %A EXP or %P gold?", Topic=4 -"task",QuestValue(17614)=65 -> Data=3, Amount=5000, Price=5000, "Spiffing work, old chap. What would you like to get for reward: %A EXP or %P gold?", Topic=4 +"task",QuestValue(17609)=100 -> Data=1, Amount=40*QuestValue(17609)*ExperienceStage(49)*5/100, Price=3000, "Spiffing work, old chap. What would you like to get for reward: %A EXP or %P gold?", Topic=4 +"task",QuestValue(17610)=100 -> Data=2, Amount=120*QuestValue(17610)*ExperienceStage(49)*5/100, Price=3000, "Spiffing work, old chap. What would you like to get for reward: %A EXP or %P gold?", Topic=4 +"task",QuestValue(17611)=50 -> Data=2, Amount=150*QuestValue(17611)*ExperienceStage(49)*5/100, Price=3000, "Spiffing work, old chap. What would you like to get for reward: %A EXP or %P gold?", Topic=4 +"task",QuestValue(17612)=100 -> Data=1, Amount=115*QuestValue(17612)*ExperienceStage(49)*5/100, Price=4000, "Spiffing work, old chap. What would you like to get for reward: %A EXP or %P gold?", Topic=4 +"task",QuestValue(17613)=100 -> Data=2, Amount=150*QuestValue(17613)*ExperienceStage(49)*5/100, Price=4000, "Spiffing work, old chap. What would you like to get for reward: %A EXP or %P gold?", Topic=4 +"task",QuestValue(17614)=65 -> Data=3, Amount=150*QuestValue(17614)*ExperienceStage(49)*5/100, Price=5000, "Spiffing work, old chap. What would you like to get for reward: %A EXP or %P gold?", Topic=4 # Level 50-79 "task",QuestValue(17607)=1,QuestValue(17608)=0,level>49,level<80 -> "Alright, what would you like to hunt? Quara scouts, ancient scarabs, wyverns, bonebeasts or dragons.", Topic=5 @@ -68,11 +68,11 @@ Topic=5,"wyvern" -> Amount=17618, "They can be found all over Tibia. Hunt 100 wy Topic=5,"bonebeast" -> Amount=17619, "They can be found all over Tibia. Hunt 100 bonebeasts. Interested?", Topic=2 Topic=5,"dragon" -> Amount=17620, "They can be found all over Tibia. Hunt 200 dragons. Interested?", Topic=2 -"task",QuestValue(17616)=200 -> Data=2, Amount=15000, Price=6000, "Spiffing work, old chap. What would you like to get for reward: %A EXP or %P gold?", Topic=4 -"task",QuestValue(17617)=125 -> Data=2, Amount=18000, Price=5000, "Spiffing work, old chap. What would you like to get for reward: %A EXP or %P gold?", Topic=4 -"task",QuestValue(17618)=100 -> Data=3, Amount=15000, Price=9000, "Spiffing work, old chap. What would you like to get for reward: %A EXP or %P gold?", Topic=4 -"task",QuestValue(17619)=100 -> Data=3, Amount=10000, Price=9000, "Spiffing work, old chap. What would you like to get for reward: %A EXP or %P gold?", Topic=4 -"task",QuestValue(17620)=200 -> Data=2, Amount=20000, Price=8000, "Spiffing work, old chap. What would you like to get for reward: %A EXP or %P gold?", Topic=4 +"task",QuestValue(17616)=200 -> Data=2, Amount=430*QuestValue(17616)*ExperienceStage(79)*10/100, Price=6000, "Spiffing work, old chap. What would you like to get for reward: %A EXP or %P gold?", Topic=4 +"task",QuestValue(17617)=125 -> Data=2, Amount=720*QuestValue(17617)*ExperienceStage(79)*10/100, Price=5000, "Spiffing work, old chap. What would you like to get for reward: %A EXP or %P gold?", Topic=4 +"task",QuestValue(17618)=100 -> Data=3, Amount=515*QuestValue(17618)*ExperienceStage(79)*10/100, Price=9000, "Spiffing work, old chap. What would you like to get for reward: %A EXP or %P gold?", Topic=4 +"task",QuestValue(17619)=100 -> Data=3, Amount=580*QuestValue(17619)*ExperienceStage(79)*10/100, Price=9000, "Spiffing work, old chap. What would you like to get for reward: %A EXP or %P gold?", Topic=4 +"task",QuestValue(17620)=200 -> Data=2, Amount=700*QuestValue(17620)*ExperienceStage(79)*10/100, Price=8000, "Spiffing work, old chap. What would you like to get for reward: %A EXP or %P gold?", Topic=4 # Level 80-129 "task",QuestValue(17607)=1,QuestValue(17608)=0,level>79,level<130 -> "Alright, what would you like to hunt? Underwater quara, giant spiders, banshees, lichs or cults.", Topic=6 @@ -82,11 +82,11 @@ Topic=6,"banshee" -> Amount=17623, "The Banshee is an undead creature of sheer t Topic=6,"lich" -> Amount=17624, "Lich hell. Ugh, to become a Lich is the ultimate goal of all those who follow the dark path of necromancy. Hunt 500 of them. Alright?", Topic=2 Topic=6,"cult" -> Amount=17625, "I hate those strange cult fanatics. Hunt 500 of any cult follower. Alright?", Topic=2 -"task",QuestValue(17621)=600 -> Data=4, Amount=80000, Price=25000, "Spiffing work, old chap. What would you like to get for reward: %A EXP or %P gold?", Topic=4 -"task",QuestValue(17622)=500 -> Data=3, Amount=75000, Price=30000, "Spiffing work, old chap. What would you like to get for reward: %A EXP or %P gold?", Topic=4 -"task",QuestValue(17623)=300 -> Data=5, Amount=100000, Price=20000, "Spiffing work, old chap. What would you like to get for reward: %A EXP or %P gold?", Topic=4 -"task",QuestValue(17624)=500 -> Data=4, Amount=70000, Price=30000, "Spiffing work, old chap. What would you like to get for reward: %A EXP or %P gold?", Topic=4 -"task",QuestValue(17625)=500 -> Data=2, Amount=50000, Price=25000, "Spiffing work, old chap. What would you like to get for reward: %A EXP or %P gold?", Topic=4 +"task",QuestValue(17621)=600 -> Data=4, Amount=850*QuestValue(17621)*ExperienceStage(129)*15/100, Price=25000, "Spiffing work, old chap. What would you like to get for reward: %A EXP or %P gold?", Topic=4 +"task",QuestValue(17622)=500 -> Data=3, Amount=900*QuestValue(17622)*ExperienceStage(129)*15/100, Price=30000, "Spiffing work, old chap. What would you like to get for reward: %A EXP or %P gold?", Topic=4 +"task",QuestValue(17623)=300 -> Data=5, Amount=900*QuestValue(17623)*ExperienceStage(129)*15/100, Price=20000, "Spiffing work, old chap. What would you like to get for reward: %A EXP or %P gold?", Topic=4 +"task",QuestValue(17624)=500 -> Data=4, Amount=900*QuestValue(17624)*ExperienceStage(129)*15/100, Price=30000, "Spiffing work, old chap. What would you like to get for reward: %A EXP or %P gold?", Topic=4 +"task",QuestValue(17625)=500 -> Data=2, Amount=325*QuestValue(17625)*ExperienceStage(129)*15/100, Price=25000, "Spiffing work, old chap. What would you like to get for reward: %A EXP or %P gold?", Topic=4 # Level 130+ "task",QuestValue(17607)=1,QuestValue(17608)=0,level>129 -> "Alright, what would you like to hunt? Hydras, serpent spawns, behemoths, dragon lords, hand of cursed fates, juggernauts.", Topic=7 @@ -97,12 +97,12 @@ Topic=7,"dragon" -> Amount=17629, "They can be found all over Tibia. Hunt 600 dr Topic=7,"hand" -> Amount=17630, "Those creatures are annoying and obviously lacking a head. Hunt 200 of them. Interested?", Topic=2 Topic=7,"juggernaut" -> Amount=17631, "Juggernauts are known to be able to slash the head of a dragon with one hit. Hunt 200 of them. Interested?", Topic=2 -"task",QuestValue(17626)=650 -> Data=4, Amount=200000, Price=50000, "Spiffing work, old chap. What would you like to get for reward: %A EXP or %P gold?", Topic=4 -"task",QuestValue(17627)=800 -> Data=5, Amount=300000, Price=80000, "Spiffing work, old chap. What would you like to get for reward: %A EXP or %P gold?", Topic=4 -"task",QuestValue(17628)=700 -> Data=5, Amount=250000, Price=60000, "Spiffing work, old chap. What would you like to get for reward: %A EXP or %P gold?", Topic=4 -"task",QuestValue(17629)=600 -> Data=5, Amount=100000, Price=45000, "Spiffing work, old chap. What would you like to get for reward: %A EXP or %P gold?", Topic=4 -"task",QuestValue(17630)=200 -> Data=5, Amount=150000, Price=100000, "Spiffing work, old chap. What would you like to get for reward: %A EXP or %P gold?", Topic=4 -"task",QuestValue(17631)=200 -> Data=6, Amount=250000, Price=200000, "Spiffing work, old chap. What would you like to get for reward: %A EXP or %P gold?", Topic=4 +"task",QuestValue(17626)=650 -> Data=4, Amount=2100*QuestValue(17626)*ExperienceStage(130)*20/100, Price=50000, "Spiffing work, old chap. What would you like to get for reward: %A EXP or %P gold?", Topic=4 +"task",QuestValue(17627)=800 -> Data=5, Amount=2000*QuestValue(17627)*ExperienceStage(130)*20/100, Price=80000, "Spiffing work, old chap. What would you like to get for reward: %A EXP or %P gold?", Topic=4 +"task",QuestValue(17628)=700 -> Data=5, Amount=2500*QuestValue(17628)*ExperienceStage(130)*20/100, Price=60000, "Spiffing work, old chap. What would you like to get for reward: %A EXP or %P gold?", Topic=4 +"task",QuestValue(17629)=600 -> Data=5, Amount=2100*QuestValue(17629)*ExperienceStage(130)*20/100, Price=45000, "Spiffing work, old chap. What would you like to get for reward: %A EXP or %P gold?", Topic=4 +"task",QuestValue(17630)=200 -> Data=5, Amount=5000*QuestValue(17630)*ExperienceStage(130)*20/100, Price=100000, "Spiffing work, old chap. What would you like to get for reward: %A EXP or %P gold?", Topic=4 +"task",QuestValue(17631)=200 -> Data=6, Amount=6500*QuestValue(17631)*ExperienceStage(130)*20/100, Price=200000, "Spiffing work, old chap. What would you like to get for reward: %A EXP or %P gold?", Topic=4 # Speaks "task",QuestValue(17608)>0 -> "Your current task is in progress. Follow the status of your task in the quest log. If you wish to cancel your in-progress task then don't be afraid and feel free to cancel." diff --git a/src/behaviourdatabase.cpp b/src/behaviourdatabase.cpp index c8cade5..c63a10c 100644 --- a/src/behaviourdatabase.cpp +++ b/src/behaviourdatabase.cpp @@ -564,6 +564,10 @@ NpcBehaviourNode* BehaviourDatabase::readValue(ScriptReader& script) node = new NpcBehaviourNode(); node->type = BEHAVIOUR_TYPE_COUNT; searchType = BEHAVIOUR_PARAMETER_ONE; + } else if (identifier == "experiencestage") { + node = new NpcBehaviourNode(); + node->type = BEHAVIOUR_TYPE_EXPERIENCESTAGE; + searchType = BEHAVIOUR_PARAMETER_ONE; } else if (identifier == "random") { node = new NpcBehaviourNode(); node->type = BEHAVIOUR_TYPE_RANDOM; @@ -636,6 +640,28 @@ NpcBehaviourNode* BehaviourDatabase::readFactor(ScriptReader& script, NpcBehavio nextNode = headNode; } + // / operator + while (true) { + if (script.Token != SPECIAL) { + break; + } + + if (script.getSpecial() != '/') { + break; + } + + NpcBehaviourNode* headNode = new NpcBehaviourNode(); + headNode->type = BEHAVIOUR_TYPE_OPERATION; + headNode->number = BEHAVIOUR_OPERATOR_DIVIDE; + headNode->left = nextNode; + + script.nextToken(); + nextNode = readValue(script); + + headNode->right = nextNode; + nextNode = headNode; + } + // + - operators while (true) { if (script.Token != SPECIAL) { @@ -1136,6 +1162,10 @@ int32_t BehaviourDatabase::evaluate(NpcBehaviourNode* node, Player* player, cons } return player->getItemTypeCount(itemId, data); } + case BEHAVIOUR_TYPE_EXPERIENCESTAGE: { + int32_t level = evaluate(node->left, player, message); + return g_game.getExperienceStage(level); + } case BEHAVIOUR_TYPE_COUNTMONEY: return player->getMoney(); case BEHAVIOUR_TYPE_BURNING: { @@ -1285,6 +1315,8 @@ int32_t BehaviourDatabase::checkOperation(Player* player, NpcBehaviourNode* node return leftResult != rightResult; case BEHAVIOUR_OPERATOR_MULTIPLY: return leftResult * rightResult; + case BEHAVIOUR_OPERATOR_DIVIDE: + return leftResult / rightResult; case BEHAVIOUR_OPERATOR_SUM: return leftResult + rightResult; case BEHAVIOUR_OPERATOR_RES: diff --git a/src/behaviourdatabase.h b/src/behaviourdatabase.h index 4ab3423..3309694 100644 --- a/src/behaviourdatabase.h +++ b/src/behaviourdatabase.h @@ -84,6 +84,7 @@ enum NpcBehaviourType_t BEHAVIOUR_TYPE_WITHDRAW, // withdraw from player bank balance BEHAVIOUR_TYPE_DEPOSIT, // deposit x amount of gold BEHAVIOUR_TYPE_TRANSFER, // transfer x amount of gold + BEHAVIOUR_TYPE_EXPERIENCESTAGE, // get experience staged based on player level BEHAVIOUR_TYPE_BLESS, // add blessing to player BEHAVIOUR_TYPE_CREATECONTAINER, // create a container of an item in particular BEHAVIOUR_TYPE_TOWN, // change player town @@ -106,6 +107,7 @@ enum NpcBehaviourOperator_t BEHAVIOUR_OPERATOR_LESSER_OR_EQUALS = 'L', BEHAVIOUR_OPERATOR_NOT_EQUALS = 'N', BEHAVIOUR_OPERATOR_MULTIPLY = '*', + BEHAVIOUR_OPERATOR_DIVIDE = '/', BEHAVIOUR_OPERATOR_SUM = '+', BEHAVIOUR_OPERATOR_RES = '-', };