diff options
author | Jesusaves <cpntb1@ymail.com> | 2018-09-13 14:14:53 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2018-09-13 14:14:53 -0300 |
commit | e4fb06529d6f26eef45930094607324504d8c836 (patch) | |
tree | 297fd005eb37613ead9ddedad7ae4ebacd9bf369 /npc/functions | |
parent | aceef3c0250ec65ca4d616500a8b202ca7a573dc (diff) | |
download | serverdata-e4fb06529d6f26eef45930094607324504d8c836.tar.gz serverdata-e4fb06529d6f26eef45930094607324504d8c836.tar.bz2 serverdata-e4fb06529d6f26eef45930094607324504d8c836.tar.xz serverdata-e4fb06529d6f26eef45930094607324504d8c836.zip |
This should simplify pet_detective logic
Diffstat (limited to 'npc/functions')
-rw-r--r-- | npc/functions/petsales.txt | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/npc/functions/petsales.txt b/npc/functions/petsales.txt new file mode 100644 index 000000000..68dc46d24 --- /dev/null +++ b/npc/functions/petsales.txt @@ -0,0 +1,30 @@ +// TMW-2 Script +// Author: Jesusalva +// Desc: Grand Hunter Pet Quest Utils. +// Note: Remember to update GHQ and pet_detective on LoF Village (017-1) + +// Core logic for Pet Detective. Doesn't checks for stock, allowing exploits. +// MobID, ItemID, Base Value +function script PDQ_InnerSwitch { + + .@mid=getarg(0); + .@iid=getarg(1); + .@val=getarg(2, 30); + + .@price=.@val**(PETMEMO[GHQ_GetQuestIDByMonsterID(.@mid)]+1); + mesn; + mesq l("That'll cost you @@ @@.", .@price, getitemlink(.@iid)); + next; + if (askyesno() == ASK_YES) { + if (countitem(.@iid) >= .@price) { + delitem .@iid, .@price; + makepet .@mid; + getexp .@price*BaseLevel, 0; + PETMEMO[GHQ_GetQuestIDByMonsterID(.@mid)]+=1; + mesn; + mesq l("There you go!"); + return 1; + } + } + return 0; +} |