diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-10-17 16:15:51 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-10-17 16:15:51 +0300 |
commit | 0e55e85e9e9a6a4028a29e8c214b69cbc3a54ffe (patch) | |
tree | 7e6205674b8baf6c8f450a747dadb3ac705ab04f /src/emap/script.c | |
parent | 6d6c12a1721f1432cb576606917dc68db2c9708b (diff) | |
download | plugin-0e55e85e9e9a6a4028a29e8c214b69cbc3a54ffe.tar.gz plugin-0e55e85e9e9a6a4028a29e8c214b69cbc3a54ffe.tar.bz2 plugin-0e55e85e9e9a6a4028a29e8c214b69cbc3a54ffe.tar.xz plugin-0e55e85e9e9a6a4028a29e8c214b69cbc3a54ffe.zip |
Add support for insert cards script.
Diffstat (limited to 'src/emap/script.c')
-rw-r--r-- | src/emap/script.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/emap/script.c b/src/emap/script.c index 905bcf5..098fc6e 100644 --- a/src/emap/script.c +++ b/src/emap/script.c @@ -319,6 +319,20 @@ void script_run_item_amount_script(TBL_PC *sd, struct script_code *itemScript, i script->current_item_id = 0; } +void script_run_card_script(TBL_PC *sd, struct script_code *itemScript, int itemId, int cardId) +{ + if (!itemScript) + return; + + script->current_item_id = itemId; + pc->setreg(sd, script->add_str("@itemId"), itemId); + pc->setreg(sd, script->add_str("@cardId"), cardId); + script->run(itemScript, 0, sd->bl.id, npc->fake_nd->bl.id); + pc->setreg(sd, script->add_str("@itemId"), 0); + pc->setreg(sd, script->add_str("@cardId"), 0); + script->current_item_id = 0; +} + uint32 MakeDWord(uint16 word0, uint16 word1) { return ((uint32)(word0)) | ((uint32)(word1 << 0x10)); |