diff --git a/_module/are/townofascension.are.json b/_module/are/townofascension.are.json index cf496981..bbfa3fe8 100644 --- a/_module/are/townofascension.are.json +++ b/_module/are/townofascension.are.json @@ -6357,7 +6357,7 @@ }, "Version": { "type": "dword", - "value": 519 + "value": 520 }, "Width": { "type": "int", diff --git a/_module/ifo/module.ifo.json b/_module/ifo/module.ifo.json index e7851a16..2027970c 100644 --- a/_module/ifo/module.ifo.json +++ b/_module/ifo/module.ifo.json @@ -1374,7 +1374,7 @@ }, "Mod_MinGameVer": { "type": "cexostring", - "value": "1.88" + "value": "1.89" }, "Mod_MinPerHour": { "type": "byte", diff --git a/_module/ncs/5minlock.ncs b/_module/ncs/5minlock.ncs index e32520ab..c6aa26b9 100644 Binary files a/_module/ncs/5minlock.ncs and b/_module/ncs/5minlock.ncs differ diff --git a/_module/ncs/5minlock2.ncs b/_module/ncs/5minlock2.ncs index e7410de7..70ebc6ab 100644 Binary files a/_module/ncs/5minlock2.ncs and b/_module/ncs/5minlock2.ncs differ diff --git a/_module/ncs/_clone_.ncs b/_module/ncs/_clone_.ncs index 8e79925a..e6988631 100644 Binary files a/_module/ncs/_clone_.ncs and b/_module/ncs/_clone_.ncs differ diff --git a/_module/ncs/_clone_1.ncs b/_module/ncs/_clone_1.ncs index f863fb33..dda0a3b9 100644 Binary files a/_module/ncs/_clone_1.ncs and b/_module/ncs/_clone_1.ncs differ diff --git a/_module/ncs/_clone_2.ncs b/_module/ncs/_clone_2.ncs index 91d3bfd5..df3e3000 100644 Binary files a/_module/ncs/_clone_2.ncs and b/_module/ncs/_clone_2.ncs differ diff --git a/_module/ncs/_clone_3.ncs b/_module/ncs/_clone_3.ncs index 67267fcf..61bf9cc3 100644 Binary files a/_module/ncs/_clone_3.ncs and b/_module/ncs/_clone_3.ncs differ diff --git a/_module/ncs/_clone_4.ncs b/_module/ncs/_clone_4.ncs index 3c9877dd..470a4a39 100644 Binary files a/_module/ncs/_clone_4.ncs and b/_module/ncs/_clone_4.ncs differ diff --git a/_module/ncs/_clone_5.ncs b/_module/ncs/_clone_5.ncs index f794221e..f7ad67e2 100644 Binary files a/_module/ncs/_clone_5.ncs and b/_module/ncs/_clone_5.ncs differ diff --git a/_module/ncs/_clone_6.ncs b/_module/ncs/_clone_6.ncs index 49ee3c69..0f8a0067 100644 Binary files a/_module/ncs/_clone_6.ncs and b/_module/ncs/_clone_6.ncs differ diff --git a/_module/ncs/_clone_7.ncs b/_module/ncs/_clone_7.ncs index 00b0bc88..dd6bf4c5 100644 Binary files a/_module/ncs/_clone_7.ncs and b/_module/ncs/_clone_7.ncs differ diff --git a/_module/ncs/_clone_8.ncs b/_module/ncs/_clone_8.ncs index 0e36e41a..5f1ec4a1 100644 Binary files a/_module/ncs/_clone_8.ncs and b/_module/ncs/_clone_8.ncs differ diff --git a/_module/ncs/_clone_9.ncs b/_module/ncs/_clone_9.ncs index ac5dc0de..c3cb540a 100644 Binary files a/_module/ncs/_clone_9.ncs and b/_module/ncs/_clone_9.ncs differ diff --git a/_module/ncs/_start_clone_cnv.ncs b/_module/ncs/_start_clone_cnv.ncs index 228a7654..eaf062bb 100644 Binary files a/_module/ncs/_start_clone_cnv.ncs and b/_module/ncs/_start_clone_cnv.ncs differ diff --git a/_module/ncs/ac_dmjail.ncs b/_module/ncs/ac_dmjail.ncs index c8e592c9..3e6462da 100644 Binary files a/_module/ncs/ac_dmjail.ncs and b/_module/ncs/ac_dmjail.ncs differ diff --git a/_module/ncs/ac_druidtool.ncs b/_module/ncs/ac_druidtool.ncs index 21b23bed..dca174e1 100644 Binary files a/_module/ncs/ac_druidtool.ncs and b/_module/ncs/ac_druidtool.ncs differ diff --git a/_module/ncs/ac_itool.ncs b/_module/ncs/ac_itool.ncs index 3b2bab12..d70f392b 100644 Binary files a/_module/ncs/ac_itool.ncs and b/_module/ncs/ac_itool.ncs differ diff --git a/_module/ncs/ac_stoneofrecall.ncs b/_module/ncs/ac_stoneofrecall.ncs index d13b939b..7b9e9acf 100644 Binary files a/_module/ncs/ac_stoneofrecall.ncs and b/_module/ncs/ac_stoneofrecall.ncs differ diff --git a/_module/ncs/ac_teleportation.ncs b/_module/ncs/ac_teleportation.ncs index 404d7a19..413f4ca2 100644 Binary files a/_module/ncs/ac_teleportation.ncs and b/_module/ncs/ac_teleportation.ncs differ diff --git a/_module/ncs/ag_area_clean.ncs b/_module/ncs/ag_area_clean.ncs index e0ee8b6b..83f5abe6 100644 Binary files a/_module/ncs/ag_area_clean.ncs and b/_module/ncs/ag_area_clean.ncs differ diff --git a/_module/ncs/allowcleric2open.ncs b/_module/ncs/allowcleric2open.ncs index 33b5048b..626182a9 100644 Binary files a/_module/ncs/allowcleric2open.ncs and b/_module/ncs/allowcleric2open.ncs differ diff --git a/_module/ncs/allowpaladinonly.ncs b/_module/ncs/allowpaladinonly.ncs index 25a2229d..4dd52d8a 100644 Binary files a/_module/ncs/allowpaladinonly.ncs and b/_module/ncs/allowpaladinonly.ncs differ diff --git a/_module/ncs/altardeath.ncs b/_module/ncs/altardeath.ncs index d8aefab5..a3980c9c 100644 Binary files a/_module/ncs/altardeath.ncs and b/_module/ncs/altardeath.ncs differ diff --git a/_module/ncs/aq_banned.ncs b/_module/ncs/aq_banned.ncs index b2827593..952e779a 100644 Binary files a/_module/ncs/aq_banned.ncs and b/_module/ncs/aq_banned.ncs differ diff --git a/_module/ncs/archery2.ncs b/_module/ncs/archery2.ncs index f03e2e4a..d1c091da 100644 Binary files a/_module/ncs/archery2.ncs and b/_module/ncs/archery2.ncs differ diff --git a/_module/ncs/archiespawn.ncs b/_module/ncs/archiespawn.ncs index a7b13deb..ee45158e 100644 Binary files a/_module/ncs/archiespawn.ncs and b/_module/ncs/archiespawn.ncs differ diff --git a/_module/ncs/area_clean_horse.ncs b/_module/ncs/area_clean_horse.ncs index 40eee283..4b7f5017 100644 Binary files a/_module/ncs/area_clean_horse.ncs and b/_module/ncs/area_clean_horse.ncs differ diff --git a/_module/ncs/arenadoor.ncs b/_module/ncs/arenadoor.ncs index 3e2a5204..c6c3a348 100644 Binary files a/_module/ncs/arenadoor.ncs and b/_module/ncs/arenadoor.ncs differ diff --git a/_module/ncs/array_example.ncs b/_module/ncs/array_example.ncs index 4515ec5d..90adc904 100644 Binary files a/_module/ncs/array_example.ncs and b/_module/ncs/array_example.ncs differ diff --git a/_module/ncs/assassinpercieve.ncs b/_module/ncs/assassinpercieve.ncs index 527fde17..31249677 100644 Binary files a/_module/ncs/assassinpercieve.ncs and b/_module/ncs/assassinpercieve.ncs differ diff --git a/_module/ncs/atropal_ai.ncs b/_module/ncs/atropal_ai.ncs index 0935c49e..d2950bf3 100644 Binary files a/_module/ncs/atropal_ai.ncs and b/_module/ncs/atropal_ai.ncs differ diff --git a/_module/ncs/atropaltouch.ncs b/_module/ncs/atropaltouch.ncs index e95b5c7f..af80ab69 100644 Binary files a/_module/ncs/atropaltouch.ncs and b/_module/ncs/atropaltouch.ncs differ diff --git a/_module/ncs/aura_ai.ncs b/_module/ncs/aura_ai.ncs index fe24db65..955f2f94 100644 Binary files a/_module/ncs/aura_ai.ncs and b/_module/ncs/aura_ai.ncs differ diff --git a/_module/ncs/auto_door_key.ncs b/_module/ncs/auto_door_key.ncs index d59a7e1d..7a42d658 100644 Binary files a/_module/ncs/auto_door_key.ncs and b/_module/ncs/auto_door_key.ncs differ diff --git a/_module/ncs/autoclose_door.ncs b/_module/ncs/autoclose_door.ncs index 72140cca..b5789f53 100644 Binary files a/_module/ncs/autoclose_door.ncs and b/_module/ncs/autoclose_door.ncs differ diff --git a/_module/ncs/awesomeblow_hb.ncs b/_module/ncs/awesomeblow_hb.ncs index c8f26c4c..eaca50f1 100644 Binary files a/_module/ncs/awesomeblow_hb.ncs and b/_module/ncs/awesomeblow_hb.ncs differ diff --git a/_module/ncs/banditpercieve.ncs b/_module/ncs/banditpercieve.ncs index 74de7159..a694b735 100644 Binary files a/_module/ncs/banditpercieve.ncs and b/_module/ncs/banditpercieve.ncs differ diff --git a/_module/ncs/barrelcheck.ncs b/_module/ncs/barrelcheck.ncs index 23e388e5..47c128d6 100644 Binary files a/_module/ncs/barrelcheck.ncs and b/_module/ncs/barrelcheck.ncs differ diff --git a/_module/ncs/barrelcheck2.ncs b/_module/ncs/barrelcheck2.ncs index 143b2fef..1c099441 100644 Binary files a/_module/ncs/barrelcheck2.ncs and b/_module/ncs/barrelcheck2.ncs differ diff --git a/_module/ncs/bathleveruse.ncs b/_module/ncs/bathleveruse.ncs index 93f44443..c465e6a6 100644 Binary files a/_module/ncs/bathleveruse.ncs and b/_module/ncs/bathleveruse.ncs differ diff --git a/_module/ncs/bbs_scribe_conv.ncs b/_module/ncs/bbs_scribe_conv.ncs index c05f3f49..2e60d990 100644 Binary files a/_module/ncs/bbs_scribe_conv.ncs and b/_module/ncs/bbs_scribe_conv.ncs differ diff --git a/_module/ncs/bbs_scribe_spawn.ncs b/_module/ncs/bbs_scribe_spawn.ncs index f3392f41..eea6a089 100644 Binary files a/_module/ncs/bbs_scribe_spawn.ncs and b/_module/ncs/bbs_scribe_spawn.ncs differ diff --git a/_module/ncs/bladespawn.ncs b/_module/ncs/bladespawn.ncs index ab647ba8..a3ef6954 100644 Binary files a/_module/ncs/bladespawn.ncs and b/_module/ncs/bladespawn.ncs differ diff --git a/_module/ncs/bleakaura1.ncs b/_module/ncs/bleakaura1.ncs index 3524be13..d996f9bf 100644 Binary files a/_module/ncs/bleakaura1.ncs and b/_module/ncs/bleakaura1.ncs differ diff --git a/_module/ncs/bleakaura2.ncs b/_module/ncs/bleakaura2.ncs index 9d99a394..fce3eeaf 100644 Binary files a/_module/ncs/bleakaura2.ncs and b/_module/ncs/bleakaura2.ncs differ diff --git a/_module/ncs/boot_nonmages.ncs b/_module/ncs/boot_nonmages.ncs index 576aca85..c34f27e5 100644 Binary files a/_module/ncs/boot_nonmages.ncs and b/_module/ncs/boot_nonmages.ncs differ diff --git a/_module/ncs/bootnonguild.ncs b/_module/ncs/bootnonguild.ncs index cae92f4e..406103aa 100644 Binary files a/_module/ncs/bootnonguild.ncs and b/_module/ncs/bootnonguild.ncs differ diff --git a/_module/ncs/bootnonmember1.ncs b/_module/ncs/bootnonmember1.ncs index 1636b575..ebf7532d 100644 Binary files a/_module/ncs/bootnonmember1.ncs and b/_module/ncs/bootnonmember1.ncs differ diff --git a/_module/ncs/bootnonmember2.ncs b/_module/ncs/bootnonmember2.ncs index bc5f6371..5535501f 100644 Binary files a/_module/ncs/bootnonmember2.ncs and b/_module/ncs/bootnonmember2.ncs differ diff --git a/_module/ncs/brutepercieve.ncs b/_module/ncs/brutepercieve.ncs index 1fc9504c..81342d8f 100644 Binary files a/_module/ncs/brutepercieve.ncs and b/_module/ncs/brutepercieve.ncs differ diff --git a/_module/ncs/bullrusher_hb.ncs b/_module/ncs/bullrusher_hb.ncs index 5a7449cd..9081ae91 100644 Binary files a/_module/ncs/bullrusher_hb.ncs and b/_module/ncs/bullrusher_hb.ncs differ diff --git a/_module/ncs/cha_drain.ncs b/_module/ncs/cha_drain.ncs index cbd978e7..59752414 100644 Binary files a/_module/ncs/cha_drain.ncs and b/_module/ncs/cha_drain.ncs differ diff --git a/_module/ncs/chamber_use.ncs b/_module/ncs/chamber_use.ncs index c2214932..25f03e69 100644 Binary files a/_module/ncs/chamber_use.ncs and b/_module/ncs/chamber_use.ncs differ diff --git a/_module/ncs/charger_hb.ncs b/_module/ncs/charger_hb.ncs index a4d9ba2a..70278056 100644 Binary files a/_module/ncs/charger_hb.ncs and b/_module/ncs/charger_hb.ncs differ diff --git a/_module/ncs/cleanarea.ncs b/_module/ncs/cleanarea.ncs index 68573a10..aeac568d 100644 Binary files a/_module/ncs/cleanarea.ncs and b/_module/ncs/cleanarea.ncs differ diff --git a/_module/ncs/cleanfloor.ncs b/_module/ncs/cleanfloor.ncs index 743c70ee..1c324194 100644 Binary files a/_module/ncs/cleanfloor.ncs and b/_module/ncs/cleanfloor.ncs differ diff --git a/_module/ncs/cleantavern.ncs b/_module/ncs/cleantavern.ncs index 4ff24427..91e5d98a 100644 Binary files a/_module/ncs/cleantavern.ncs and b/_module/ncs/cleantavern.ncs differ diff --git a/_module/ncs/cleartown.ncs b/_module/ncs/cleartown.ncs index e0ee8b6b..83f5abe6 100644 Binary files a/_module/ncs/cleartown.ncs and b/_module/ncs/cleartown.ncs differ diff --git a/_module/ncs/clericonly.ncs b/_module/ncs/clericonly.ncs index 8a7d16f4..22db49ad 100644 Binary files a/_module/ncs/clericonly.ncs and b/_module/ncs/clericonly.ncs differ diff --git a/_module/ncs/clericsecret.ncs b/_module/ncs/clericsecret.ncs index f0e6a973..497923ab 100644 Binary files a/_module/ncs/clericsecret.ncs and b/_module/ncs/clericsecret.ncs differ diff --git a/_module/ncs/clone_hb.ncs b/_module/ncs/clone_hb.ncs index beb3d4ff..98ef8c0d 100644 Binary files a/_module/ncs/clone_hb.ncs and b/_module/ncs/clone_hb.ncs differ diff --git a/_module/ncs/close_door.ncs b/_module/ncs/close_door.ncs index ba5d1a2c..ffd2486d 100644 Binary files a/_module/ncs/close_door.ncs and b/_module/ncs/close_door.ncs differ diff --git a/_module/ncs/close_n_lock.ncs b/_module/ncs/close_n_lock.ncs index 02a2a6fe..6e3f8932 100644 Binary files a/_module/ncs/close_n_lock.ncs and b/_module/ncs/close_n_lock.ncs differ diff --git a/_module/ncs/closedoor.ncs b/_module/ncs/closedoor.ncs index 420c024b..5fc6d872 100644 Binary files a/_module/ncs/closedoor.ncs and b/_module/ncs/closedoor.ncs differ diff --git a/_module/ncs/closenlock.ncs b/_module/ncs/closenlock.ncs index b02c0b1d..b37e9643 100644 Binary files a/_module/ncs/closenlock.ncs and b/_module/ncs/closenlock.ncs differ diff --git a/_module/ncs/codi_heartbeat.ncs b/_module/ncs/codi_heartbeat.ncs index 23cb027c..79fffcf1 100644 Binary files a/_module/ncs/codi_heartbeat.ncs and b/_module/ncs/codi_heartbeat.ncs differ diff --git a/_module/ncs/codi_ondeath.ncs b/_module/ncs/codi_ondeath.ncs index 119493b0..dac56dc6 100644 Binary files a/_module/ncs/codi_ondeath.ncs and b/_module/ncs/codi_ondeath.ncs differ diff --git a/_module/ncs/counterspawns.ncs b/_module/ncs/counterspawns.ncs index 39c33778..290128a3 100644 Binary files a/_module/ncs/counterspawns.ncs and b/_module/ncs/counterspawns.ncs differ diff --git a/_module/ncs/crypt2door.ncs b/_module/ncs/crypt2door.ncs index c24fd742..74516d18 100644 Binary files a/_module/ncs/crypt2door.ncs and b/_module/ncs/crypt2door.ncs differ diff --git a/_module/ncs/cryptdoor.ncs b/_module/ncs/cryptdoor.ncs index 0a27f961..f1c387be 100644 Binary files a/_module/ncs/cryptdoor.ncs and b/_module/ncs/cryptdoor.ncs differ diff --git a/_module/ncs/cryptdooruse.ncs b/_module/ncs/cryptdooruse.ncs index ed8f0a2a..68aa0a1c 100644 Binary files a/_module/ncs/cryptdooruse.ncs and b/_module/ncs/cryptdooruse.ncs differ diff --git a/_module/ncs/crypttrigger.ncs b/_module/ncs/crypttrigger.ncs index 55e558a2..1723bcbb 100644 Binary files a/_module/ncs/crypttrigger.ncs and b/_module/ncs/crypttrigger.ncs differ diff --git a/_module/ncs/dancingbowruns.ncs b/_module/ncs/dancingbowruns.ncs index fc79f328..91141804 100644 Binary files a/_module/ncs/dancingbowruns.ncs and b/_module/ncs/dancingbowruns.ncs differ diff --git a/_module/ncs/danger.ncs b/_module/ncs/danger.ncs index 48d5d7cc..fb1dd2f4 100644 Binary files a/_module/ncs/danger.ncs and b/_module/ncs/danger.ncs differ diff --git a/_module/ncs/darkdeath.ncs b/_module/ncs/darkdeath.ncs index 12e067b4..ee8ac9ee 100644 Binary files a/_module/ncs/darkdeath.ncs and b/_module/ncs/darkdeath.ncs differ diff --git a/_module/ncs/darktrigger.ncs b/_module/ncs/darktrigger.ncs index 3678fcf3..a3f08a15 100644 Binary files a/_module/ncs/darktrigger.ncs and b/_module/ncs/darktrigger.ncs differ diff --git a/_module/ncs/darktrigger2a.ncs b/_module/ncs/darktrigger2a.ncs index 0d166dc2..025fa0b7 100644 Binary files a/_module/ncs/darktrigger2a.ncs and b/_module/ncs/darktrigger2a.ncs differ diff --git a/_module/ncs/day_night_check.ncs b/_module/ncs/day_night_check.ncs index 66a0bb3a..96eb6417 100644 Binary files a/_module/ncs/day_night_check.ncs and b/_module/ncs/day_night_check.ncs differ diff --git a/_module/ncs/deadjump.ncs b/_module/ncs/deadjump.ncs index a6681c50..54b97b93 100644 Binary files a/_module/ncs/deadjump.ncs and b/_module/ncs/deadjump.ncs differ diff --git a/_module/ncs/deadjump2.ncs b/_module/ncs/deadjump2.ncs index f117b695..9536f902 100644 Binary files a/_module/ncs/deadjump2.ncs and b/_module/ncs/deadjump2.ncs differ diff --git a/_module/ncs/deadjump3.ncs b/_module/ncs/deadjump3.ncs index 3a854e43..e2a9f1e8 100644 Binary files a/_module/ncs/deadjump3.ncs and b/_module/ncs/deadjump3.ncs differ diff --git a/_module/ncs/deathport.ncs b/_module/ncs/deathport.ncs index 1cb47c76..d90a3609 100644 Binary files a/_module/ncs/deathport.ncs and b/_module/ncs/deathport.ncs differ diff --git a/_module/ncs/desecrating_aur1.ncs b/_module/ncs/desecrating_aur1.ncs index 25a6de37..4c8b5023 100644 Binary files a/_module/ncs/desecrating_aur1.ncs and b/_module/ncs/desecrating_aur1.ncs differ diff --git a/_module/ncs/devilspawn.ncs b/_module/ncs/devilspawn.ncs index 32e6c749..f726e4b9 100644 Binary files a/_module/ncs/devilspawn.ncs and b/_module/ncs/devilspawn.ncs differ diff --git a/_module/ncs/diamond_golem_hb.ncs b/_module/ncs/diamond_golem_hb.ncs new file mode 100644 index 00000000..910108f5 Binary files /dev/null and b/_module/ncs/diamond_golem_hb.ncs differ diff --git a/_module/ncs/divideloot.ncs b/_module/ncs/divideloot.ncs index 5a57d40d..4ca14257 100644 Binary files a/_module/ncs/divideloot.ncs and b/_module/ncs/divideloot.ncs differ diff --git a/_module/ncs/divideloot2.ncs b/_module/ncs/divideloot2.ncs index c8f55230..861cac25 100644 Binary files a/_module/ncs/divideloot2.ncs and b/_module/ncs/divideloot2.ncs differ diff --git a/_module/ncs/dividepartyloot1.ncs b/_module/ncs/dividepartyloot1.ncs index fe650c3e..be675a48 100644 Binary files a/_module/ncs/dividepartyloot1.ncs and b/_module/ncs/dividepartyloot1.ncs differ diff --git a/_module/ncs/dividepartyloot2.ncs b/_module/ncs/dividepartyloot2.ncs index d7bfdd6c..30e7da14 100644 Binary files a/_module/ncs/dividepartyloot2.ncs and b/_module/ncs/dividepartyloot2.ncs differ diff --git a/_module/ncs/dm_forg_ondist.ncs b/_module/ncs/dm_forg_ondist.ncs index 5a08f5ee..bb67fcda 100644 Binary files a/_module/ncs/dm_forg_ondist.ncs and b/_module/ncs/dm_forg_ondist.ncs differ diff --git a/_module/ncs/dmdoor.ncs b/_module/ncs/dmdoor.ncs index a8988cb1..e7a6e1be 100644 Binary files a/_module/ncs/dmdoor.ncs and b/_module/ncs/dmdoor.ncs differ diff --git a/_module/ncs/dmdoorports.ncs b/_module/ncs/dmdoorports.ncs index 580faca5..8365607d 100644 Binary files a/_module/ncs/dmdoorports.ncs and b/_module/ncs/dmdoorports.ncs differ diff --git a/_module/ncs/dmfi_activate.ncs b/_module/ncs/dmfi_activate.ncs index 735cb9fb..274c94fe 100644 Binary files a/_module/ncs/dmfi_activate.ncs and b/_module/ncs/dmfi_activate.ncs differ diff --git a/_module/ncs/dmfi_execute.ncs b/_module/ncs/dmfi_execute.ncs index 29be0923..f027d619 100644 Binary files a/_module/ncs/dmfi_execute.ncs and b/_module/ncs/dmfi_execute.ncs differ diff --git a/_module/ncs/dmfi_onrest.ncs b/_module/ncs/dmfi_onrest.ncs index b3759611..e8172772 100644 Binary files a/_module/ncs/dmfi_onrest.ncs and b/_module/ncs/dmfi_onrest.ncs differ diff --git a/_module/ncs/dmfi_plychat_exe.ncs b/_module/ncs/dmfi_plychat_exe.ncs index 39413bcd..604dbc97 100644 Binary files a/_module/ncs/dmfi_plychat_exe.ncs and b/_module/ncs/dmfi_plychat_exe.ncs differ diff --git a/_module/ncs/dmfi_voice1.ncs b/_module/ncs/dmfi_voice1.ncs index c63d715a..5a6aaa78 100644 Binary files a/_module/ncs/dmfi_voice1.ncs and b/_module/ncs/dmfi_voice1.ncs differ diff --git a/_module/ncs/dmfi_x_afflict.ncs b/_module/ncs/dmfi_x_afflict.ncs index 4169a23c..b38e4da4 100644 Binary files a/_module/ncs/dmfi_x_afflict.ncs and b/_module/ncs/dmfi_x_afflict.ncs differ diff --git a/_module/ncs/dmfi_x_emote.ncs b/_module/ncs/dmfi_x_emote.ncs index e9a90ff3..156fb927 100644 Binary files a/_module/ncs/dmfi_x_emote.ncs and b/_module/ncs/dmfi_x_emote.ncs differ diff --git a/_module/ncs/dmjailtorture.ncs b/_module/ncs/dmjailtorture.ncs index 09e38a5e..1430a699 100644 Binary files a/_module/ncs/dmjailtorture.ncs and b/_module/ncs/dmjailtorture.ncs differ diff --git a/_module/ncs/dmtorture.ncs b/_module/ncs/dmtorture.ncs index d67808ef..0b6b67a7 100644 Binary files a/_module/ncs/dmtorture.ncs and b/_module/ncs/dmtorture.ncs differ diff --git a/_module/ncs/doby_no_pc_chest.ncs b/_module/ncs/doby_no_pc_chest.ncs index e6c95029..27ff6f56 100644 Binary files a/_module/ncs/doby_no_pc_chest.ncs and b/_module/ncs/doby_no_pc_chest.ncs differ diff --git a/_module/ncs/door_lock_night.ncs b/_module/ncs/door_lock_night.ncs index 8566b517..0d17e824 100644 Binary files a/_module/ncs/door_lock_night.ncs and b/_module/ncs/door_lock_night.ncs differ diff --git a/_module/ncs/dr_wraith_touch.ncs b/_module/ncs/dr_wraith_touch.ncs index 39d55276..1543fa92 100644 Binary files a/_module/ncs/dr_wraith_touch.ncs and b/_module/ncs/dr_wraith_touch.ncs differ diff --git a/_module/ncs/dragonlever_use.ncs b/_module/ncs/dragonlever_use.ncs index 2c202756..4095ba43 100644 Binary files a/_module/ncs/dragonlever_use.ncs and b/_module/ncs/dragonlever_use.ncs differ diff --git a/_module/ncs/dragonspawn.ncs b/_module/ncs/dragonspawn.ncs index a62f380f..5905fb65 100644 Binary files a/_module/ncs/dragonspawn.ncs and b/_module/ncs/dragonspawn.ncs differ diff --git a/_module/ncs/dragonstop2.ncs b/_module/ncs/dragonstop2.ncs index f638ebd7..c9885654 100644 Binary files a/_module/ncs/dragonstop2.ncs and b/_module/ncs/dragonstop2.ncs differ diff --git a/_module/ncs/draining_touch.ncs b/_module/ncs/draining_touch.ncs index 0550b41f..51a50757 100644 Binary files a/_module/ncs/draining_touch.ncs and b/_module/ncs/draining_touch.ncs differ diff --git a/_module/ncs/drowattack.ncs b/_module/ncs/drowattack.ncs index b3d755d5..9adca0b9 100644 Binary files a/_module/ncs/drowattack.ncs and b/_module/ncs/drowattack.ncs differ diff --git a/_module/ncs/drowbeat.ncs b/_module/ncs/drowbeat.ncs index d6e0e4a0..c8c4f6e2 100644 Binary files a/_module/ncs/drowbeat.ncs and b/_module/ncs/drowbeat.ncs differ diff --git a/_module/ncs/drowbosspercieve.ncs b/_module/ncs/drowbosspercieve.ncs index c43df1bc..61e06d55 100644 Binary files a/_module/ncs/drowbosspercieve.ncs and b/_module/ncs/drowbosspercieve.ncs differ diff --git a/_module/ncs/drowspawn.ncs b/_module/ncs/drowspawn.ncs index fd58c40b..12cc7ae9 100644 Binary files a/_module/ncs/drowspawn.ncs and b/_module/ncs/drowspawn.ncs differ diff --git a/_module/ncs/dummy2.ncs b/_module/ncs/dummy2.ncs index fc1e2358..cf1af0a0 100644 Binary files a/_module/ncs/dummy2.ncs and b/_module/ncs/dummy2.ncs differ diff --git a/_module/ncs/dummyspell.ncs b/_module/ncs/dummyspell.ncs index 2770325e..2a7d5df3 100644 Binary files a/_module/ncs/dummyspell.ncs and b/_module/ncs/dummyspell.ncs differ diff --git a/_module/ncs/elementalbeat.ncs b/_module/ncs/elementalbeat.ncs index ac4758fc..6b415a26 100644 Binary files a/_module/ncs/elementalbeat.ncs and b/_module/ncs/elementalbeat.ncs differ diff --git a/_module/ncs/elemtflamedamage.ncs b/_module/ncs/elemtflamedamage.ncs index 70cdc5a4..dc332a7b 100644 Binary files a/_module/ncs/elemtflamedamage.ncs and b/_module/ncs/elemtflamedamage.ncs differ diff --git a/_module/ncs/enterguild.ncs b/_module/ncs/enterguild.ncs index 3a30e037..83ee9e44 100644 Binary files a/_module/ncs/enterguild.ncs and b/_module/ncs/enterguild.ncs differ diff --git a/_module/ncs/eq_arthxbow.ncs b/_module/ncs/eq_arthxbow.ncs index 8347b6bc..73c65bbb 100644 Binary files a/_module/ncs/eq_arthxbow.ncs and b/_module/ncs/eq_arthxbow.ncs differ diff --git a/_module/ncs/eq_artifactlbow.ncs b/_module/ncs/eq_artifactlbow.ncs index 981bf569..eb25c633 100644 Binary files a/_module/ncs/eq_artifactlbow.ncs and b/_module/ncs/eq_artifactlbow.ncs differ diff --git a/_module/ncs/eq_artifactsbow.ncs b/_module/ncs/eq_artifactsbow.ncs index 981bf569..eb25c633 100644 Binary files a/_module/ncs/eq_artifactsbow.ncs and b/_module/ncs/eq_artifactsbow.ncs differ diff --git a/_module/ncs/eq_artifactsling.ncs b/_module/ncs/eq_artifactsling.ncs index 981bf569..eb25c633 100644 Binary files a/_module/ncs/eq_artifactsling.ncs and b/_module/ncs/eq_artifactsling.ncs differ diff --git a/_module/ncs/eq_artlxbow.ncs b/_module/ncs/eq_artlxbow.ncs index 981bf569..eb25c633 100644 Binary files a/_module/ncs/eq_artlxbow.ncs and b/_module/ncs/eq_artlxbow.ncs differ diff --git a/_module/ncs/eq_immortalcrown.ncs b/_module/ncs/eq_immortalcrown.ncs index c5161b3f..475f0183 100644 Binary files a/_module/ncs/eq_immortalcrown.ncs and b/_module/ncs/eq_immortalcrown.ncs differ diff --git a/_module/ncs/eq_legendaryaxes.ncs b/_module/ncs/eq_legendaryaxes.ncs index aab00cf6..1f2c2d96 100644 Binary files a/_module/ncs/eq_legendaryaxes.ncs and b/_module/ncs/eq_legendaryaxes.ncs differ diff --git a/_module/ncs/eq_legendarybow.ncs b/_module/ncs/eq_legendarybow.ncs index 8ed379ba..22b1f539 100644 Binary files a/_module/ncs/eq_legendarybow.ncs and b/_module/ncs/eq_legendarybow.ncs differ diff --git a/_module/ncs/eq_legendarydart.ncs b/_module/ncs/eq_legendarydart.ncs index f6ebf426..0f77807a 100644 Binary files a/_module/ncs/eq_legendarydart.ncs and b/_module/ncs/eq_legendarydart.ncs differ diff --git a/_module/ncs/eq_legendaryslin.ncs b/_module/ncs/eq_legendaryslin.ncs index 1114c536..023e8f67 100644 Binary files a/_module/ncs/eq_legendaryslin.ncs and b/_module/ncs/eq_legendaryslin.ncs differ diff --git a/_module/ncs/eq_legendarystar.ncs b/_module/ncs/eq_legendarystar.ncs index 43e9ed55..27387100 100644 Binary files a/_module/ncs/eq_legendarystar.ncs and b/_module/ncs/eq_legendarystar.ncs differ diff --git a/_module/ncs/eq_legendaryxbow.ncs b/_module/ncs/eq_legendaryxbow.ncs index e0278447..80554873 100644 Binary files a/_module/ncs/eq_legendaryxbow.ncs and b/_module/ncs/eq_legendaryxbow.ncs differ diff --git a/_module/ncs/ew_act_drunk.ncs b/_module/ncs/ew_act_drunk.ncs index 6b0163d9..c906ec11 100644 Binary files a/_module/ncs/ew_act_drunk.ncs and b/_module/ncs/ew_act_drunk.ncs differ diff --git a/_module/ncs/ew_ani_armsup.ncs b/_module/ncs/ew_ani_armsup.ncs index 19887a99..89937dd4 100644 Binary files a/_module/ncs/ew_ani_armsup.ncs and b/_module/ncs/ew_ani_armsup.ncs differ diff --git a/_module/ncs/ew_ani_bowdown.ncs b/_module/ncs/ew_ani_bowdown.ncs index 31dfdca2..6d34c52e 100644 Binary files a/_module/ncs/ew_ani_bowdown.ncs and b/_module/ncs/ew_ani_bowdown.ncs differ diff --git a/_module/ncs/ew_ani_crouch.ncs b/_module/ncs/ew_ani_crouch.ncs index 1eae9340..45285a42 100644 Binary files a/_module/ncs/ew_ani_crouch.ncs and b/_module/ncs/ew_ani_crouch.ncs differ diff --git a/_module/ncs/ew_ani_kneelout.ncs b/_module/ncs/ew_ani_kneelout.ncs index 3fd3cbf9..6087ab51 100644 Binary files a/_module/ncs/ew_ani_kneelout.ncs and b/_module/ncs/ew_ani_kneelout.ncs differ diff --git a/_module/ncs/ew_ani_kneelup.ncs b/_module/ncs/ew_ani_kneelup.ncs index fee33dcb..50e46f64 100644 Binary files a/_module/ncs/ew_ani_kneelup.ncs and b/_module/ncs/ew_ani_kneelup.ncs differ diff --git a/_module/ncs/ew_ani_reset.ncs b/_module/ncs/ew_ani_reset.ncs index d8582ee4..5ee10ded 100644 Binary files a/_module/ncs/ew_ani_reset.ncs and b/_module/ncs/ew_ani_reset.ncs differ diff --git a/_module/ncs/ew_dance.ncs b/_module/ncs/ew_dance.ncs index fbe0ea8f..0a22ca9e 100644 Binary files a/_module/ncs/ew_dance.ncs and b/_module/ncs/ew_dance.ncs differ diff --git a/_module/ncs/ew_lapsit0.ncs b/_module/ncs/ew_lapsit0.ncs index e50472db..9a55a008 100644 Binary files a/_module/ncs/ew_lapsit0.ncs and b/_module/ncs/ew_lapsit0.ncs differ diff --git a/_module/ncs/ew_lapsit180.ncs b/_module/ncs/ew_lapsit180.ncs index d57c19f9..b6f7c3ee 100644 Binary files a/_module/ncs/ew_lapsit180.ncs and b/_module/ncs/ew_lapsit180.ncs differ diff --git a/_module/ncs/ew_lapsit270.ncs b/_module/ncs/ew_lapsit270.ncs index 74b6fec9..29547d8f 100644 Binary files a/_module/ncs/ew_lapsit270.ncs and b/_module/ncs/ew_lapsit270.ncs differ diff --git a/_module/ncs/ew_lapsit90.ncs b/_module/ncs/ew_lapsit90.ncs index 26e9b53c..e928dbda 100644 Binary files a/_module/ncs/ew_lapsit90.ncs and b/_module/ncs/ew_lapsit90.ncs differ diff --git a/_module/ncs/exitarena.ncs b/_module/ncs/exitarena.ncs index 1e867288..9db94e39 100644 Binary files a/_module/ncs/exitarena.ncs and b/_module/ncs/exitarena.ncs differ diff --git a/_module/ncs/exitguild.ncs b/_module/ncs/exitguild.ncs index da7f9ce2..b5bd90cd 100644 Binary files a/_module/ncs/exitguild.ncs and b/_module/ncs/exitguild.ncs differ diff --git a/_module/ncs/exitoverspwnjail.ncs b/_module/ncs/exitoverspwnjail.ncs index f2657309..c9977a64 100644 Binary files a/_module/ncs/exitoverspwnjail.ncs and b/_module/ncs/exitoverspwnjail.ncs differ diff --git a/_module/ncs/exmplonclientent.ncs b/_module/ncs/exmplonclientent.ncs index 2c7069e5..5e2f7aac 100644 Binary files a/_module/ncs/exmplonclientent.ncs and b/_module/ncs/exmplonclientent.ncs differ diff --git a/_module/ncs/exploitfix.ncs b/_module/ncs/exploitfix.ncs index 01aafb62..66204f2e 100644 Binary files a/_module/ncs/exploitfix.ncs and b/_module/ncs/exploitfix.ncs differ diff --git a/_module/ncs/fbi_npc_drinklos.ncs b/_module/ncs/fbi_npc_drinklos.ncs index 4dd30c7e..de6674e1 100644 Binary files a/_module/ncs/fbi_npc_drinklos.ncs and b/_module/ncs/fbi_npc_drinklos.ncs differ diff --git a/_module/ncs/fbi_npc_drinkwin.ncs b/_module/ncs/fbi_npc_drinkwin.ncs index e2d41660..a2611880 100644 Binary files a/_module/ncs/fbi_npc_drinkwin.ncs and b/_module/ncs/fbi_npc_drinkwin.ncs differ diff --git a/_module/ncs/fear2_aura1.ncs b/_module/ncs/fear2_aura1.ncs index 1b2e5485..642a3938 100644 Binary files a/_module/ncs/fear2_aura1.ncs and b/_module/ncs/fear2_aura1.ncs differ diff --git a/_module/ncs/fear_aura1.ncs b/_module/ncs/fear_aura1.ncs index 7f2cf600..ffc3d0ef 100644 Binary files a/_module/ncs/fear_aura1.ncs and b/_module/ncs/fear_aura1.ncs differ diff --git a/_module/ncs/firepercieve.ncs b/_module/ncs/firepercieve.ncs index e8a60431..59180d9d 100644 Binary files a/_module/ncs/firepercieve.ncs and b/_module/ncs/firepercieve.ncs differ diff --git a/_module/ncs/fky_chat.ncs b/_module/ncs/fky_chat.ncs index 6ca7c02f..b75c6cac 100644 Binary files a/_module/ncs/fky_chat.ncs and b/_module/ncs/fky_chat.ncs differ diff --git a/_module/ncs/fky_chat_cn_act.ncs b/_module/ncs/fky_chat_cn_act.ncs index 9cf1d1b4..542b36f7 100644 Binary files a/_module/ncs/fky_chat_cn_act.ncs and b/_module/ncs/fky_chat_cn_act.ncs differ diff --git a/_module/ncs/fky_chat_dm_comm.ncs b/_module/ncs/fky_chat_dm_comm.ncs index dbda6e33..d49af99b 100644 Binary files a/_module/ncs/fky_chat_dm_comm.ncs and b/_module/ncs/fky_chat_dm_comm.ncs differ diff --git a/_module/ncs/flameheartbeat.ncs b/_module/ncs/flameheartbeat.ncs index 1c564386..227bc6c0 100644 Binary files a/_module/ncs/flameheartbeat.ncs and b/_module/ncs/flameheartbeat.ncs differ diff --git a/_module/ncs/forgeused.ncs b/_module/ncs/forgeused.ncs index c2820c02..d7eb0b38 100644 Binary files a/_module/ncs/forgeused.ncs and b/_module/ncs/forgeused.ncs differ diff --git a/_module/ncs/fuguepercieved.ncs b/_module/ncs/fuguepercieved.ncs index 7d970a3d..59bbc9c2 100644 Binary files a/_module/ncs/fuguepercieved.ncs and b/_module/ncs/fuguepercieved.ncs differ diff --git a/_module/ncs/fuguespawn.ncs b/_module/ncs/fuguespawn.ncs index 3b752994..c244a118 100644 Binary files a/_module/ncs/fuguespawn.ncs and b/_module/ncs/fuguespawn.ncs differ diff --git a/_module/ncs/gc_add_ability.ncs b/_module/ncs/gc_add_ability.ncs index 7d0aaf89..2cecb8dc 100644 Binary files a/_module/ncs/gc_add_ability.ncs and b/_module/ncs/gc_add_ability.ncs differ diff --git a/_module/ncs/gc_add_ac.ncs b/_module/ncs/gc_add_ac.ncs index 9a3a2009..511904c0 100644 Binary files a/_module/ncs/gc_add_ac.ncs and b/_module/ncs/gc_add_ac.ncs differ diff --git a/_module/ncs/gc_add_attk_bon.ncs b/_module/ncs/gc_add_attk_bon.ncs index 2e17a0e1..8d988c21 100644 Binary files a/_module/ncs/gc_add_attk_bon.ncs and b/_module/ncs/gc_add_attk_bon.ncs differ diff --git a/_module/ncs/gc_add_bon_spell.ncs b/_module/ncs/gc_add_bon_spell.ncs index 655c376b..7b5fdff3 100644 Binary files a/_module/ncs/gc_add_bon_spell.ncs and b/_module/ncs/gc_add_bon_spell.ncs differ diff --git a/_module/ncs/gc_add_dmg_bonus.ncs b/_module/ncs/gc_add_dmg_bonus.ncs index 747694c1..6020769a 100644 Binary files a/_module/ncs/gc_add_dmg_bonus.ncs and b/_module/ncs/gc_add_dmg_bonus.ncs differ diff --git a/_module/ncs/gc_add_dmg_imm.ncs b/_module/ncs/gc_add_dmg_imm.ncs index eee928f1..6a7e9bee 100644 Binary files a/_module/ncs/gc_add_dmg_imm.ncs and b/_module/ncs/gc_add_dmg_imm.ncs differ diff --git a/_module/ncs/gc_add_dmg_red.ncs b/_module/ncs/gc_add_dmg_red.ncs index 5b1adc50..8afa568d 100644 Binary files a/_module/ncs/gc_add_dmg_red.ncs and b/_module/ncs/gc_add_dmg_red.ncs differ diff --git a/_module/ncs/gc_add_ench_bon.ncs b/_module/ncs/gc_add_ench_bon.ncs index a1cd7f11..32dabf54 100644 Binary files a/_module/ncs/gc_add_ench_bon.ncs and b/_module/ncs/gc_add_ench_bon.ncs differ diff --git a/_module/ncs/gc_add_evade.ncs b/_module/ncs/gc_add_evade.ncs index 92eca737..1f81a7c9 100644 Binary files a/_module/ncs/gc_add_evade.ncs and b/_module/ncs/gc_add_evade.ncs differ diff --git a/_module/ncs/gc_add_feat.ncs b/_module/ncs/gc_add_feat.ncs index 2c6f3d00..b5be5580 100644 Binary files a/_module/ncs/gc_add_feat.ncs and b/_module/ncs/gc_add_feat.ncs differ diff --git a/_module/ncs/gc_add_freedom.ncs b/_module/ncs/gc_add_freedom.ncs index b276f6c2..b2b36dd4 100644 Binary files a/_module/ncs/gc_add_freedom.ncs and b/_module/ncs/gc_add_freedom.ncs differ diff --git a/_module/ncs/gc_add_haste.ncs b/_module/ncs/gc_add_haste.ncs index 621aed9d..77589fd1 100644 Binary files a/_module/ncs/gc_add_haste.ncs and b/_module/ncs/gc_add_haste.ncs differ diff --git a/_module/ncs/gc_add_immunity.ncs b/_module/ncs/gc_add_immunity.ncs index b44411d8..97636929 100644 Binary files a/_module/ncs/gc_add_immunity.ncs and b/_module/ncs/gc_add_immunity.ncs differ diff --git a/_module/ncs/gc_add_keen.ncs b/_module/ncs/gc_add_keen.ncs index e2cf9530..4185af4f 100644 Binary files a/_module/ncs/gc_add_keen.ncs and b/_module/ncs/gc_add_keen.ncs differ diff --git a/_module/ncs/gc_add_massv_crt.ncs b/_module/ncs/gc_add_massv_crt.ncs index b62c3193..6949648a 100644 Binary files a/_module/ncs/gc_add_massv_crt.ncs and b/_module/ncs/gc_add_massv_crt.ncs differ diff --git a/_module/ncs/gc_add_mighty.ncs b/_module/ncs/gc_add_mighty.ncs index d8462bc6..ceb986e1 100644 Binary files a/_module/ncs/gc_add_mighty.ncs and b/_module/ncs/gc_add_mighty.ncs differ diff --git a/_module/ncs/gc_add_regen.ncs b/_module/ncs/gc_add_regen.ncs index f848147c..cf37c6fc 100644 Binary files a/_module/ncs/gc_add_regen.ncs and b/_module/ncs/gc_add_regen.ncs differ diff --git a/_module/ncs/gc_add_resist.ncs b/_module/ncs/gc_add_resist.ncs index d4375c6d..03af5e61 100644 Binary files a/_module/ncs/gc_add_resist.ncs and b/_module/ncs/gc_add_resist.ncs differ diff --git a/_module/ncs/gc_add_save.ncs b/_module/ncs/gc_add_save.ncs index 3c439203..3bcc758a 100644 Binary files a/_module/ncs/gc_add_save.ncs and b/_module/ncs/gc_add_save.ncs differ diff --git a/_module/ncs/gc_add_skills.ncs b/_module/ncs/gc_add_skills.ncs index f12c1c34..ffe4da27 100644 Binary files a/_module/ncs/gc_add_skills.ncs and b/_module/ncs/gc_add_skills.ncs differ diff --git a/_module/ncs/gc_add_sr.ncs b/_module/ncs/gc_add_sr.ncs index 969bba42..f52a3f54 100644 Binary files a/_module/ncs/gc_add_sr.ncs and b/_module/ncs/gc_add_sr.ncs differ diff --git a/_module/ncs/gc_add_true_see.ncs b/_module/ncs/gc_add_true_see.ncs index a1a9bb72..9c72b9a8 100644 Binary files a/_module/ncs/gc_add_true_see.ncs and b/_module/ncs/gc_add_true_see.ncs differ diff --git a/_module/ncs/gc_add_vamp_regn.ncs b/_module/ncs/gc_add_vamp_regn.ncs index 1dfb3fcb..0647d6ee 100644 Binary files a/_module/ncs/gc_add_vamp_regn.ncs and b/_module/ncs/gc_add_vamp_regn.ncs differ diff --git a/_module/ncs/gen_spec_unique.ncs b/_module/ncs/gen_spec_unique.ncs index 224cdeed..733d9143 100644 Binary files a/_module/ncs/gen_spec_unique.ncs and b/_module/ncs/gen_spec_unique.ncs differ diff --git a/_module/ncs/getaway.ncs b/_module/ncs/getaway.ncs index fef9ad32..999c1a04 100644 Binary files a/_module/ncs/getaway.ncs and b/_module/ncs/getaway.ncs differ diff --git a/_module/ncs/ghast_stench1.ncs b/_module/ncs/ghast_stench1.ncs index dc5ba098..54f7b26f 100644 Binary files a/_module/ncs/ghast_stench1.ncs and b/_module/ncs/ghast_stench1.ncs differ diff --git a/_module/ncs/ghoul_bite.ncs b/_module/ncs/ghoul_bite.ncs index d78f9ea1..8bc1bd3b 100644 Binary files a/_module/ncs/ghoul_bite.ncs and b/_module/ncs/ghoul_bite.ncs differ diff --git a/_module/ncs/ghoul_claw.ncs b/_module/ncs/ghoul_claw.ncs index ac1c4238..e227fad6 100644 Binary files a/_module/ncs/ghoul_claw.ncs and b/_module/ncs/ghoul_claw.ncs differ diff --git a/_module/ncs/give_inventory.ncs b/_module/ncs/give_inventory.ncs index ce236a23..58f368ef 100644 Binary files a/_module/ncs/give_inventory.ncs and b/_module/ncs/give_inventory.ncs differ diff --git a/_module/ncs/goblindoor.ncs b/_module/ncs/goblindoor.ncs index c6bd7e71..5ca73d43 100644 Binary files a/_module/ncs/goblindoor.ncs and b/_module/ncs/goblindoor.ncs differ diff --git a/_module/ncs/goblinpercieve.ncs b/_module/ncs/goblinpercieve.ncs index fb49834b..0e07ed20 100644 Binary files a/_module/ncs/goblinpercieve.ncs and b/_module/ncs/goblinpercieve.ncs differ diff --git a/_module/ncs/good_by.ncs b/_module/ncs/good_by.ncs index b0c10cab..9a79d53e 100644 Binary files a/_module/ncs/good_by.ncs and b/_module/ncs/good_by.ncs differ diff --git a/_module/ncs/greaterdevilspaw.ncs b/_module/ncs/greaterdevilspaw.ncs index 78b0858e..21f5a110 100644 Binary files a/_module/ncs/greaterdevilspaw.ncs and b/_module/ncs/greaterdevilspaw.ncs differ diff --git a/_module/ncs/guardian1.ncs b/_module/ncs/guardian1.ncs index c5f7f6d1..4a9fbbde 100644 Binary files a/_module/ncs/guardian1.ncs and b/_module/ncs/guardian1.ncs differ diff --git a/_module/ncs/guardian2.ncs b/_module/ncs/guardian2.ncs index dc0283c5..15d47070 100644 Binary files a/_module/ncs/guardian2.ncs and b/_module/ncs/guardian2.ncs differ diff --git a/_module/ncs/guild_door.ncs b/_module/ncs/guild_door.ncs index e27ebe8e..86376612 100644 Binary files a/_module/ncs/guild_door.ncs and b/_module/ncs/guild_door.ncs differ diff --git a/_module/ncs/guildbootspc.ncs b/_module/ncs/guildbootspc.ncs index 9f59ad9c..b1533c44 100644 Binary files a/_module/ncs/guildbootspc.ncs and b/_module/ncs/guildbootspc.ncs differ diff --git a/_module/ncs/guilestatuescrpt.ncs b/_module/ncs/guilestatuescrpt.ncs index 98b8fdeb..4dae0f79 100644 Binary files a/_module/ncs/guilestatuescrpt.ncs and b/_module/ncs/guilestatuescrpt.ncs differ diff --git a/_module/ncs/guilesway.ncs b/_module/ncs/guilesway.ncs index 0492f03c..4dea8a2c 100644 Binary files a/_module/ncs/guilesway.ncs and b/_module/ncs/guilesway.ncs differ diff --git a/_module/ncs/gz_chair_use.ncs b/_module/ncs/gz_chair_use.ncs index 23eaed39..e99280e5 100644 Binary files a/_module/ncs/gz_chair_use.ncs and b/_module/ncs/gz_chair_use.ncs differ diff --git a/_module/ncs/healworshiper.ncs b/_module/ncs/healworshiper.ncs index 1ec8279e..825b7f99 100644 Binary files a/_module/ncs/healworshiper.ncs and b/_module/ncs/healworshiper.ncs differ diff --git a/_module/ncs/horrordying.ncs b/_module/ncs/horrordying.ncs index 8bf05a8b..b68f41b8 100644 Binary files a/_module/ncs/horrordying.ncs and b/_module/ncs/horrordying.ncs differ diff --git a/_module/ncs/horrorpercieve.ncs b/_module/ncs/horrorpercieve.ncs index 96a2db4f..e680e14b 100644 Binary files a/_module/ncs/horrorpercieve.ncs and b/_module/ncs/horrorpercieve.ncs differ diff --git a/_module/ncs/horsekey.ncs b/_module/ncs/horsekey.ncs index 13740241..91f4e4ff 100644 Binary files a/_module/ncs/horsekey.ncs and b/_module/ncs/horsekey.ncs differ diff --git a/_module/ncs/horsekey2.ncs b/_module/ncs/horsekey2.ncs index f80aa13b..6200b3b0 100644 Binary files a/_module/ncs/horsekey2.ncs and b/_module/ncs/horsekey2.ncs differ diff --git a/_module/ncs/horsekey3.ncs b/_module/ncs/horsekey3.ncs index 632c582b..fb317f5f 100644 Binary files a/_module/ncs/horsekey3.ncs and b/_module/ncs/horsekey3.ncs differ diff --git a/_module/ncs/horsekey4.ncs b/_module/ncs/horsekey4.ncs index 8bdfff30..0c90c8b5 100644 Binary files a/_module/ncs/horsekey4.ncs and b/_module/ncs/horsekey4.ncs differ diff --git a/_module/ncs/horsekey5.ncs b/_module/ncs/horsekey5.ncs index de35a86a..0a404e23 100644 Binary files a/_module/ncs/horsekey5.ncs and b/_module/ncs/horsekey5.ncs differ diff --git a/_module/ncs/horsekey6.ncs b/_module/ncs/horsekey6.ncs index 0ea6902c..f5d9e92e 100644 Binary files a/_module/ncs/horsekey6.ncs and b/_module/ncs/horsekey6.ncs differ diff --git a/_module/ncs/hunefer_rot.ncs b/_module/ncs/hunefer_rot.ncs index f561c7e6..444e9f81 100644 Binary files a/_module/ncs/hunefer_rot.ncs and b/_module/ncs/hunefer_rot.ncs differ diff --git a/_module/ncs/hunefer_shutdoor.ncs b/_module/ncs/hunefer_shutdoor.ncs index 325afcf4..5fcc4b7e 100644 Binary files a/_module/ncs/hunefer_shutdoor.ncs and b/_module/ncs/hunefer_shutdoor.ncs differ diff --git a/_module/ncs/immortalspawn.ncs b/_module/ncs/immortalspawn.ncs index 59332503..ef95f732 100644 Binary files a/_module/ncs/immortalspawn.ncs and b/_module/ncs/immortalspawn.ncs differ diff --git a/_module/ncs/immortaltalk.ncs b/_module/ncs/immortaltalk.ncs index b1390e92..32a28149 100644 Binary files a/_module/ncs/immortaltalk.ncs and b/_module/ncs/immortaltalk.ncs differ diff --git a/_module/ncs/imp_grab.ncs b/_module/ncs/imp_grab.ncs index 53330a3f..09a51a10 100644 Binary files a/_module/ncs/imp_grab.ncs and b/_module/ncs/imp_grab.ncs differ diff --git a/_module/ncs/impbeat.ncs b/_module/ncs/impbeat.ncs index 30c76ce1..b7c1299c 100644 Binary files a/_module/ncs/impbeat.ncs and b/_module/ncs/impbeat.ncs differ diff --git a/_module/ncs/inv_system3_ou.ncs b/_module/ncs/inv_system3_ou.ncs index 4e5fb94a..f87e2dce 100644 Binary files a/_module/ncs/inv_system3_ou.ncs and b/_module/ncs/inv_system3_ou.ncs differ diff --git a/_module/ncs/inv_system_new.ncs b/_module/ncs/inv_system_new.ncs index c4e7e608..3e405e4d 100644 Binary files a/_module/ncs/inv_system_new.ncs and b/_module/ncs/inv_system_new.ncs differ diff --git a/_module/ncs/inv_system_ou.ncs b/_module/ncs/inv_system_ou.ncs index 9f4baca6..01727b7d 100644 Binary files a/_module/ncs/inv_system_ou.ncs and b/_module/ncs/inv_system_ou.ncs differ diff --git a/_module/ncs/invroom_exit.ncs b/_module/ncs/invroom_exit.ncs index 4741b095..aea0571b 100644 Binary files a/_module/ncs/invroom_exit.ncs and b/_module/ncs/invroom_exit.ncs differ diff --git a/_module/ncs/invroom_onenter.ncs b/_module/ncs/invroom_onenter.ncs index 6240d8bf..c19a5295 100644 Binary files a/_module/ncs/invroom_onenter.ncs and b/_module/ncs/invroom_onenter.ncs differ diff --git a/_module/ncs/invroom_ou.ncs b/_module/ncs/invroom_ou.ncs index 070db053..007923db 100644 Binary files a/_module/ncs/invroom_ou.ncs and b/_module/ncs/invroom_ou.ncs differ diff --git a/_module/ncs/invroom_teleport.ncs b/_module/ncs/invroom_teleport.ncs index 00d75657..d56f3c3b 100644 Binary files a/_module/ncs/invroom_teleport.ncs and b/_module/ncs/invroom_teleport.ncs differ diff --git a/_module/ncs/jailbreak.ncs b/_module/ncs/jailbreak.ncs index 5ad82835..2b32b467 100644 Binary files a/_module/ncs/jailbreak.ncs and b/_module/ncs/jailbreak.ncs differ diff --git a/_module/ncs/jailpunishment.ncs b/_module/ncs/jailpunishment.ncs index b44d263d..cf67b519 100644 Binary files a/_module/ncs/jailpunishment.ncs and b/_module/ncs/jailpunishment.ncs differ diff --git a/_module/ncs/jailpunishment2.ncs b/_module/ncs/jailpunishment2.ncs index d2879a9e..a93a3ac0 100644 Binary files a/_module/ncs/jailpunishment2.ncs and b/_module/ncs/jailpunishment2.ncs differ diff --git a/_module/ncs/jimijimi.ncs b/_module/ncs/jimijimi.ncs index ea94b18e..8a7514e0 100644 Binary files a/_module/ncs/jimijimi.ncs and b/_module/ncs/jimijimi.ncs differ diff --git a/_module/ncs/keepopen.ncs b/_module/ncs/keepopen.ncs index db0c55ed..5a6bcf67 100644 Binary files a/_module/ncs/keepopen.ncs and b/_module/ncs/keepopen.ncs differ diff --git a/_module/ncs/lavastatue1.ncs b/_module/ncs/lavastatue1.ncs index a2bfb365..cf391b0a 100644 Binary files a/_module/ncs/lavastatue1.ncs and b/_module/ncs/lavastatue1.ncs differ diff --git a/_module/ncs/lavastatue2.ncs b/_module/ncs/lavastatue2.ncs index f63fb68f..f21f956c 100644 Binary files a/_module/ncs/lavastatue2.ncs and b/_module/ncs/lavastatue2.ncs differ diff --git a/_module/ncs/leetdeath.ncs b/_module/ncs/leetdeath.ncs index dd30d2a5..55bdd83b 100644 Binary files a/_module/ncs/leetdeath.ncs and b/_module/ncs/leetdeath.ncs differ diff --git a/_module/ncs/leetpercieve.ncs b/_module/ncs/leetpercieve.ncs index b9c58126..ccb6ee27 100644 Binary files a/_module/ncs/leetpercieve.ncs and b/_module/ncs/leetpercieve.ncs differ diff --git a/_module/ncs/lesserdevilspawn.ncs b/_module/ncs/lesserdevilspawn.ncs index 256c83a8..ab519dc4 100644 Binary files a/_module/ncs/lesserdevilspawn.ncs and b/_module/ncs/lesserdevilspawn.ncs differ diff --git a/_module/ncs/levelertalks.ncs b/_module/ncs/levelertalks.ncs index 8f55ee51..a76fe363 100644 Binary files a/_module/ncs/levelertalks.ncs and b/_module/ncs/levelertalks.ncs differ diff --git a/_module/ncs/livingstatue37.ncs b/_module/ncs/livingstatue37.ncs index eeb90c1e..4ccb6967 100644 Binary files a/_module/ncs/livingstatue37.ncs and b/_module/ncs/livingstatue37.ncs differ diff --git a/_module/ncs/lizardescapes.ncs b/_module/ncs/lizardescapes.ncs index e12098fa..e796a599 100644 Binary files a/_module/ncs/lizardescapes.ncs and b/_module/ncs/lizardescapes.ncs differ diff --git a/_module/ncs/lizardlevers.ncs b/_module/ncs/lizardlevers.ncs index 737fd6c5..c89a0c49 100644 Binary files a/_module/ncs/lizardlevers.ncs and b/_module/ncs/lizardlevers.ncs differ diff --git a/_module/ncs/lizardoortimer.ncs b/_module/ncs/lizardoortimer.ncs index c24fd742..74516d18 100644 Binary files a/_module/ncs/lizardoortimer.ncs and b/_module/ncs/lizardoortimer.ncs differ diff --git a/_module/ncs/lowkicheck.ncs b/_module/ncs/lowkicheck.ncs index 4411d5ed..cf8b2a8b 100644 Binary files a/_module/ncs/lowkicheck.ncs and b/_module/ncs/lowkicheck.ncs differ diff --git a/_module/ncs/mage_door_chk.ncs b/_module/ncs/mage_door_chk.ncs index bbcf9949..314b44bd 100644 Binary files a/_module/ncs/mage_door_chk.ncs and b/_module/ncs/mage_door_chk.ncs differ diff --git a/_module/ncs/mageonly.ncs b/_module/ncs/mageonly.ncs index 3ae5a92c..7e8cad3d 100644 Binary files a/_module/ncs/mageonly.ncs and b/_module/ncs/mageonly.ncs differ diff --git a/_module/ncs/mageonly2.ncs b/_module/ncs/mageonly2.ncs index f43bf25d..22e38169 100644 Binary files a/_module/ncs/mageonly2.ncs and b/_module/ncs/mageonly2.ncs differ diff --git a/_module/ncs/melody1.ncs b/_module/ncs/melody1.ncs index 8a32221a..c75987f5 100644 Binary files a/_module/ncs/melody1.ncs and b/_module/ncs/melody1.ncs differ diff --git a/_module/ncs/melody2.ncs b/_module/ncs/melody2.ncs index 83d2acf0..6b036faf 100644 Binary files a/_module/ncs/melody2.ncs and b/_module/ncs/melody2.ncs differ diff --git a/_module/ncs/membercheck1.ncs b/_module/ncs/membercheck1.ncs index 1f15c596..6e2865e7 100644 Binary files a/_module/ncs/membercheck1.ncs and b/_module/ncs/membercheck1.ncs differ diff --git a/_module/ncs/membercheck2.ncs b/_module/ncs/membercheck2.ncs index 8b9efd11..5e7aaf2e 100644 Binary files a/_module/ncs/membercheck2.ncs and b/_module/ncs/membercheck2.ncs differ diff --git a/_module/ncs/membercheck3.ncs b/_module/ncs/membercheck3.ncs index b12c79cc..aac3561a 100644 Binary files a/_module/ncs/membercheck3.ncs and b/_module/ncs/membercheck3.ncs differ diff --git a/_module/ncs/membercheck4.ncs b/_module/ncs/membercheck4.ncs index 8b9efd11..5e7aaf2e 100644 Binary files a/_module/ncs/membercheck4.ncs and b/_module/ncs/membercheck4.ncs differ diff --git a/_module/ncs/membersonly.ncs b/_module/ncs/membersonly.ncs index dc7bd890..1c5de68c 100644 Binary files a/_module/ncs/membersonly.ncs and b/_module/ncs/membersonly.ncs differ diff --git a/_module/ncs/membersonly2.ncs b/_module/ncs/membersonly2.ncs index 28dc1786..2c72df1f 100644 Binary files a/_module/ncs/membersonly2.ncs and b/_module/ncs/membersonly2.ncs differ diff --git a/_module/ncs/meremtalks.ncs b/_module/ncs/meremtalks.ncs index a8147563..e5ecedba 100644 Binary files a/_module/ncs/meremtalks.ncs and b/_module/ncs/meremtalks.ncs differ diff --git a/_module/ncs/mindfogdammaged.ncs b/_module/ncs/mindfogdammaged.ncs index c78f9f8f..1f9797ae 100644 Binary files a/_module/ncs/mindfogdammaged.ncs and b/_module/ncs/mindfogdammaged.ncs differ diff --git a/_module/ncs/mindheartbeat.ncs b/_module/ncs/mindheartbeat.ncs index ec38e37a..6af3e4a5 100644 Binary files a/_module/ncs/mindheartbeat.ncs and b/_module/ncs/mindheartbeat.ncs differ diff --git a/_module/ncs/mindoor.ncs b/_module/ncs/mindoor.ncs index 4ccfaab5..91495876 100644 Binary files a/_module/ncs/mindoor.ncs and b/_module/ncs/mindoor.ncs differ diff --git a/_module/ncs/minlever_use1.ncs b/_module/ncs/minlever_use1.ncs index 73f6983f..54dbb6b4 100644 Binary files a/_module/ncs/minlever_use1.ncs and b/_module/ncs/minlever_use1.ncs differ diff --git a/_module/ncs/minlever_use2.ncs b/_module/ncs/minlever_use2.ncs index decddbad..494ccb31 100644 Binary files a/_module/ncs/minlever_use2.ncs and b/_module/ncs/minlever_use2.ncs differ diff --git a/_module/ncs/minlever_use3.ncs b/_module/ncs/minlever_use3.ncs index 3c489696..9203f644 100644 Binary files a/_module/ncs/minlever_use3.ncs and b/_module/ncs/minlever_use3.ncs differ diff --git a/_module/ncs/minlever_use4.ncs b/_module/ncs/minlever_use4.ncs index 05d9e31b..607a47e3 100644 Binary files a/_module/ncs/minlever_use4.ncs and b/_module/ncs/minlever_use4.ncs differ diff --git a/_module/ncs/minlever_use5.ncs b/_module/ncs/minlever_use5.ncs index 1c073f7b..da78e662 100644 Binary files a/_module/ncs/minlever_use5.ncs and b/_module/ncs/minlever_use5.ncs differ diff --git a/_module/ncs/minlever_use6.ncs b/_module/ncs/minlever_use6.ncs index 1de7b6f3..b5c5e387 100644 Binary files a/_module/ncs/minlever_use6.ncs and b/_module/ncs/minlever_use6.ncs differ diff --git a/_module/ncs/minotaurpercive.ncs b/_module/ncs/minotaurpercive.ncs index 379c2d3b..8b0e1785 100644 Binary files a/_module/ncs/minotaurpercive.ncs and b/_module/ncs/minotaurpercive.ncs differ diff --git a/_module/ncs/moad_spawn.ncs b/_module/ncs/moad_spawn.ncs index f6dcbb7e..174662d7 100644 Binary files a/_module/ncs/moad_spawn.ncs and b/_module/ncs/moad_spawn.ncs differ diff --git a/_module/ncs/moadstop.ncs b/_module/ncs/moadstop.ncs index d47793dd..4822063c 100644 Binary files a/_module/ncs/moadstop.ncs and b/_module/ncs/moadstop.ncs differ diff --git a/_module/ncs/mod_ondeath.ncs b/_module/ncs/mod_ondeath.ncs index bc4e0471..4e5e07d4 100644 Binary files a/_module/ncs/mod_ondeath.ncs and b/_module/ncs/mod_ondeath.ncs differ diff --git a/_module/ncs/modspawn.ncs b/_module/ncs/modspawn.ncs index 59332503..ef95f732 100644 Binary files a/_module/ncs/modspawn.ncs and b/_module/ncs/modspawn.ncs differ diff --git a/_module/ncs/motherdoor12.ncs b/_module/ncs/motherdoor12.ncs index 0cf4048f..f81a32a4 100644 Binary files a/_module/ncs/motherdoor12.ncs and b/_module/ncs/motherdoor12.ncs differ diff --git a/_module/ncs/motherender.ncs b/_module/ncs/motherender.ncs index 3877f89b..19d7835a 100644 Binary files a/_module/ncs/motherender.ncs and b/_module/ncs/motherender.ncs differ diff --git a/_module/ncs/motherlever.ncs b/_module/ncs/motherlever.ncs index 881d8c2a..c672889f 100644 Binary files a/_module/ncs/motherlever.ncs and b/_module/ncs/motherlever.ncs differ diff --git a/_module/ncs/myhook.ncs b/_module/ncs/myhook.ncs index 629c9415..1c2b7b60 100644 Binary files a/_module/ncs/myhook.ncs and b/_module/ncs/myhook.ncs differ diff --git a/_module/ncs/netherdoor.ncs b/_module/ncs/netherdoor.ncs index c6bd7e71..5ca73d43 100644 Binary files a/_module/ncs/netherdoor.ncs and b/_module/ncs/netherdoor.ncs differ diff --git a/_module/ncs/newchest.ncs b/_module/ncs/newchest.ncs index 4e2233c6..3bbb15c7 100644 Binary files a/_module/ncs/newchest.ncs and b/_module/ncs/newchest.ncs differ diff --git a/_module/ncs/nightfogdammaged.ncs b/_module/ncs/nightfogdammaged.ncs index 3407f5a9..fe073a7f 100644 Binary files a/_module/ncs/nightfogdammaged.ncs and b/_module/ncs/nightfogdammaged.ncs differ diff --git a/_module/ncs/nightheartbeat.ncs b/_module/ncs/nightheartbeat.ncs index e2c23e95..d42bcedc 100644 Binary files a/_module/ncs/nightheartbeat.ncs and b/_module/ncs/nightheartbeat.ncs differ diff --git a/_module/ncs/no_ai_atk.ncs b/_module/ncs/no_ai_atk.ncs index 2a4d1861..39009bef 100644 Binary files a/_module/ncs/no_ai_atk.ncs and b/_module/ncs/no_ai_atk.ncs differ diff --git a/_module/ncs/no_ai_cmb.ncs b/_module/ncs/no_ai_cmb.ncs index 7bc5cb9f..2d90e625 100644 Binary files a/_module/ncs/no_ai_cmb.ncs and b/_module/ncs/no_ai_cmb.ncs differ diff --git a/_module/ncs/no_ai_cnv.ncs b/_module/ncs/no_ai_cnv.ncs index fb29696f..987e20a9 100644 Binary files a/_module/ncs/no_ai_cnv.ncs and b/_module/ncs/no_ai_cnv.ncs differ diff --git a/_module/ncs/no_ai_dam.ncs b/_module/ncs/no_ai_dam.ncs index c8a44531..ea27ed71 100644 Binary files a/_module/ncs/no_ai_dam.ncs and b/_module/ncs/no_ai_dam.ncs differ diff --git a/_module/ncs/no_ai_dis.ncs b/_module/ncs/no_ai_dis.ncs index dd670450..be1715b9 100644 Binary files a/_module/ncs/no_ai_dis.ncs and b/_module/ncs/no_ai_dis.ncs differ diff --git a/_module/ncs/no_ai_dth.ncs b/_module/ncs/no_ai_dth.ncs index 9c1b7a5e..098ce1ef 100644 Binary files a/_module/ncs/no_ai_dth.ncs and b/_module/ncs/no_ai_dth.ncs differ diff --git a/_module/ncs/no_ai_hrt.ncs b/_module/ncs/no_ai_hrt.ncs index 2323d52c..4879fb56 100644 Binary files a/_module/ncs/no_ai_hrt.ncs and b/_module/ncs/no_ai_hrt.ncs differ diff --git a/_module/ncs/no_ai_per.ncs b/_module/ncs/no_ai_per.ncs index 3c7645cd..350549e0 100644 Binary files a/_module/ncs/no_ai_per.ncs and b/_module/ncs/no_ai_per.ncs differ diff --git a/_module/ncs/no_ai_spt.ncs b/_module/ncs/no_ai_spt.ncs index 5b286d46..d49f80bd 100644 Binary files a/_module/ncs/no_ai_spt.ncs and b/_module/ncs/no_ai_spt.ncs differ diff --git a/_module/ncs/no_scr_excorpse.ncs b/_module/ncs/no_scr_excorpse.ncs index dad7af59..ccc1402c 100644 Binary files a/_module/ncs/no_scr_excorpse.ncs and b/_module/ncs/no_scr_excorpse.ncs differ diff --git a/_module/ncs/no_scr_shutdown.ncs b/_module/ncs/no_scr_shutdown.ncs index 2b0833ef..1e52bad8 100644 Binary files a/_module/ncs/no_scr_shutdown.ncs and b/_module/ncs/no_scr_shutdown.ncs differ diff --git a/_module/ncs/no_spn_a_buff.ncs b/_module/ncs/no_spn_a_buff.ncs index 9a6451f4..dca5825f 100644 Binary files a/_module/ncs/no_spn_a_buff.ncs and b/_module/ncs/no_spn_a_buff.ncs differ diff --git a/_module/ncs/no_spn_animalist.ncs b/_module/ncs/no_spn_animalist.ncs index ad51a5fa..3cc7bd71 100644 Binary files a/_module/ncs/no_spn_animalist.ncs and b/_module/ncs/no_spn_animalist.ncs differ diff --git a/_module/ncs/no_spn_aoemage.ncs b/_module/ncs/no_spn_aoemage.ncs index 55c47d65..39b554c4 100644 Binary files a/_module/ncs/no_spn_aoemage.ncs and b/_module/ncs/no_spn_aoemage.ncs differ diff --git a/_module/ncs/no_spn_b_knight.ncs b/_module/ncs/no_spn_b_knight.ncs index 7735508f..8ca22647 100644 Binary files a/_module/ncs/no_spn_b_knight.ncs and b/_module/ncs/no_spn_b_knight.ncs differ diff --git a/_module/ncs/no_spn_barb.ncs b/_module/ncs/no_spn_barb.ncs index 0346b7c3..eac9cede 100644 Binary files a/_module/ncs/no_spn_barb.ncs and b/_module/ncs/no_spn_barb.ncs differ diff --git a/_module/ncs/no_spn_bard.ncs b/_module/ncs/no_spn_bard.ncs index 94134fcd..07507b0e 100644 Binary files a/_module/ncs/no_spn_bard.ncs and b/_module/ncs/no_spn_bard.ncs differ diff --git a/_module/ncs/no_spn_bard2.ncs b/_module/ncs/no_spn_bard2.ncs index dd6bda32..c797b143 100644 Binary files a/_module/ncs/no_spn_bard2.ncs and b/_module/ncs/no_spn_bard2.ncs differ diff --git a/_module/ncs/no_spn_beh.ncs b/_module/ncs/no_spn_beh.ncs index 3f8155ca..16e65df9 100644 Binary files a/_module/ncs/no_spn_beh.ncs and b/_module/ncs/no_spn_beh.ncs differ diff --git a/_module/ncs/no_spn_blank.ncs b/_module/ncs/no_spn_blank.ncs index 592086c9..a0d30e8c 100644 Binary files a/_module/ncs/no_spn_blank.ncs and b/_module/ncs/no_spn_blank.ncs differ diff --git a/_module/ncs/no_spn_bow.ncs b/_module/ncs/no_spn_bow.ncs index 3c885b9c..da3cc242 100644 Binary files a/_module/ncs/no_spn_bow.ncs and b/_module/ncs/no_spn_bow.ncs differ diff --git a/_module/ncs/no_spn_cleric.ncs b/_module/ncs/no_spn_cleric.ncs index a9728221..8d745dc5 100644 Binary files a/_module/ncs/no_spn_cleric.ncs and b/_module/ncs/no_spn_cleric.ncs differ diff --git a/_module/ncs/no_spn_clr.ncs b/_module/ncs/no_spn_clr.ncs index 17ec8d13..c03b7638 100644 Binary files a/_module/ncs/no_spn_clr.ncs and b/_module/ncs/no_spn_clr.ncs differ diff --git a/_module/ncs/no_spn_conqr.ncs b/_module/ncs/no_spn_conqr.ncs index 40a09e1f..43e0720c 100644 Binary files a/_module/ncs/no_spn_conqr.ncs and b/_module/ncs/no_spn_conqr.ncs differ diff --git a/_module/ncs/no_spn_dcaller.ncs b/_module/ncs/no_spn_dcaller.ncs index 86d650ad..76d9ed01 100644 Binary files a/_module/ncs/no_spn_dcaller.ncs and b/_module/ncs/no_spn_dcaller.ncs differ diff --git a/_module/ncs/no_spn_dgoon.ncs b/_module/ncs/no_spn_dgoon.ncs index b3b3a0fd..13409e76 100644 Binary files a/_module/ncs/no_spn_dgoon.ncs and b/_module/ncs/no_spn_dgoon.ncs differ diff --git a/_module/ncs/no_spn_dia_golem.ncs b/_module/ncs/no_spn_dia_golem.ncs index 0ac6a358..fd77e821 100644 Binary files a/_module/ncs/no_spn_dia_golem.ncs and b/_module/ncs/no_spn_dia_golem.ncs differ diff --git a/_module/ncs/no_spn_dpally.ncs b/_module/ncs/no_spn_dpally.ncs index 7de8d368..197dfdf7 100644 Binary files a/_module/ncs/no_spn_dpally.ncs and b/_module/ncs/no_spn_dpally.ncs differ diff --git a/_module/ncs/no_spn_dragon.ncs b/_module/ncs/no_spn_dragon.ncs index f12afc5d..decfecae 100644 Binary files a/_module/ncs/no_spn_dragon.ncs and b/_module/ncs/no_spn_dragon.ncs differ diff --git a/_module/ncs/no_spn_druid.ncs b/_module/ncs/no_spn_druid.ncs index f5a9b12d..46c00625 100644 Binary files a/_module/ncs/no_spn_druid.ncs and b/_module/ncs/no_spn_druid.ncs differ diff --git a/_module/ncs/no_spn_druid2.ncs b/_module/ncs/no_spn_druid2.ncs index 5fbec959..48ffd1ed 100644 Binary files a/_module/ncs/no_spn_druid2.ncs and b/_module/ncs/no_spn_druid2.ncs differ diff --git a/_module/ncs/no_spn_en4cast1.ncs b/_module/ncs/no_spn_en4cast1.ncs index eb53a2e2..eb68ae3d 100644 Binary files a/_module/ncs/no_spn_en4cast1.ncs and b/_module/ncs/no_spn_en4cast1.ncs differ diff --git a/_module/ncs/no_spn_en4rog.ncs b/_module/ncs/no_spn_en4rog.ncs index c9126be8..1457222b 100644 Binary files a/_module/ncs/no_spn_en4rog.ncs and b/_module/ncs/no_spn_en4rog.ncs differ diff --git a/_module/ncs/no_spn_en4wiz1.ncs b/_module/ncs/no_spn_en4wiz1.ncs index 46baeef5..b2e32437 100644 Binary files a/_module/ncs/no_spn_en4wiz1.ncs and b/_module/ncs/no_spn_en4wiz1.ncs differ diff --git a/_module/ncs/no_spn_fiend.ncs b/_module/ncs/no_spn_fiend.ncs index bb017cf4..2adea8c8 100644 Binary files a/_module/ncs/no_spn_fiend.ncs and b/_module/ncs/no_spn_fiend.ncs differ diff --git a/_module/ncs/no_spn_ftr.ncs b/_module/ncs/no_spn_ftr.ncs index 10a595c0..d1e0e445 100644 Binary files a/_module/ncs/no_spn_ftr.ncs and b/_module/ncs/no_spn_ftr.ncs differ diff --git a/_module/ncs/no_spn_heal.ncs b/_module/ncs/no_spn_heal.ncs index 57a23fce..7e81b432 100644 Binary files a/_module/ncs/no_spn_heal.ncs and b/_module/ncs/no_spn_heal.ncs differ diff --git a/_module/ncs/no_spn_healdruid.ncs b/_module/ncs/no_spn_healdruid.ncs index a45d0590..1be352e3 100644 Binary files a/_module/ncs/no_spn_healdruid.ncs and b/_module/ncs/no_spn_healdruid.ncs differ diff --git a/_module/ncs/no_spn_immortus.ncs b/_module/ncs/no_spn_immortus.ncs index 0b355ec0..49dbc2ed 100644 Binary files a/_module/ncs/no_spn_immortus.ncs and b/_module/ncs/no_spn_immortus.ncs differ diff --git a/_module/ncs/no_spn_infern.ncs b/_module/ncs/no_spn_infern.ncs index c5496624..d5e4d455 100644 Binary files a/_module/ncs/no_spn_infern.ncs and b/_module/ncs/no_spn_infern.ncs differ diff --git a/_module/ncs/no_spn_mage.ncs b/_module/ncs/no_spn_mage.ncs index f47215c9..28f20e8d 100644 Binary files a/_module/ncs/no_spn_mage.ncs and b/_module/ncs/no_spn_mage.ncs differ diff --git a/_module/ncs/no_spn_melcast1.ncs b/_module/ncs/no_spn_melcast1.ncs index aeb0453a..f81f240f 100644 Binary files a/_module/ncs/no_spn_melcast1.ncs and b/_module/ncs/no_spn_melcast1.ncs differ diff --git a/_module/ncs/no_spn_melcast2.ncs b/_module/ncs/no_spn_melcast2.ncs index 5c325aaf..18352ae1 100644 Binary files a/_module/ncs/no_spn_melcast2.ncs and b/_module/ncs/no_spn_melcast2.ncs differ diff --git a/_module/ncs/no_spn_melcast3.ncs b/_module/ncs/no_spn_melcast3.ncs index b5bb4f84..0a88f810 100644 Binary files a/_module/ncs/no_spn_melcast3.ncs and b/_module/ncs/no_spn_melcast3.ncs differ diff --git a/_module/ncs/no_spn_melenh.ncs b/_module/ncs/no_spn_melenh.ncs index 3c15354c..52792a7d 100644 Binary files a/_module/ncs/no_spn_melenh.ncs and b/_module/ncs/no_spn_melenh.ncs differ diff --git a/_module/ncs/no_spn_mino.ncs b/_module/ncs/no_spn_mino.ncs index c30d5ced..7c2397cf 100644 Binary files a/_module/ncs/no_spn_mino.ncs and b/_module/ncs/no_spn_mino.ncs differ diff --git a/_module/ncs/no_spn_mino_wiz.ncs b/_module/ncs/no_spn_mino_wiz.ncs index 88ddbf27..5a26a3e8 100644 Binary files a/_module/ncs/no_spn_mino_wiz.ncs and b/_module/ncs/no_spn_mino_wiz.ncs differ diff --git a/_module/ncs/no_spn_minsage.ncs b/_module/ncs/no_spn_minsage.ncs index e96fa8ed..a4db90a8 100644 Binary files a/_module/ncs/no_spn_minsage.ncs and b/_module/ncs/no_spn_minsage.ncs differ diff --git a/_module/ncs/no_spn_mummy.ncs b/_module/ncs/no_spn_mummy.ncs index d3aaba54..80ebb752 100644 Binary files a/_module/ncs/no_spn_mummy.ncs and b/_module/ncs/no_spn_mummy.ncs differ diff --git a/_module/ncs/no_spn_necr_boss.ncs b/_module/ncs/no_spn_necr_boss.ncs index 740edf81..5ff99e98 100644 Binary files a/_module/ncs/no_spn_necr_boss.ncs and b/_module/ncs/no_spn_necr_boss.ncs differ diff --git a/_module/ncs/no_spn_necro.ncs b/_module/ncs/no_spn_necro.ncs index b66bd19d..17d5e9d1 100644 Binary files a/_module/ncs/no_spn_necro.ncs and b/_module/ncs/no_spn_necro.ncs differ diff --git a/_module/ncs/no_spn_nmncr.ncs b/_module/ncs/no_spn_nmncr.ncs index c5ecf139..76ffea75 100644 Binary files a/_module/ncs/no_spn_nmncr.ncs and b/_module/ncs/no_spn_nmncr.ncs differ diff --git a/_module/ncs/no_spn_orc_mys.ncs b/_module/ncs/no_spn_orc_mys.ncs index db03a6de..e16b17d3 100644 Binary files a/_module/ncs/no_spn_orc_mys.ncs and b/_module/ncs/no_spn_orc_mys.ncs differ diff --git a/_module/ncs/no_spn_pally.ncs b/_module/ncs/no_spn_pally.ncs index fb1d3e01..5f7a3d24 100644 Binary files a/_module/ncs/no_spn_pally.ncs and b/_module/ncs/no_spn_pally.ncs differ diff --git a/_module/ncs/no_spn_pally2.ncs b/_module/ncs/no_spn_pally2.ncs index c5a81174..639ceb75 100644 Binary files a/_module/ncs/no_spn_pally2.ncs and b/_module/ncs/no_spn_pally2.ncs differ diff --git a/_module/ncs/no_spn_pkeeper.ncs b/_module/ncs/no_spn_pkeeper.ncs index 018d12c5..6afc48f3 100644 Binary files a/_module/ncs/no_spn_pkeeper.ncs and b/_module/ncs/no_spn_pkeeper.ncs differ diff --git a/_module/ncs/no_spn_poltgst.ncs b/_module/ncs/no_spn_poltgst.ncs index 8b50c9af..1160d323 100644 Binary files a/_module/ncs/no_spn_poltgst.ncs and b/_module/ncs/no_spn_poltgst.ncs differ diff --git a/_module/ncs/no_spn_pureheal.ncs b/_module/ncs/no_spn_pureheal.ncs index 5443f4c9..64eb4f4a 100644 Binary files a/_module/ncs/no_spn_pureheal.ncs and b/_module/ncs/no_spn_pureheal.ncs differ diff --git a/_module/ncs/no_spn_r_fig.ncs b/_module/ncs/no_spn_r_fig.ncs index 1b7f425d..eb229367 100644 Binary files a/_module/ncs/no_spn_r_fig.ncs and b/_module/ncs/no_spn_r_fig.ncs differ diff --git a/_module/ncs/no_spn_ranged.ncs b/_module/ncs/no_spn_ranged.ncs index 35effaa9..12c56778 100644 Binary files a/_module/ncs/no_spn_ranged.ncs and b/_module/ncs/no_spn_ranged.ncs differ diff --git a/_module/ncs/no_spn_rftr.ncs b/_module/ncs/no_spn_rftr.ncs index 10a595c0..d1e0e445 100644 Binary files a/_module/ncs/no_spn_rftr.ncs and b/_module/ncs/no_spn_rftr.ncs differ diff --git a/_module/ncs/no_spn_rftrcast1.ncs b/_module/ncs/no_spn_rftrcast1.ncs index fe3ef7bc..f74a2290 100644 Binary files a/_module/ncs/no_spn_rftrcast1.ncs and b/_module/ncs/no_spn_rftrcast1.ncs differ diff --git a/_module/ncs/no_spn_rngcast3.ncs b/_module/ncs/no_spn_rngcast3.ncs index 694ee961..ad8b2819 100644 Binary files a/_module/ncs/no_spn_rngcast3.ncs and b/_module/ncs/no_spn_rngcast3.ncs differ diff --git a/_module/ncs/no_spn_rog.ncs b/_module/ncs/no_spn_rog.ncs index f76709e9..e52382f3 100644 Binary files a/_module/ncs/no_spn_rog.ncs and b/_module/ncs/no_spn_rog.ncs differ diff --git a/_module/ncs/no_spn_rogcast1.ncs b/_module/ncs/no_spn_rogcast1.ncs index 09eb89d6..baa1f028 100644 Binary files a/_module/ncs/no_spn_rogcast1.ncs and b/_module/ncs/no_spn_rogcast1.ncs differ diff --git a/_module/ncs/no_spn_rogcast3.ncs b/_module/ncs/no_spn_rogcast3.ncs index 9a6c9457..67be51cc 100644 Binary files a/_module/ncs/no_spn_rogcast3.ncs and b/_module/ncs/no_spn_rogcast3.ncs differ diff --git a/_module/ncs/no_spn_rogenh.ncs b/_module/ncs/no_spn_rogenh.ncs index f92c1af4..bb283bff 100644 Binary files a/_module/ncs/no_spn_rogenh.ncs and b/_module/ncs/no_spn_rogenh.ncs differ diff --git a/_module/ncs/no_spn_rogtel.ncs b/_module/ncs/no_spn_rogtel.ncs index a28aa1ee..f179dfd0 100644 Binary files a/_module/ncs/no_spn_rogtel.ncs and b/_module/ncs/no_spn_rogtel.ncs differ diff --git a/_module/ncs/no_spn_s_knight.ncs b/_module/ncs/no_spn_s_knight.ncs index c5dcb3d0..6616d70b 100644 Binary files a/_module/ncs/no_spn_s_knight.ncs and b/_module/ncs/no_spn_s_knight.ncs differ diff --git a/_module/ncs/no_spn_satdruid.ncs b/_module/ncs/no_spn_satdruid.ncs index 25428a5e..0b94dccf 100644 Binary files a/_module/ncs/no_spn_satdruid.ncs and b/_module/ncs/no_spn_satdruid.ncs differ diff --git a/_module/ncs/no_spn_satyrbard.ncs b/_module/ncs/no_spn_satyrbard.ncs index b324c275..981dbf0a 100644 Binary files a/_module/ncs/no_spn_satyrbard.ncs and b/_module/ncs/no_spn_satyrbard.ncs differ diff --git a/_module/ncs/no_spn_sbss.ncs b/_module/ncs/no_spn_sbss.ncs index 5cb82ff6..5e8b1480 100644 Binary files a/_module/ncs/no_spn_sbss.ncs and b/_module/ncs/no_spn_sbss.ncs differ diff --git a/_module/ncs/no_spn_sham.ncs b/_module/ncs/no_spn_sham.ncs index bb994791..a4852441 100644 Binary files a/_module/ncs/no_spn_sham.ncs and b/_module/ncs/no_spn_sham.ncs differ diff --git a/_module/ncs/no_spn_singer.ncs b/_module/ncs/no_spn_singer.ncs index 94030f90..87fdf507 100644 Binary files a/_module/ncs/no_spn_singer.ncs and b/_module/ncs/no_spn_singer.ncs differ diff --git a/_module/ncs/no_spn_sneaker.ncs b/_module/ncs/no_spn_sneaker.ncs index 23f14c6e..0eb04383 100644 Binary files a/_module/ncs/no_spn_sneaker.ncs and b/_module/ncs/no_spn_sneaker.ncs differ diff --git a/_module/ncs/no_spn_sneaker2.ncs b/_module/ncs/no_spn_sneaker2.ncs index 2aa25189..18cc7db6 100644 Binary files a/_module/ncs/no_spn_sneaker2.ncs and b/_module/ncs/no_spn_sneaker2.ncs differ diff --git a/_module/ncs/no_spn_sneakrog.ncs b/_module/ncs/no_spn_sneakrog.ncs index a8df5bbd..a1443475 100644 Binary files a/_module/ncs/no_spn_sneakrog.ncs and b/_module/ncs/no_spn_sneakrog.ncs differ diff --git a/_module/ncs/no_spn_sorc.ncs b/_module/ncs/no_spn_sorc.ncs index afbab5ea..1b790a8b 100644 Binary files a/_module/ncs/no_spn_sorc.ncs and b/_module/ncs/no_spn_sorc.ncs differ diff --git a/_module/ncs/no_spn_summ.ncs b/_module/ncs/no_spn_summ.ncs index 556c28d3..816b0f66 100644 Binary files a/_module/ncs/no_spn_summ.ncs and b/_module/ncs/no_spn_summ.ncs differ diff --git a/_module/ncs/no_spn_tank.ncs b/_module/ncs/no_spn_tank.ncs index 7ec5333d..9d8fc566 100644 Binary files a/_module/ncs/no_spn_tank.ncs and b/_module/ncs/no_spn_tank.ncs differ diff --git a/_module/ncs/no_spn_warrior.ncs b/_module/ncs/no_spn_warrior.ncs index 38538943..7ae9441d 100644 Binary files a/_module/ncs/no_spn_warrior.ncs and b/_module/ncs/no_spn_warrior.ncs differ diff --git a/_module/ncs/no_spn_warrior_b.ncs b/_module/ncs/no_spn_warrior_b.ncs index 231a9323..ad10d330 100644 Binary files a/_module/ncs/no_spn_warrior_b.ncs and b/_module/ncs/no_spn_warrior_b.ncs differ diff --git a/_module/ncs/no_spn_warrior_c.ncs b/_module/ncs/no_spn_warrior_c.ncs index 34292240..2d035f7d 100644 Binary files a/_module/ncs/no_spn_warrior_c.ncs and b/_module/ncs/no_spn_warrior_c.ncs differ diff --git a/_module/ncs/no_spn_wiz.ncs b/_module/ncs/no_spn_wiz.ncs index ece7ba6d..7f34d0d3 100644 Binary files a/_module/ncs/no_spn_wiz.ncs and b/_module/ncs/no_spn_wiz.ncs differ diff --git a/_module/ncs/no_spn_wiz2.ncs b/_module/ncs/no_spn_wiz2.ncs index 2dcbbcbc..e7302b7e 100644 Binary files a/_module/ncs/no_spn_wiz2.ncs and b/_module/ncs/no_spn_wiz2.ncs differ diff --git a/_module/ncs/no_spn_wraith.ncs b/_module/ncs/no_spn_wraith.ncs index a091e6d2..cb247e02 100644 Binary files a/_module/ncs/no_spn_wraith.ncs and b/_module/ncs/no_spn_wraith.ncs differ diff --git a/_module/ncs/nocastingnarea.ncs b/_module/ncs/nocastingnarea.ncs index cc25a78a..3b0a08e5 100644 Binary files a/_module/ncs/nocastingnarea.ncs and b/_module/ncs/nocastingnarea.ncs differ diff --git a/_module/ncs/nospells.ncs b/_module/ncs/nospells.ncs index a10b1408..1b4af607 100644 Binary files a/_module/ncs/nospells.ncs and b/_module/ncs/nospells.ncs differ diff --git a/_module/ncs/npcattack.ncs b/_module/ncs/npcattack.ncs index 67b4b6d4..f844acb9 100644 Binary files a/_module/ncs/npcattack.ncs and b/_module/ncs/npcattack.ncs differ diff --git a/_module/ncs/npcattackspc.ncs b/_module/ncs/npcattackspc.ncs index 84b16a17..241120a3 100644 Binary files a/_module/ncs/npcattackspc.ncs and b/_module/ncs/npcattackspc.ncs differ diff --git a/_module/ncs/npcspellattack.ncs b/_module/ncs/npcspellattack.ncs index 422cf97e..9f96a327 100644 Binary files a/_module/ncs/npcspellattack.ncs and b/_module/ncs/npcspellattack.ncs differ diff --git a/_module/ncs/nw_c2_default1.ncs b/_module/ncs/nw_c2_default1.ncs index 48cc32a3..56443589 100644 Binary files a/_module/ncs/nw_c2_default1.ncs and b/_module/ncs/nw_c2_default1.ncs differ diff --git a/_module/ncs/nw_c2_default2.ncs b/_module/ncs/nw_c2_default2.ncs index 343542d0..6589ff16 100644 Binary files a/_module/ncs/nw_c2_default2.ncs and b/_module/ncs/nw_c2_default2.ncs differ diff --git a/_module/ncs/nw_c2_default3.ncs b/_module/ncs/nw_c2_default3.ncs index 30c94d39..c54384cc 100644 Binary files a/_module/ncs/nw_c2_default3.ncs and b/_module/ncs/nw_c2_default3.ncs differ diff --git a/_module/ncs/nw_c2_default4.ncs b/_module/ncs/nw_c2_default4.ncs index 8de99316..51c4a503 100644 Binary files a/_module/ncs/nw_c2_default4.ncs and b/_module/ncs/nw_c2_default4.ncs differ diff --git a/_module/ncs/nw_c2_default5.ncs b/_module/ncs/nw_c2_default5.ncs index 82d1e9d4..fd6cf5ea 100644 Binary files a/_module/ncs/nw_c2_default5.ncs and b/_module/ncs/nw_c2_default5.ncs differ diff --git a/_module/ncs/nw_c2_default6.ncs b/_module/ncs/nw_c2_default6.ncs index 72ba74c5..1727698b 100644 Binary files a/_module/ncs/nw_c2_default6.ncs and b/_module/ncs/nw_c2_default6.ncs differ diff --git a/_module/ncs/nw_c2_default8.ncs b/_module/ncs/nw_c2_default8.ncs index d2e3160f..2df2091a 100644 Binary files a/_module/ncs/nw_c2_default8.ncs and b/_module/ncs/nw_c2_default8.ncs differ diff --git a/_module/ncs/nw_c2_defaultb.ncs b/_module/ncs/nw_c2_defaultb.ncs index e1c07979..146034f3 100644 Binary files a/_module/ncs/nw_c2_defaultb.ncs and b/_module/ncs/nw_c2_defaultb.ncs differ diff --git a/_module/ncs/nw_c2_dropin9.ncs b/_module/ncs/nw_c2_dropin9.ncs index 62570f3a..d5a4217f 100644 Binary files a/_module/ncs/nw_c2_dropin9.ncs and b/_module/ncs/nw_c2_dropin9.ncs differ diff --git a/_module/ncs/nw_o2_boss.ncs b/_module/ncs/nw_o2_boss.ncs index fb546e80..57cdce63 100644 Binary files a/_module/ncs/nw_o2_boss.ncs and b/_module/ncs/nw_o2_boss.ncs differ diff --git a/_module/ncs/nw_o2_classweap.ncs b/_module/ncs/nw_o2_classweap.ncs index f7d00fa6..354ca56c 100644 Binary files a/_module/ncs/nw_o2_classweap.ncs and b/_module/ncs/nw_o2_classweap.ncs differ diff --git a/_module/ncs/nw_o2_generalmed.ncs b/_module/ncs/nw_o2_generalmed.ncs index cc8bf8ec..169bf904 100644 Binary files a/_module/ncs/nw_o2_generalmed.ncs and b/_module/ncs/nw_o2_generalmed.ncs differ diff --git a/_module/ncs/nw_s3_balordeth.ncs b/_module/ncs/nw_s3_balordeth.ncs index fb6a3fe5..349a5978 100644 Binary files a/_module/ncs/nw_s3_balordeth.ncs and b/_module/ncs/nw_s3_balordeth.ncs differ diff --git a/_module/ncs/nw_t0_walk.ncs b/_module/ncs/nw_t0_walk.ncs index 08231bdc..29a8afbe 100644 Binary files a/_module/ncs/nw_t0_walk.ncs and b/_module/ncs/nw_t0_walk.ncs differ diff --git a/_module/ncs/nwnx_skillrank_t.ncs b/_module/ncs/nwnx_skillrank_t.ncs index 13ee5aa3..2fba1435 100644 Binary files a/_module/ncs/nwnx_skillrank_t.ncs and b/_module/ncs/nwnx_skillrank_t.ncs differ diff --git a/_module/ncs/nwnx_time_t.ncs b/_module/ncs/nwnx_time_t.ncs index 7e9d8eed..9ec84174 100644 Binary files a/_module/ncs/nwnx_time_t.ncs and b/_module/ncs/nwnx_time_t.ncs differ diff --git a/_module/ncs/nwnx_visibilit_t.ncs b/_module/ncs/nwnx_visibilit_t.ncs index 7f74b252..bfa2c9fb 100644 Binary files a/_module/ncs/nwnx_visibilit_t.ncs and b/_module/ncs/nwnx_visibilit_t.ncs differ diff --git a/_module/ncs/objectattack.ncs b/_module/ncs/objectattack.ncs index 77e17b88..e61373d7 100644 Binary files a/_module/ncs/objectattack.ncs and b/_module/ncs/objectattack.ncs differ diff --git a/_module/ncs/objectspellattak.ncs b/_module/ncs/objectspellattak.ncs index f08a5fbb..394d0177 100644 Binary files a/_module/ncs/objectspellattak.ncs and b/_module/ncs/objectspellattak.ncs differ diff --git a/_module/ncs/ogrelordpercieve.ncs b/_module/ncs/ogrelordpercieve.ncs index c0a3e18e..c37f49f5 100644 Binary files a/_module/ncs/ogrelordpercieve.ncs and b/_module/ncs/ogrelordpercieve.ncs differ diff --git a/_module/ncs/on_player_chat.ncs b/_module/ncs/on_player_chat.ncs index c14e9389..8cfb48f0 100644 Binary files a/_module/ncs/on_player_chat.ncs and b/_module/ncs/on_player_chat.ncs differ diff --git a/_module/ncs/on_pubsub.ncs b/_module/ncs/on_pubsub.ncs index 68c830ea..2860bccc 100644 Binary files a/_module/ncs/on_pubsub.ncs and b/_module/ncs/on_pubsub.ncs differ diff --git a/_module/ncs/onactivateitem.ncs b/_module/ncs/onactivateitem.ncs index 815d23cc..4c3fdf6c 100644 Binary files a/_module/ncs/onactivateitem.ncs and b/_module/ncs/onactivateitem.ncs differ diff --git a/_module/ncs/oncliententer.ncs b/_module/ncs/oncliententer.ncs index 0d76bb64..0e12322f 100644 Binary files a/_module/ncs/oncliententer.ncs and b/_module/ncs/oncliententer.ncs differ diff --git a/_module/ncs/onconv_rowan.ncs b/_module/ncs/onconv_rowan.ncs index 4581dd0d..06f8c50f 100644 Binary files a/_module/ncs/onconv_rowan.ncs and b/_module/ncs/onconv_rowan.ncs differ diff --git a/_module/ncs/onheartbeat.ncs b/_module/ncs/onheartbeat.ncs index 23d17443..7460f672 100644 Binary files a/_module/ncs/onheartbeat.ncs and b/_module/ncs/onheartbeat.ncs differ diff --git a/_module/ncs/onmoduleload.ncs b/_module/ncs/onmoduleload.ncs index 038dd625..c2715742 100644 Binary files a/_module/ncs/onmoduleload.ncs and b/_module/ncs/onmoduleload.ncs differ diff --git a/_module/ncs/onplayerdeath.ncs b/_module/ncs/onplayerdeath.ncs index b5da1e5c..41782968 100644 Binary files a/_module/ncs/onplayerdeath.ncs and b/_module/ncs/onplayerdeath.ncs differ diff --git a/_module/ncs/onplayerdying.ncs b/_module/ncs/onplayerdying.ncs index 39be9e2f..be621347 100644 Binary files a/_module/ncs/onplayerdying.ncs and b/_module/ncs/onplayerdying.ncs differ diff --git a/_module/ncs/onplayerlevelup.ncs b/_module/ncs/onplayerlevelup.ncs index 17105da7..a2cac303 100644 Binary files a/_module/ncs/onplayerlevelup.ncs and b/_module/ncs/onplayerlevelup.ncs differ diff --git a/_module/ncs/onplayerrespawn.ncs b/_module/ncs/onplayerrespawn.ncs index d0f9d4e6..0a1134fa 100644 Binary files a/_module/ncs/onplayerrespawn.ncs and b/_module/ncs/onplayerrespawn.ncs differ diff --git a/_module/ncs/onplayerrest.ncs b/_module/ncs/onplayerrest.ncs index 6694b0f3..9666f3e3 100644 Binary files a/_module/ncs/onplayerrest.ncs and b/_module/ncs/onplayerrest.ncs differ diff --git a/_module/ncs/onunequipitem.ncs b/_module/ncs/onunequipitem.ncs index a7d44897..607cbd68 100644 Binary files a/_module/ncs/onunequipitem.ncs and b/_module/ncs/onunequipitem.ncs differ diff --git a/_module/ncs/opensesame.ncs b/_module/ncs/opensesame.ncs index 2216d6a1..8042291c 100644 Binary files a/_module/ncs/opensesame.ncs and b/_module/ncs/opensesame.ncs differ diff --git a/_module/ncs/orcdoor.ncs b/_module/ncs/orcdoor.ncs index 0a27f961..f1c387be 100644 Binary files a/_module/ncs/orcdoor.ncs and b/_module/ncs/orcdoor.ncs differ diff --git a/_module/ncs/overrunner_hb.ncs b/_module/ncs/overrunner_hb.ncs index 52ba4ccd..0784ff8e 100644 Binary files a/_module/ncs/overrunner_hb.ncs and b/_module/ncs/overrunner_hb.ncs differ diff --git a/_module/ncs/overspawnmsg.ncs b/_module/ncs/overspawnmsg.ncs index 598c633d..acc82748 100644 Binary files a/_module/ncs/overspawnmsg.ncs and b/_module/ncs/overspawnmsg.ncs differ diff --git a/_module/ncs/pa_bossdrain.ncs b/_module/ncs/pa_bossdrain.ncs index 17d11ca6..97509df4 100644 Binary files a/_module/ncs/pa_bossdrain.ncs and b/_module/ncs/pa_bossdrain.ncs differ diff --git a/_module/ncs/pa_bossdrain2.ncs b/_module/ncs/pa_bossdrain2.ncs index 82d1e24f..74c192e5 100644 Binary files a/_module/ncs/pa_bossdrain2.ncs and b/_module/ncs/pa_bossdrain2.ncs differ diff --git a/_module/ncs/partyonly.ncs b/_module/ncs/partyonly.ncs index 1c55cb87..4356c099 100644 Binary files a/_module/ncs/partyonly.ncs and b/_module/ncs/partyonly.ncs differ diff --git a/_module/ncs/partyonly1.ncs b/_module/ncs/partyonly1.ncs index 13c18fce..ab928c04 100644 Binary files a/_module/ncs/partyonly1.ncs and b/_module/ncs/partyonly1.ncs differ diff --git a/_module/ncs/partyroomport1.ncs b/_module/ncs/partyroomport1.ncs index 344c433d..3efb9b84 100644 Binary files a/_module/ncs/partyroomport1.ncs and b/_module/ncs/partyroomport1.ncs differ diff --git a/_module/ncs/partyroomport2.ncs b/_module/ncs/partyroomport2.ncs index f3c978b3..6919c055 100644 Binary files a/_module/ncs/partyroomport2.ncs and b/_module/ncs/partyroomport2.ncs differ diff --git a/_module/ncs/pc_wand_rest_sys.ncs b/_module/ncs/pc_wand_rest_sys.ncs index ecdd3a1e..fd0ec458 100644 Binary files a/_module/ncs/pc_wand_rest_sys.ncs and b/_module/ncs/pc_wand_rest_sys.ncs differ diff --git a/_module/ncs/pcdeath.ncs b/_module/ncs/pcdeath.ncs index dc45dea3..45caa3bf 100644 Binary files a/_module/ncs/pcdeath.ncs and b/_module/ncs/pcdeath.ncs differ diff --git a/_module/ncs/pcdeathport.ncs b/_module/ncs/pcdeathport.ncs index 7cdc8e5b..f04d91f6 100644 Binary files a/_module/ncs/pcdeathport.ncs and b/_module/ncs/pcdeathport.ncs differ diff --git a/_module/ncs/plague_blight.ncs b/_module/ncs/plague_blight.ncs index 00116207..2bf99f9f 100644 Binary files a/_module/ncs/plague_blight.ncs and b/_module/ncs/plague_blight.ncs differ diff --git a/_module/ncs/plagueaura1.ncs b/_module/ncs/plagueaura1.ncs index 8c9713e4..635a2d14 100644 Binary files a/_module/ncs/plagueaura1.ncs and b/_module/ncs/plagueaura1.ncs differ diff --git a/_module/ncs/plagueaura2.ncs b/_module/ncs/plagueaura2.ncs index 6fbe4c0a..23b726d1 100644 Binary files a/_module/ncs/plagueaura2.ncs and b/_module/ncs/plagueaura2.ncs differ diff --git a/_module/ncs/plcused_portal.ncs b/_module/ncs/plcused_portal.ncs index a0f2309a..d4a5e4eb 100644 Binary files a/_module/ncs/plcused_portal.ncs and b/_module/ncs/plcused_portal.ncs differ diff --git a/_module/ncs/port2bermuda.ncs b/_module/ncs/port2bermuda.ncs index 25a3e9ca..b8b00c16 100644 Binary files a/_module/ncs/port2bermuda.ncs and b/_module/ncs/port2bermuda.ncs differ diff --git a/_module/ncs/port2guild1.ncs b/_module/ncs/port2guild1.ncs index 5141fd1a..69b54271 100644 Binary files a/_module/ncs/port2guild1.ncs and b/_module/ncs/port2guild1.ncs differ diff --git a/_module/ncs/port_pc_2_lokidg.ncs b/_module/ncs/port_pc_2_lokidg.ncs index 6cb8423b..31b3753e 100644 Binary files a/_module/ncs/port_pc_2_lokidg.ncs and b/_module/ncs/port_pc_2_lokidg.ncs differ diff --git a/_module/ncs/portguild2aduin.ncs b/_module/ncs/portguild2aduin.ncs index b7ad22bb..e95b39c3 100644 Binary files a/_module/ncs/portguild2aduin.ncs and b/_module/ncs/portguild2aduin.ncs differ diff --git a/_module/ncs/portguild2dracs.ncs b/_module/ncs/portguild2dracs.ncs index 19686944..ba9cbcc9 100644 Binary files a/_module/ncs/portguild2dracs.ncs and b/_module/ncs/portguild2dracs.ncs differ diff --git a/_module/ncs/portguild2mana.ncs b/_module/ncs/portguild2mana.ncs index eab84cbd..c0a2d435 100644 Binary files a/_module/ncs/portguild2mana.ncs and b/_module/ncs/portguild2mana.ncs differ diff --git a/_module/ncs/portguild2thief.ncs b/_module/ncs/portguild2thief.ncs index df135401..2883f5e8 100644 Binary files a/_module/ncs/portguild2thief.ncs and b/_module/ncs/portguild2thief.ncs differ diff --git a/_module/ncs/portguild2woods.ncs b/_module/ncs/portguild2woods.ncs index da00f1f9..5bda4963 100644 Binary files a/_module/ncs/portguild2woods.ncs and b/_module/ncs/portguild2woods.ncs differ diff --git a/_module/ncs/portguildhome.ncs b/_module/ncs/portguildhome.ncs index ec3d16e1..08491340 100644 Binary files a/_module/ncs/portguildhome.ncs and b/_module/ncs/portguildhome.ncs differ diff --git a/_module/ncs/portmemberout.ncs b/_module/ncs/portmemberout.ncs index 1df1b707..48c7fb6a 100644 Binary files a/_module/ncs/portmemberout.ncs and b/_module/ncs/portmemberout.ncs differ diff --git a/_module/ncs/portmemberout2.ncs b/_module/ncs/portmemberout2.ncs index a6d6e435..e659a0cc 100644 Binary files a/_module/ncs/portmemberout2.ncs and b/_module/ncs/portmemberout2.ncs differ diff --git a/_module/ncs/portpartyhome.ncs b/_module/ncs/portpartyhome.ncs index ee26222e..e09280cd 100644 Binary files a/_module/ncs/portpartyhome.ncs and b/_module/ncs/portpartyhome.ncs differ diff --git a/_module/ncs/portpc2guild.ncs b/_module/ncs/portpc2guild.ncs index 16bb9ea8..cf20f7d0 100644 Binary files a/_module/ncs/portpc2guild.ncs and b/_module/ncs/portpc2guild.ncs differ diff --git a/_module/ncs/portpctodeath.ncs b/_module/ncs/portpctodeath.ncs index 2091f31b..dfc1fa64 100644 Binary files a/_module/ncs/portpctodeath.ncs and b/_module/ncs/portpctodeath.ncs differ diff --git a/_module/ncs/prc_pwonspawn.ncs b/_module/ncs/prc_pwonspawn.ncs index 4f452035..122ccfd0 100644 Binary files a/_module/ncs/prc_pwonspawn.ncs and b/_module/ncs/prc_pwonspawn.ncs differ diff --git a/_module/ncs/pressureplate.ncs b/_module/ncs/pressureplate.ncs index 2084f811..7efbe2df 100644 Binary files a/_module/ncs/pressureplate.ncs and b/_module/ncs/pressureplate.ncs differ diff --git a/_module/ncs/prevappearance1.ncs b/_module/ncs/prevappearance1.ncs index 3bed1234..6f62202e 100644 Binary files a/_module/ncs/prevappearance1.ncs and b/_module/ncs/prevappearance1.ncs differ diff --git a/_module/ncs/prevappearance2.ncs b/_module/ncs/prevappearance2.ncs index 0b373916..8dee25bc 100644 Binary files a/_module/ncs/prevappearance2.ncs and b/_module/ncs/prevappearance2.ncs differ diff --git a/_module/ncs/punkrod.ncs b/_module/ncs/punkrod.ncs index 1790b599..93de4748 100644 Binary files a/_module/ncs/punkrod.ncs and b/_module/ncs/punkrod.ncs differ diff --git a/_module/ncs/puzzle4.ncs b/_module/ncs/puzzle4.ncs index dbbdfa7b..e60caa2d 100644 Binary files a/_module/ncs/puzzle4.ncs and b/_module/ncs/puzzle4.ncs differ diff --git a/_module/ncs/puzzlestart.ncs b/_module/ncs/puzzlestart.ncs index 72b3ab3d..c2aff195 100644 Binary files a/_module/ncs/puzzlestart.ncs and b/_module/ncs/puzzlestart.ncs differ diff --git a/_module/ncs/queendammaged.ncs b/_module/ncs/queendammaged.ncs index 4d9fda27..e80427bb 100644 Binary files a/_module/ncs/queendammaged.ncs and b/_module/ncs/queendammaged.ncs differ diff --git a/_module/ncs/queendeath2.ncs b/_module/ncs/queendeath2.ncs index d67f1e41..d65c48a7 100644 Binary files a/_module/ncs/queendeath2.ncs and b/_module/ncs/queendeath2.ncs differ diff --git a/_module/ncs/queendoor.ncs b/_module/ncs/queendoor.ncs index d3e436eb..56d58304 100644 Binary files a/_module/ncs/queendoor.ncs and b/_module/ncs/queendoor.ncs differ diff --git a/_module/ncs/queenpercieve.ncs b/_module/ncs/queenpercieve.ncs index 22f21b2c..39612de0 100644 Binary files a/_module/ncs/queenpercieve.ncs and b/_module/ncs/queenpercieve.ncs differ diff --git a/_module/ncs/queenrender.ncs b/_module/ncs/queenrender.ncs index 7a0b8cf5..dc94b9a9 100644 Binary files a/_module/ncs/queenrender.ncs and b/_module/ncs/queenrender.ncs differ diff --git a/_module/ncs/queentriggeer.ncs b/_module/ncs/queentriggeer.ncs index 64569ffb..d35a7e64 100644 Binary files a/_module/ncs/queentriggeer.ncs and b/_module/ncs/queentriggeer.ncs differ diff --git a/_module/ncs/quick_lock.ncs b/_module/ncs/quick_lock.ncs index 629aa532..7d971c5b 100644 Binary files a/_module/ncs/quick_lock.ncs and b/_module/ncs/quick_lock.ncs differ diff --git a/_module/ncs/quicklingheart.ncs b/_module/ncs/quicklingheart.ncs index ccc66889..d50b7187 100644 Binary files a/_module/ncs/quicklingheart.ncs and b/_module/ncs/quicklingheart.ncs differ diff --git a/_module/ncs/quicklingspawn.ncs b/_module/ncs/quicklingspawn.ncs index 3612584c..4e6623c0 100644 Binary files a/_module/ncs/quicklingspawn.ncs and b/_module/ncs/quicklingspawn.ncs differ diff --git a/_module/ncs/ra_close_door.ncs b/_module/ncs/ra_close_door.ncs index 1f194772..2876a3e5 100644 Binary files a/_module/ncs/ra_close_door.ncs and b/_module/ncs/ra_close_door.ncs differ diff --git a/_module/ncs/rak1.ncs b/_module/ncs/rak1.ncs index a7ee2209..96a84ad7 100644 Binary files a/_module/ncs/rak1.ncs and b/_module/ncs/rak1.ncs differ diff --git a/_module/ncs/rak2.ncs b/_module/ncs/rak2.ncs index 2146eab0..dbd97c8a 100644 Binary files a/_module/ncs/rak2.ncs and b/_module/ncs/rak2.ncs differ diff --git a/_module/ncs/rak3.ncs b/_module/ncs/rak3.ncs index 95e471ab..c9268983 100644 Binary files a/_module/ncs/rak3.ncs and b/_module/ncs/rak3.ncs differ diff --git a/_module/ncs/rakopen.ncs b/_module/ncs/rakopen.ncs index d86f617c..1006738b 100644 Binary files a/_module/ncs/rakopen.ncs and b/_module/ncs/rakopen.ncs differ diff --git a/_module/ncs/rakshashaloot.ncs b/_module/ncs/rakshashaloot.ncs index 72305ddc..efc6538c 100644 Binary files a/_module/ncs/rakshashaloot.ncs and b/_module/ncs/rakshashaloot.ncs differ diff --git a/_module/ncs/rakshashaunklo.ncs b/_module/ncs/rakshashaunklo.ncs index e20a749b..d9c72225 100644 Binary files a/_module/ncs/rakshashaunklo.ncs and b/_module/ncs/rakshashaunklo.ncs differ diff --git a/_module/ncs/re_common_blkd.ncs b/_module/ncs/re_common_blkd.ncs index b09179b0..db5dc4ce 100644 Binary files a/_module/ncs/re_common_blkd.ncs and b/_module/ncs/re_common_blkd.ncs differ diff --git a/_module/ncs/re_commonspwnrhb.ncs b/_module/ncs/re_commonspwnrhb.ncs index 3c30e263..be522607 100644 Binary files a/_module/ncs/re_commonspwnrhb.ncs and b/_module/ncs/re_commonspwnrhb.ncs differ diff --git a/_module/ncs/re_levspawnerhb.ncs b/_module/ncs/re_levspawnerhb.ncs index 2be39799..caf7316f 100644 Binary files a/_module/ncs/re_levspawnerhb.ncs and b/_module/ncs/re_levspawnerhb.ncs differ diff --git a/_module/ncs/re_mmorpghb.ncs b/_module/ncs/re_mmorpghb.ncs index 072f0a65..72afb909 100644 Binary files a/_module/ncs/re_mmorpghb.ncs and b/_module/ncs/re_mmorpghb.ncs differ diff --git a/_module/ncs/re_onrest.ncs b/_module/ncs/re_onrest.ncs index 8512f3be..5e597e41 100644 Binary files a/_module/ncs/re_onrest.ncs and b/_module/ncs/re_onrest.ncs differ diff --git a/_module/ncs/re_or.ncs b/_module/ncs/re_or.ncs index 4072f43c..edb50520 100644 Binary files a/_module/ncs/re_or.ncs and b/_module/ncs/re_or.ncs differ diff --git a/_module/ncs/re_pwrespawnerhb.ncs b/_module/ncs/re_pwrespawnerhb.ncs index 5739d974..bd55c0f3 100644 Binary files a/_module/ncs/re_pwrespawnerhb.ncs and b/_module/ncs/re_pwrespawnerhb.ncs differ diff --git a/_module/ncs/re_spawnerhb.ncs b/_module/ncs/re_spawnerhb.ncs index 4d1263e5..9a58186d 100644 Binary files a/_module/ncs/re_spawnerhb.ncs and b/_module/ncs/re_spawnerhb.ncs differ diff --git a/_module/ncs/re_spawnerhb_v2.ncs b/_module/ncs/re_spawnerhb_v2.ncs index f61fcc64..4360d346 100644 Binary files a/_module/ncs/re_spawnerhb_v2.ncs and b/_module/ncs/re_spawnerhb_v2.ncs differ diff --git a/_module/ncs/re_widget20.ncs b/_module/ncs/re_widget20.ncs index 166d7317..bb6773ff 100644 Binary files a/_module/ncs/re_widget20.ncs and b/_module/ncs/re_widget20.ncs differ diff --git a/_module/ncs/re_widget8.ncs b/_module/ncs/re_widget8.ncs index 30eb278b..ebeea52e 100644 Binary files a/_module/ncs/re_widget8.ncs and b/_module/ncs/re_widget8.ncs differ diff --git a/_module/ncs/rejump.ncs b/_module/ncs/rejump.ncs index 33752759..06ac416d 100644 Binary files a/_module/ncs/rejump.ncs and b/_module/ncs/rejump.ncs differ diff --git a/_module/ncs/renderdammaged.ncs b/_module/ncs/renderdammaged.ncs index f1240199..c33f471c 100644 Binary files a/_module/ncs/renderdammaged.ncs and b/_module/ncs/renderdammaged.ncs differ diff --git a/_module/ncs/renderpercieve.ncs b/_module/ncs/renderpercieve.ncs index b71dc138..a9795547 100644 Binary files a/_module/ncs/renderpercieve.ncs and b/_module/ncs/renderpercieve.ncs differ diff --git a/_module/ncs/respawnchest16.ncs b/_module/ncs/respawnchest16.ncs index 16321a5c..8b75470f 100644 Binary files a/_module/ncs/respawnchest16.ncs and b/_module/ncs/respawnchest16.ncs differ diff --git a/_module/ncs/respawnchest45.ncs b/_module/ncs/respawnchest45.ncs index 5fac2b1d..f87a3824 100644 Binary files a/_module/ncs/respawnchest45.ncs and b/_module/ncs/respawnchest45.ncs differ diff --git a/_module/ncs/respawnchest46.ncs b/_module/ncs/respawnchest46.ncs index ee32ae91..399c10cd 100644 Binary files a/_module/ncs/respawnchest46.ncs and b/_module/ncs/respawnchest46.ncs differ diff --git a/_module/ncs/respawnself.ncs b/_module/ncs/respawnself.ncs index f78c613d..943f36b5 100644 Binary files a/_module/ncs/respawnself.ncs and b/_module/ncs/respawnself.ncs differ diff --git a/_module/ncs/respawnthrone.ncs b/_module/ncs/respawnthrone.ncs index 54caa550..50fe57db 100644 Binary files a/_module/ncs/respawnthrone.ncs and b/_module/ncs/respawnthrone.ncs differ diff --git a/_module/ncs/reward_unlocker.ncs b/_module/ncs/reward_unlocker.ncs index b6c99bec..8a1c6237 100644 Binary files a/_module/ncs/reward_unlocker.ncs and b/_module/ncs/reward_unlocker.ncs differ diff --git a/_module/ncs/rhazhidpercieve.ncs b/_module/ncs/rhazhidpercieve.ncs index a38f1ccf..e6490d5d 100644 Binary files a/_module/ncs/rhazhidpercieve.ncs and b/_module/ncs/rhazhidpercieve.ncs differ diff --git a/_module/ncs/rhazhidspawn2.ncs b/_module/ncs/rhazhidspawn2.ncs index 66522352..ea2b7956 100644 Binary files a/_module/ncs/rhazhidspawn2.ncs and b/_module/ncs/rhazhidspawn2.ncs differ diff --git a/_module/ncs/roguecheck.ncs b/_module/ncs/roguecheck.ncs index 02d7ad74..bc9792ed 100644 Binary files a/_module/ncs/roguecheck.ncs and b/_module/ncs/roguecheck.ncs differ diff --git a/_module/ncs/roguespawn.ncs b/_module/ncs/roguespawn.ncs index 2ed1c8de..b056629a 100644 Binary files a/_module/ncs/roguespawn.ncs and b/_module/ncs/roguespawn.ncs differ diff --git a/_module/ncs/rotaura1.ncs b/_module/ncs/rotaura1.ncs index b09809b3..ef5efa0d 100644 Binary files a/_module/ncs/rotaura1.ncs and b/_module/ncs/rotaura1.ncs differ diff --git a/_module/ncs/rotaura3.ncs b/_module/ncs/rotaura3.ncs index dcd2157b..123bff98 100644 Binary files a/_module/ncs/rotaura3.ncs and b/_module/ncs/rotaura3.ncs differ diff --git a/_module/ncs/rowanbeat.ncs b/_module/ncs/rowanbeat.ncs index 1c4628f4..6eec0754 100644 Binary files a/_module/ncs/rowanbeat.ncs and b/_module/ncs/rowanbeat.ncs differ diff --git a/_module/ncs/royalroguesecret.ncs b/_module/ncs/royalroguesecret.ncs index 619e9f21..e10a4ae3 100644 Binary files a/_module/ncs/royalroguesecret.ncs and b/_module/ncs/royalroguesecret.ncs differ diff --git a/_module/ncs/sagesecret.ncs b/_module/ncs/sagesecret.ncs index f9e0b677..87cb4106 100644 Binary files a/_module/ncs/sagesecret.ncs and b/_module/ncs/sagesecret.ncs differ diff --git a/_module/ncs/satanbeat.ncs b/_module/ncs/satanbeat.ncs index 61ce0544..8bd597de 100644 Binary files a/_module/ncs/satanbeat.ncs and b/_module/ncs/satanbeat.ncs differ diff --git a/_module/ncs/scanswitch.ncs b/_module/ncs/scanswitch.ncs index 90c2b2d6..9ee4dae4 100644 Binary files a/_module/ncs/scanswitch.ncs and b/_module/ncs/scanswitch.ncs differ diff --git a/_module/ncs/sd_area_purge.ncs b/_module/ncs/sd_area_purge.ncs index 7f5e497b..25d0357e 100644 Binary files a/_module/ncs/sd_area_purge.ncs and b/_module/ncs/sd_area_purge.ncs differ diff --git a/_module/ncs/sd_chest_loot.ncs b/_module/ncs/sd_chest_loot.ncs index a6b84590..29c5c8dc 100644 Binary files a/_module/ncs/sd_chest_loot.ncs and b/_module/ncs/sd_chest_loot.ncs differ diff --git a/_module/ncs/sd_destroy_lbag.ncs b/_module/ncs/sd_destroy_lbag.ncs index 17fa791b..360cf451 100644 Binary files a/_module/ncs/sd_destroy_lbag.ncs and b/_module/ncs/sd_destroy_lbag.ncs differ diff --git a/_module/ncs/sd_loot_corpse.ncs b/_module/ncs/sd_loot_corpse.ncs index 6f08ba76..55c7a32a 100644 Binary files a/_module/ncs/sd_loot_corpse.ncs and b/_module/ncs/sd_loot_corpse.ncs differ diff --git a/_module/ncs/sd_setdrop.ncs b/_module/ncs/sd_setdrop.ncs index 7e7ce408..58d443a8 100644 Binary files a/_module/ncs/sd_setdrop.ncs and b/_module/ncs/sd_setdrop.ncs differ diff --git a/_module/ncs/se_door_death.ncs b/_module/ncs/se_door_death.ncs index 5f80da18..12091647 100644 Binary files a/_module/ncs/se_door_death.ncs and b/_module/ncs/se_door_death.ncs differ diff --git a/_module/ncs/secretbathtrigge.ncs b/_module/ncs/secretbathtrigge.ncs index e7f567e8..7ea6e8fd 100644 Binary files a/_module/ncs/secretbathtrigge.ncs and b/_module/ncs/secretbathtrigge.ncs differ diff --git a/_module/ncs/secretcrack.ncs b/_module/ncs/secretcrack.ncs index f1cd3a90..0193b4f4 100644 Binary files a/_module/ncs/secretcrack.ncs and b/_module/ncs/secretcrack.ncs differ diff --git a/_module/ncs/secretcrack2.ncs b/_module/ncs/secretcrack2.ncs index 3d12f1cd..b013cfc6 100644 Binary files a/_module/ncs/secretcrack2.ncs and b/_module/ncs/secretcrack2.ncs differ diff --git a/_module/ncs/secrettrigger.ncs b/_module/ncs/secrettrigger.ncs index 5e63bbd2..020a9321 100644 Binary files a/_module/ncs/secrettrigger.ncs and b/_module/ncs/secrettrigger.ncs differ diff --git a/_module/ncs/secrettrigger2.ncs b/_module/ncs/secrettrigger2.ncs index f60e1c49..a3fe5717 100644 Binary files a/_module/ncs/secrettrigger2.ncs and b/_module/ncs/secrettrigger2.ncs differ diff --git a/_module/ncs/secrettrigger3.ncs b/_module/ncs/secrettrigger3.ncs index fe4492c0..a38cd133 100644 Binary files a/_module/ncs/secrettrigger3.ncs and b/_module/ncs/secrettrigger3.ncs differ diff --git a/_module/ncs/securedoorscript.ncs b/_module/ncs/securedoorscript.ncs index 2292ccb1..f4223ec4 100644 Binary files a/_module/ncs/securedoorscript.ncs and b/_module/ncs/securedoorscript.ncs differ diff --git a/_module/ncs/secureport.ncs b/_module/ncs/secureport.ncs index 2fddda4d..4111199c 100644 Binary files a/_module/ncs/secureport.ncs and b/_module/ncs/secureport.ncs differ diff --git a/_module/ncs/secureport2.ncs b/_module/ncs/secureport2.ncs index 6ac99eec..0320ad2c 100644 Binary files a/_module/ncs/secureport2.ncs and b/_module/ncs/secureport2.ncs differ diff --git a/_module/ncs/sendpestaway.ncs b/_module/ncs/sendpestaway.ncs index cd9ca603..83c8f6ed 100644 Binary files a/_module/ncs/sendpestaway.ncs and b/_module/ncs/sendpestaway.ncs differ diff --git a/_module/ncs/set_rainbow_item.ncs b/_module/ncs/set_rainbow_item.ncs index bef378d4..72600dbf 100644 Binary files a/_module/ncs/set_rainbow_item.ncs and b/_module/ncs/set_rainbow_item.ncs differ diff --git a/_module/ncs/setappearance1.ncs b/_module/ncs/setappearance1.ncs index 7f159ad4..6ea9381f 100644 Binary files a/_module/ncs/setappearance1.ncs and b/_module/ncs/setappearance1.ncs differ diff --git a/_module/ncs/setappearance2.ncs b/_module/ncs/setappearance2.ncs index fd26b4f8..551b1ae6 100644 Binary files a/_module/ncs/setappearance2.ncs and b/_module/ncs/setappearance2.ncs differ diff --git a/_module/ncs/setbaseappearanc.ncs b/_module/ncs/setbaseappearanc.ncs index 935c40bb..90c6a2ef 100644 Binary files a/_module/ncs/setbaseappearanc.ncs and b/_module/ncs/setbaseappearanc.ncs differ diff --git a/_module/ncs/sf_wingwand.ncs b/_module/ncs/sf_wingwand.ncs index a416ab9c..edbcd395 100644 Binary files a/_module/ncs/sf_wingwand.ncs and b/_module/ncs/sf_wingwand.ncs differ diff --git a/_module/ncs/sf_xp.ncs b/_module/ncs/sf_xp.ncs index 3d321f6d..ea8100b0 100644 Binary files a/_module/ncs/sf_xp.ncs and b/_module/ncs/sf_xp.ncs differ diff --git a/_module/ncs/sfpb_close.ncs b/_module/ncs/sfpb_close.ncs index 7094ab07..faaf94d9 100644 Binary files a/_module/ncs/sfpb_close.ncs and b/_module/ncs/sfpb_close.ncs differ diff --git a/_module/ncs/sfpb_open.ncs b/_module/ncs/sfpb_open.ncs index a204162d..b9c5b9cf 100644 Binary files a/_module/ncs/sfpb_open.ncs and b/_module/ncs/sfpb_open.ncs differ diff --git a/_module/ncs/sfpb_used.ncs b/_module/ncs/sfpb_used.ncs index 5553ff46..0796acd7 100644 Binary files a/_module/ncs/sfpb_used.ncs and b/_module/ncs/sfpb_used.ncs differ diff --git a/_module/ncs/shadow_port.ncs b/_module/ncs/shadow_port.ncs index 9dd10107..5b9f0456 100644 Binary files a/_module/ncs/shadow_port.ncs and b/_module/ncs/shadow_port.ncs differ diff --git a/_module/ncs/shopdoor.ncs b/_module/ncs/shopdoor.ncs index 420c024b..5fc6d872 100644 Binary files a/_module/ncs/shopdoor.ncs and b/_module/ncs/shopdoor.ncs differ diff --git a/_module/ncs/shopdoor2.ncs b/_module/ncs/shopdoor2.ncs index 8c8dda57..2c41c89a 100644 Binary files a/_module/ncs/shopdoor2.ncs and b/_module/ncs/shopdoor2.ncs differ diff --git a/_module/ncs/shopdoor3.ncs b/_module/ncs/shopdoor3.ncs index b477df95..aa3d87ea 100644 Binary files a/_module/ncs/shopdoor3.ncs and b/_module/ncs/shopdoor3.ncs differ diff --git a/_module/ncs/shopdoorquick.ncs b/_module/ncs/shopdoorquick.ncs index 95d13eb2..b18c21f0 100644 Binary files a/_module/ncs/shopdoorquick.ncs and b/_module/ncs/shopdoorquick.ncs differ diff --git a/_module/ncs/shutguilddoor.ncs b/_module/ncs/shutguilddoor.ncs index 60607d5f..3e898b4f 100644 Binary files a/_module/ncs/shutguilddoor.ncs and b/_module/ncs/shutguilddoor.ncs differ diff --git a/_module/ncs/silenttrigger.ncs b/_module/ncs/silenttrigger.ncs index 728e58e1..9e22b5b0 100644 Binary files a/_module/ncs/silenttrigger.ncs and b/_module/ncs/silenttrigger.ncs differ diff --git a/_module/ncs/silenttrigger2.ncs b/_module/ncs/silenttrigger2.ncs index 90e8f4e5..2274260f 100644 Binary files a/_module/ncs/silenttrigger2.ncs and b/_module/ncs/silenttrigger2.ncs differ diff --git a/_module/ncs/skeletondeath.ncs b/_module/ncs/skeletondeath.ncs index 519ac207..0fafc6db 100644 Binary files a/_module/ncs/skeletondeath.ncs and b/_module/ncs/skeletondeath.ncs differ diff --git a/_module/ncs/sleeping.ncs b/_module/ncs/sleeping.ncs index 90b3a9fc..8694a635 100644 Binary files a/_module/ncs/sleeping.ncs and b/_module/ncs/sleeping.ncs differ diff --git a/_module/ncs/slumdoor.ncs b/_module/ncs/slumdoor.ncs index 8f747873..bdfb0f0f 100644 Binary files a/_module/ncs/slumdoor.ncs and b/_module/ncs/slumdoor.ncs differ diff --git a/_module/ncs/sm_on_act.ncs b/_module/ncs/sm_on_act.ncs index cd43afc1..196ff4e2 100644 Binary files a/_module/ncs/sm_on_act.ncs and b/_module/ncs/sm_on_act.ncs differ diff --git a/_module/ncs/sm_on_client_ent.ncs b/_module/ncs/sm_on_client_ent.ncs index c83a497a..db58fb42 100644 Binary files a/_module/ncs/sm_on_client_ent.ncs and b/_module/ncs/sm_on_client_ent.ncs differ diff --git a/_module/ncs/sm_on_death.ncs b/_module/ncs/sm_on_death.ncs index 30d59527..d3d7affe 100644 Binary files a/_module/ncs/sm_on_death.ncs and b/_module/ncs/sm_on_death.ncs differ diff --git a/_module/ncs/sm_on_dying.ncs b/_module/ncs/sm_on_dying.ncs index 1e7ec786..61fdfc3b 100644 Binary files a/_module/ncs/sm_on_dying.ncs and b/_module/ncs/sm_on_dying.ncs differ diff --git a/_module/ncs/sm_on_respawn.ncs b/_module/ncs/sm_on_respawn.ncs index d772e198..ab80d447 100644 Binary files a/_module/ncs/sm_on_respawn.ncs and b/_module/ncs/sm_on_respawn.ncs differ diff --git a/_module/ncs/sm_on_rest.ncs b/_module/ncs/sm_on_rest.ncs index fdf08bbb..32a5a9a5 100644 Binary files a/_module/ncs/sm_on_rest.ncs and b/_module/ncs/sm_on_rest.ncs differ diff --git a/_module/ncs/soilcheck.ncs b/_module/ncs/soilcheck.ncs index 6805c5da..5e89e7d4 100644 Binary files a/_module/ncs/soilcheck.ncs and b/_module/ncs/soilcheck.ncs differ diff --git a/_module/ncs/spawn_corpse_dcy.ncs b/_module/ncs/spawn_corpse_dcy.ncs index cf568b46..a88991b2 100644 Binary files a/_module/ncs/spawn_corpse_dcy.ncs and b/_module/ncs/spawn_corpse_dcy.ncs differ diff --git a/_module/ncs/spawn_corpse_dth.ncs b/_module/ncs/spawn_corpse_dth.ncs index 94ccc655..06e4cd76 100644 Binary files a/_module/ncs/spawn_corpse_dth.ncs and b/_module/ncs/spawn_corpse_dth.ncs differ diff --git a/_module/ncs/spawn_dist_corps.ncs b/_module/ncs/spawn_dist_corps.ncs index 66d26f52..3d966736 100644 Binary files a/_module/ncs/spawn_dist_corps.ncs and b/_module/ncs/spawn_dist_corps.ncs differ diff --git a/_module/ncs/spawn_horses.ncs b/_module/ncs/spawn_horses.ncs index 4fac8e33..22d2433b 100644 Binary files a/_module/ncs/spawn_horses.ncs and b/_module/ncs/spawn_horses.ncs differ diff --git a/_module/ncs/spawn_oncloscrp.ncs b/_module/ncs/spawn_oncloscrp.ncs index 3557f5bf..7b33f7de 100644 Binary files a/_module/ncs/spawn_oncloscrp.ncs and b/_module/ncs/spawn_oncloscrp.ncs differ diff --git a/_module/ncs/spawn_onopencrp.ncs b/_module/ncs/spawn_onopencrp.ncs index 67eda7ce..8fd022db 100644 Binary files a/_module/ncs/spawn_onopencrp.ncs and b/_module/ncs/spawn_onopencrp.ncs differ diff --git a/_module/ncs/spawn_orig_hb.ncs b/_module/ncs/spawn_orig_hb.ncs index 7c1dc07c..ac5e95fd 100644 Binary files a/_module/ncs/spawn_orig_hb.ncs and b/_module/ncs/spawn_orig_hb.ncs differ diff --git a/_module/ncs/spawn_sample_hb.ncs b/_module/ncs/spawn_sample_hb.ncs index 7c1dc07c..ac5e95fd 100644 Binary files a/_module/ncs/spawn_sample_hb.ncs and b/_module/ncs/spawn_sample_hb.ncs differ diff --git a/_module/ncs/spawn_sc_cmptrig.ncs b/_module/ncs/spawn_sc_cmptrig.ncs index 488916f6..c86acfba 100644 Binary files a/_module/ncs/spawn_sc_cmptrig.ncs and b/_module/ncs/spawn_sc_cmptrig.ncs differ diff --git a/_module/ncs/spawn_sc_hbeat.ncs b/_module/ncs/spawn_sc_hbeat.ncs index 9da1da9b..e1391375 100644 Binary files a/_module/ncs/spawn_sc_hbeat.ncs and b/_module/ncs/spawn_sc_hbeat.ncs differ diff --git a/_module/ncs/spawn_sc_spawn.ncs b/_module/ncs/spawn_sc_spawn.ncs index 66135680..21ed547b 100644 Binary files a/_module/ncs/spawn_sc_spawn.ncs and b/_module/ncs/spawn_sc_spawn.ncs differ diff --git a/_module/ncs/spawnb_cc_activ.ncs b/_module/ncs/spawnb_cc_activ.ncs index b571555b..de4d1662 100644 Binary files a/_module/ncs/spawnb_cc_activ.ncs and b/_module/ncs/spawnb_cc_activ.ncs differ diff --git a/_module/ncs/spawnb_cc_dactiv.ncs b/_module/ncs/spawnb_cc_dactiv.ncs index 77e80d77..7e94385e 100644 Binary files a/_module/ncs/spawnb_cc_dactiv.ncs and b/_module/ncs/spawnb_cc_dactiv.ncs differ diff --git a/_module/ncs/startingmessage.ncs b/_module/ncs/startingmessage.ncs index 72448550..259f0de6 100644 Binary files a/_module/ncs/startingmessage.ncs and b/_module/ncs/startingmessage.ncs differ diff --git a/_module/ncs/stealbreath.ncs b/_module/ncs/stealbreath.ncs index e345d2b1..1fa47d9e 100644 Binary files a/_module/ncs/stealbreath.ncs and b/_module/ncs/stealbreath.ncs differ diff --git a/_module/ncs/stoneport2guild.ncs b/_module/ncs/stoneport2guild.ncs index 8e90933d..a9d1996a 100644 Binary files a/_module/ncs/stoneport2guild.ncs and b/_module/ncs/stoneport2guild.ncs differ diff --git a/_module/ncs/stoneportshome.ncs b/_module/ncs/stoneportshome.ncs index 70aa489f..ed9a2f27 100644 Binary files a/_module/ncs/stoneportshome.ncs and b/_module/ncs/stoneportshome.ncs differ diff --git a/_module/ncs/stonerecallspc.ncs b/_module/ncs/stonerecallspc.ncs index 77c35a19..00f1d09a 100644 Binary files a/_module/ncs/stonerecallspc.ncs and b/_module/ncs/stonerecallspc.ncs differ diff --git a/_module/ncs/stopbarrelthief.ncs b/_module/ncs/stopbarrelthief.ncs index 51559492..240a5872 100644 Binary files a/_module/ncs/stopbarrelthief.ncs and b/_module/ncs/stopbarrelthief.ncs differ diff --git a/_module/ncs/stopbarrelthief2.ncs b/_module/ncs/stopbarrelthief2.ncs index 5462f2db..5555ee55 100644 Binary files a/_module/ncs/stopbarrelthief2.ncs and b/_module/ncs/stopbarrelthief2.ncs differ diff --git a/_module/ncs/summon1.ncs b/_module/ncs/summon1.ncs index 0be9ddd5..3b33c104 100644 Binary files a/_module/ncs/summon1.ncs and b/_module/ncs/summon1.ncs differ diff --git a/_module/ncs/summon10.ncs b/_module/ncs/summon10.ncs index 972975b0..c6acf422 100644 Binary files a/_module/ncs/summon10.ncs and b/_module/ncs/summon10.ncs differ diff --git a/_module/ncs/summon11.ncs b/_module/ncs/summon11.ncs index bd86f35b..288ebe52 100644 Binary files a/_module/ncs/summon11.ncs and b/_module/ncs/summon11.ncs differ diff --git a/_module/ncs/summon12.ncs b/_module/ncs/summon12.ncs index f9daa4a2..710ca718 100644 Binary files a/_module/ncs/summon12.ncs and b/_module/ncs/summon12.ncs differ diff --git a/_module/ncs/summon2.ncs b/_module/ncs/summon2.ncs index 8721cf13..a9338d3f 100644 Binary files a/_module/ncs/summon2.ncs and b/_module/ncs/summon2.ncs differ diff --git a/_module/ncs/summon3.ncs b/_module/ncs/summon3.ncs index 068205e3..c9b222c9 100644 Binary files a/_module/ncs/summon3.ncs and b/_module/ncs/summon3.ncs differ diff --git a/_module/ncs/summon4.ncs b/_module/ncs/summon4.ncs index e2fe8c36..76b66460 100644 Binary files a/_module/ncs/summon4.ncs and b/_module/ncs/summon4.ncs differ diff --git a/_module/ncs/summon5.ncs b/_module/ncs/summon5.ncs index 136fb39c..7c1dba77 100644 Binary files a/_module/ncs/summon5.ncs and b/_module/ncs/summon5.ncs differ diff --git a/_module/ncs/summon6.ncs b/_module/ncs/summon6.ncs index 601167ea..dd96a67a 100644 Binary files a/_module/ncs/summon6.ncs and b/_module/ncs/summon6.ncs differ diff --git a/_module/ncs/summon7.ncs b/_module/ncs/summon7.ncs index e3cb4694..89bea069 100644 Binary files a/_module/ncs/summon7.ncs and b/_module/ncs/summon7.ncs differ diff --git a/_module/ncs/summon8.ncs b/_module/ncs/summon8.ncs index f58df9d6..959e6e88 100644 Binary files a/_module/ncs/summon8.ncs and b/_module/ncs/summon8.ncs differ diff --git a/_module/ncs/summon9.ncs b/_module/ncs/summon9.ncs index f3dc74b7..dbeb2df0 100644 Binary files a/_module/ncs/summon9.ncs and b/_module/ncs/summon9.ncs differ diff --git a/_module/ncs/sundial.ncs b/_module/ncs/sundial.ncs index 5a5d5a94..22254ba9 100644 Binary files a/_module/ncs/sundial.ncs and b/_module/ncs/sundial.ncs differ diff --git a/_module/ncs/takealterkey.ncs b/_module/ncs/takealterkey.ncs index 24bbacf4..d2734655 100644 Binary files a/_module/ncs/takealterkey.ncs and b/_module/ncs/takealterkey.ncs differ diff --git a/_module/ncs/takedrowkey.ncs b/_module/ncs/takedrowkey.ncs index 8f409df9..8a4e56f1 100644 Binary files a/_module/ncs/takedrowkey.ncs and b/_module/ncs/takedrowkey.ncs differ diff --git a/_module/ncs/talkingnpc.ncs b/_module/ncs/talkingnpc.ncs index a1c6a362..5ce99b7f 100644 Binary files a/_module/ncs/talkingnpc.ncs and b/_module/ncs/talkingnpc.ncs differ diff --git a/_module/ncs/tamper.ncs b/_module/ncs/tamper.ncs index e68fd062..fa0ce10b 100644 Binary files a/_module/ncs/tamper.ncs and b/_module/ncs/tamper.ncs differ diff --git a/_module/ncs/tavernport.ncs b/_module/ncs/tavernport.ncs index c3615cc5..a32f4b0d 100644 Binary files a/_module/ncs/tavernport.ncs and b/_module/ncs/tavernport.ncs differ diff --git a/_module/ncs/tentdoorportspc.ncs b/_module/ncs/tentdoorportspc.ncs index 383a8c30..e064f756 100644 Binary files a/_module/ncs/tentdoorportspc.ncs and b/_module/ncs/tentdoorportspc.ncs differ diff --git a/_module/ncs/tentteleportspc.ncs b/_module/ncs/tentteleportspc.ncs index 3929f893..46b1f893 100644 Binary files a/_module/ncs/tentteleportspc.ncs and b/_module/ncs/tentteleportspc.ncs differ diff --git a/_module/ncs/test.ncs b/_module/ncs/test.ncs index 66bf5141..de745349 100644 Binary files a/_module/ncs/test.ncs and b/_module/ncs/test.ncs differ diff --git a/_module/ncs/thievesgate.ncs b/_module/ncs/thievesgate.ncs index 05dc7b4f..b33a7a79 100644 Binary files a/_module/ncs/thievesgate.ncs and b/_module/ncs/thievesgate.ncs differ diff --git a/_module/ncs/thronelever_use.ncs b/_module/ncs/thronelever_use.ncs index b0576f44..9dd25996 100644 Binary files a/_module/ncs/thronelever_use.ncs and b/_module/ncs/thronelever_use.ncs differ diff --git a/_module/ncs/timestopaoe.ncs b/_module/ncs/timestopaoe.ncs index 64e73a7d..75d0e5a6 100644 Binary files a/_module/ncs/timestopaoe.ncs and b/_module/ncs/timestopaoe.ncs differ diff --git a/_module/ncs/tlr_onconv.ncs b/_module/ncs/tlr_onconv.ncs index 24eff9a3..49dbcf1f 100644 Binary files a/_module/ncs/tlr_onconv.ncs and b/_module/ncs/tlr_onconv.ncs differ diff --git a/_module/ncs/tlr_rotateclock.ncs b/_module/ncs/tlr_rotateclock.ncs index fee35c7b..2567ee45 100644 Binary files a/_module/ncs/tlr_rotateclock.ncs and b/_module/ncs/tlr_rotateclock.ncs differ diff --git a/_module/ncs/tlr_rotatecountr.ncs b/_module/ncs/tlr_rotatecountr.ncs index 03e710f4..3927a095 100644 Binary files a/_module/ncs/tlr_rotatecountr.ncs and b/_module/ncs/tlr_rotatecountr.ncs differ diff --git a/_module/ncs/toothchest.ncs b/_module/ncs/toothchest.ncs index 1c13a17b..28550bd3 100644 Binary files a/_module/ncs/toothchest.ncs and b/_module/ncs/toothchest.ncs differ diff --git a/_module/ncs/tourneydoor.ncs b/_module/ncs/tourneydoor.ncs index 905f077f..43e76125 100644 Binary files a/_module/ncs/tourneydoor.ncs and b/_module/ncs/tourneydoor.ncs differ diff --git a/_module/ncs/townwatch3talks.ncs b/_module/ncs/townwatch3talks.ncs index 265b2cd5..55a6f857 100644 Binary files a/_module/ncs/townwatch3talks.ncs and b/_module/ncs/townwatch3talks.ncs differ diff --git a/_module/ncs/trackstrigger1.ncs b/_module/ncs/trackstrigger1.ncs index b5b041eb..e5aebd82 100644 Binary files a/_module/ncs/trackstrigger1.ncs and b/_module/ncs/trackstrigger1.ncs differ diff --git a/_module/ncs/trampler_hb.ncs b/_module/ncs/trampler_hb.ncs index 873e9b75..ad7c1821 100644 Binary files a/_module/ncs/trampler_hb.ncs and b/_module/ncs/trampler_hb.ncs differ diff --git a/_module/ncs/trollpercieve.ncs b/_module/ncs/trollpercieve.ncs index c913124a..c4985892 100644 Binary files a/_module/ncs/trollpercieve.ncs and b/_module/ncs/trollpercieve.ncs differ diff --git a/_module/ncs/tz_ed_ondeath.ncs b/_module/ncs/tz_ed_ondeath.ncs index 73453a4a..b8f569da 100644 Binary files a/_module/ncs/tz_ed_ondeath.ncs and b/_module/ncs/tz_ed_ondeath.ncs differ diff --git a/_module/ncs/unburdenned2.ncs b/_module/ncs/unburdenned2.ncs index 305c1969..0908cc7e 100644 Binary files a/_module/ncs/unburdenned2.ncs and b/_module/ncs/unburdenned2.ncs differ diff --git a/_module/ncs/underdoor.ncs b/_module/ncs/underdoor.ncs index e27251ad..8152d8b5 100644 Binary files a/_module/ncs/underdoor.ncs and b/_module/ncs/underdoor.ncs differ diff --git a/_module/ncs/underentrance.ncs b/_module/ncs/underentrance.ncs index af2e1dea..c73b9f09 100644 Binary files a/_module/ncs/underentrance.ncs and b/_module/ncs/underentrance.ncs differ diff --git a/_module/ncs/vamp.ncs b/_module/ncs/vamp.ncs index 534a805b..236d8a74 100644 Binary files a/_module/ncs/vamp.ncs and b/_module/ncs/vamp.ncs differ diff --git a/_module/ncs/vandalism.ncs b/_module/ncs/vandalism.ncs index 77e17b88..e61373d7 100644 Binary files a/_module/ncs/vandalism.ncs and b/_module/ncs/vandalism.ncs differ diff --git a/_module/ncs/vandalspell.ncs b/_module/ncs/vandalspell.ncs index f08a5fbb..394d0177 100644 Binary files a/_module/ncs/vandalspell.ncs and b/_module/ncs/vandalspell.ncs differ diff --git a/_module/ncs/vaultopen.ncs b/_module/ncs/vaultopen.ncs index c702a0f2..e22fa1e7 100644 Binary files a/_module/ncs/vaultopen.ncs and b/_module/ncs/vaultopen.ncs differ diff --git a/_module/ncs/vaultopen2.ncs b/_module/ncs/vaultopen2.ncs index 5451170d..6456158a 100644 Binary files a/_module/ncs/vaultopen2.ncs and b/_module/ncs/vaultopen2.ncs differ diff --git a/_module/ncs/voyageskip.ncs b/_module/ncs/voyageskip.ncs index 21133381..712ee298 100644 Binary files a/_module/ncs/voyageskip.ncs and b/_module/ncs/voyageskip.ncs differ diff --git a/_module/ncs/wardenspawn.ncs b/_module/ncs/wardenspawn.ncs index c2424d74..3c757cd9 100644 Binary files a/_module/ncs/wardenspawn.ncs and b/_module/ncs/wardenspawn.ncs differ diff --git a/_module/ncs/wardenwalks.ncs b/_module/ncs/wardenwalks.ncs index 243ba90c..b72b4366 100644 Binary files a/_module/ncs/wardenwalks.ncs and b/_module/ncs/wardenwalks.ncs differ diff --git a/_module/ncs/wardenwalks2.ncs b/_module/ncs/wardenwalks2.ncs index 405f5437..979fe7e6 100644 Binary files a/_module/ncs/wardenwalks2.ncs and b/_module/ncs/wardenwalks2.ncs differ diff --git a/_module/ncs/weaponmasterbeat.ncs b/_module/ncs/weaponmasterbeat.ncs index aea19fc1..ee34ef2c 100644 Binary files a/_module/ncs/weaponmasterbeat.ncs and b/_module/ncs/weaponmasterbeat.ncs differ diff --git a/_module/ncs/witchspawn.ncs b/_module/ncs/witchspawn.ncs index f78d9015..ed584cdb 100644 Binary files a/_module/ncs/witchspawn.ncs and b/_module/ncs/witchspawn.ncs differ diff --git a/_module/ncs/wraith_touch.ncs b/_module/ncs/wraith_touch.ncs index cfe8b64f..920482d6 100644 Binary files a/_module/ncs/wraith_touch.ncs and b/_module/ncs/wraith_touch.ncs differ diff --git a/_module/ncs/ww_modrest.ncs b/_module/ncs/ww_modrest.ncs index 7d48aa7c..72990570 100644 Binary files a/_module/ncs/ww_modrest.ncs and b/_module/ncs/ww_modrest.ncs differ diff --git a/_module/ncs/wwclaw.ncs b/_module/ncs/wwclaw.ncs index d43843dc..1074449f 100644 Binary files a/_module/ncs/wwclaw.ncs and b/_module/ncs/wwclaw.ncs differ diff --git a/_module/ncs/wyrmling_convo.ncs b/_module/ncs/wyrmling_convo.ncs index 722cd335..219614e0 100644 Binary files a/_module/ncs/wyrmling_convo.ncs and b/_module/ncs/wyrmling_convo.ncs differ diff --git a/_module/ncs/wyrmling_death.ncs b/_module/ncs/wyrmling_death.ncs index 648d4966..53297042 100644 Binary files a/_module/ncs/wyrmling_death.ncs and b/_module/ncs/wyrmling_death.ncs differ diff --git a/_module/ncs/wyrmling_spawn.ncs b/_module/ncs/wyrmling_spawn.ncs index 798d6615..9e7c38e8 100644 Binary files a/_module/ncs/wyrmling_spawn.ncs and b/_module/ncs/wyrmling_spawn.ncs differ diff --git a/_module/ncs/x_genveryhigh_x4.ncs b/_module/ncs/x_genveryhigh_x4.ncs index 239fd618..f0ef7123 100644 Binary files a/_module/ncs/x_genveryhigh_x4.ncs and b/_module/ncs/x_genveryhigh_x4.ncs differ diff --git a/_module/ncs/x_o2_boss_12.ncs b/_module/ncs/x_o2_boss_12.ncs index 3b0ae0a8..7d65d5d6 100644 Binary files a/_module/ncs/x_o2_boss_12.ncs and b/_module/ncs/x_o2_boss_12.ncs differ diff --git a/_module/ncs/x_o2_boss_12x2.ncs b/_module/ncs/x_o2_boss_12x2.ncs index c3ba40a1..7954f090 100644 Binary files a/_module/ncs/x_o2_boss_12x2.ncs and b/_module/ncs/x_o2_boss_12x2.ncs differ diff --git a/_module/ncs/x_o2_boss_15.ncs b/_module/ncs/x_o2_boss_15.ncs index da0e5118..c15e7371 100644 Binary files a/_module/ncs/x_o2_boss_15.ncs and b/_module/ncs/x_o2_boss_15.ncs differ diff --git a/_module/ncs/x_o2_boss_18.ncs b/_module/ncs/x_o2_boss_18.ncs index 6d214eb1..f7d0473d 100644 Binary files a/_module/ncs/x_o2_boss_18.ncs and b/_module/ncs/x_o2_boss_18.ncs differ diff --git a/_module/ncs/x_o2_boss_20.ncs b/_module/ncs/x_o2_boss_20.ncs index c2a72dda..5d74704f 100644 Binary files a/_module/ncs/x_o2_boss_20.ncs and b/_module/ncs/x_o2_boss_20.ncs differ diff --git a/_module/ncs/x_o2_boss_20_x3.ncs b/_module/ncs/x_o2_boss_20_x3.ncs index 0122ee5f..449a9422 100644 Binary files a/_module/ncs/x_o2_boss_20_x3.ncs and b/_module/ncs/x_o2_boss_20_x3.ncs differ diff --git a/_module/ncs/x_o2_boss_4.ncs b/_module/ncs/x_o2_boss_4.ncs index 6fc5a0ab..7d28ad27 100644 Binary files a/_module/ncs/x_o2_boss_4.ncs and b/_module/ncs/x_o2_boss_4.ncs differ diff --git a/_module/ncs/x_o2_boss_4_x3.ncs b/_module/ncs/x_o2_boss_4_x3.ncs index efbb1388..ff9c5764 100644 Binary files a/_module/ncs/x_o2_boss_4_x3.ncs and b/_module/ncs/x_o2_boss_4_x3.ncs differ diff --git a/_module/ncs/x_o2_boss_6.ncs b/_module/ncs/x_o2_boss_6.ncs index 8f3aeb2b..c9e1cf24 100644 Binary files a/_module/ncs/x_o2_boss_6.ncs and b/_module/ncs/x_o2_boss_6.ncs differ diff --git a/_module/ncs/x_o2_boss_7.ncs b/_module/ncs/x_o2_boss_7.ncs index 934ac409..46498323 100644 Binary files a/_module/ncs/x_o2_boss_7.ncs and b/_module/ncs/x_o2_boss_7.ncs differ diff --git a/_module/ncs/x_o2_boss_9.ncs b/_module/ncs/x_o2_boss_9.ncs index 538a8574..bbd626fb 100644 Binary files a/_module/ncs/x_o2_boss_9.ncs and b/_module/ncs/x_o2_boss_9.ncs differ diff --git a/_module/ncs/x_o2_classhig.ncs b/_module/ncs/x_o2_classhig.ncs index cc0537c6..9996b560 100644 Binary files a/_module/ncs/x_o2_classhig.ncs and b/_module/ncs/x_o2_classhig.ncs differ diff --git a/_module/ncs/x_o2_classhig20.ncs b/_module/ncs/x_o2_classhig20.ncs index 618a3402..2af367ac 100644 Binary files a/_module/ncs/x_o2_classhig20.ncs and b/_module/ncs/x_o2_classhig20.ncs differ diff --git a/_module/ncs/x_o2_classlow_4.ncs b/_module/ncs/x_o2_classlow_4.ncs index e47cd593..008a218d 100644 Binary files a/_module/ncs/x_o2_classlow_4.ncs and b/_module/ncs/x_o2_classlow_4.ncs differ diff --git a/_module/ncs/x_o2_classlow_l8.ncs b/_module/ncs/x_o2_classlow_l8.ncs index fb22f525..0402133e 100644 Binary files a/_module/ncs/x_o2_classlow_l8.ncs and b/_module/ncs/x_o2_classlow_l8.ncs differ diff --git a/_module/ncs/x_o2_classmed.ncs b/_module/ncs/x_o2_classmed.ncs index 28903f98..41f850f4 100644 Binary files a/_module/ncs/x_o2_classmed.ncs and b/_module/ncs/x_o2_classmed.ncs differ diff --git a/_module/ncs/x_o2_classwea_12.ncs b/_module/ncs/x_o2_classwea_12.ncs index 88875099..691a8fc7 100644 Binary files a/_module/ncs/x_o2_classwea_12.ncs and b/_module/ncs/x_o2_classwea_12.ncs differ diff --git a/_module/ncs/x_o2_classwea_15.ncs b/_module/ncs/x_o2_classwea_15.ncs index 8dea05a4..547797fe 100644 Binary files a/_module/ncs/x_o2_classwea_15.ncs and b/_module/ncs/x_o2_classwea_15.ncs differ diff --git a/_module/ncs/x_o2_classwea_18.ncs b/_module/ncs/x_o2_classwea_18.ncs index 80a46e8b..2f875534 100644 Binary files a/_module/ncs/x_o2_classwea_18.ncs and b/_module/ncs/x_o2_classwea_18.ncs differ diff --git a/_module/ncs/x_o2_classweap_4.ncs b/_module/ncs/x_o2_classweap_4.ncs index 8f408dbf..f21277e9 100644 Binary files a/_module/ncs/x_o2_classweap_4.ncs and b/_module/ncs/x_o2_classweap_4.ncs differ diff --git a/_module/ncs/x_o2_classweap_6.ncs b/_module/ncs/x_o2_classweap_6.ncs index 20172323..b91afdaa 100644 Binary files a/_module/ncs/x_o2_classweap_6.ncs and b/_module/ncs/x_o2_classweap_6.ncs differ diff --git a/_module/ncs/x_o2_gen_low_x4.ncs b/_module/ncs/x_o2_gen_low_x4.ncs index 021ef968..9e3381b8 100644 Binary files a/_module/ncs/x_o2_gen_low_x4.ncs and b/_module/ncs/x_o2_gen_low_x4.ncs differ diff --git a/_module/ncs/x_o2_generalhig.ncs b/_module/ncs/x_o2_generalhig.ncs index bae725d4..44fccb31 100644 Binary files a/_module/ncs/x_o2_generalhig.ncs and b/_module/ncs/x_o2_generalhig.ncs differ diff --git a/_module/ncs/x_o2_generallow.ncs b/_module/ncs/x_o2_generallow.ncs index 79d48510..e1084756 100644 Binary files a/_module/ncs/x_o2_generallow.ncs and b/_module/ncs/x_o2_generallow.ncs differ diff --git a/_module/ncs/x_o2_generalmed.ncs b/_module/ncs/x_o2_generalmed.ncs index 3d4be534..7ab933a6 100644 Binary files a/_module/ncs/x_o2_generalmed.ncs and b/_module/ncs/x_o2_generalmed.ncs differ diff --git a/_module/ncs/x_o2_generalmid.ncs b/_module/ncs/x_o2_generalmid.ncs index 76275692..aa9ed0df 100644 Binary files a/_module/ncs/x_o2_generalmid.ncs and b/_module/ncs/x_o2_generalmid.ncs differ diff --git a/_module/ncs/x_o2_gengodhig.ncs b/_module/ncs/x_o2_gengodhig.ncs index 99020df0..ff7fa6a5 100644 Binary files a/_module/ncs/x_o2_gengodhig.ncs and b/_module/ncs/x_o2_gengodhig.ncs differ diff --git a/_module/ncs/x_o2_gensuperhig.ncs b/_module/ncs/x_o2_gensuperhig.ncs index 3f16155f..63c631e5 100644 Binary files a/_module/ncs/x_o2_gensuperhig.ncs and b/_module/ncs/x_o2_gensuperhig.ncs differ diff --git a/_module/ncs/x_o2_genveryhigh.ncs b/_module/ncs/x_o2_genveryhigh.ncs index 9ce64ead..988ce3fa 100644 Binary files a/_module/ncs/x_o2_genveryhigh.ncs and b/_module/ncs/x_o2_genveryhigh.ncs differ diff --git a/_module/ncs/x_o2_preset.ncs b/_module/ncs/x_o2_preset.ncs index db2faa22..bc679146 100644 Binary files a/_module/ncs/x_o2_preset.ncs and b/_module/ncs/x_o2_preset.ncs differ diff --git a/_module/ncs/x_o2_preset_dm.ncs b/_module/ncs/x_o2_preset_dm.ncs index 2f8f2f85..61fd8e62 100644 Binary files a/_module/ncs/x_o2_preset_dm.ncs and b/_module/ncs/x_o2_preset_dm.ncs differ diff --git a/_module/ncs/xmpl_npc_on_spwn.ncs b/_module/ncs/xmpl_npc_on_spwn.ncs index 7de2af5a..d634283c 100644 Binary files a/_module/ncs/xmpl_npc_on_spwn.ncs and b/_module/ncs/xmpl_npc_on_spwn.ncs differ diff --git a/_module/ncs/yuantipercieve.ncs b/_module/ncs/yuantipercieve.ncs index 04802210..88ba67d1 100644 Binary files a/_module/ncs/yuantipercieve.ncs and b/_module/ncs/yuantipercieve.ncs differ diff --git a/_module/ncs/zombie_feed.ncs b/_module/ncs/zombie_feed.ncs index 33339ef0..59baa7ce 100644 Binary files a/_module/ncs/zombie_feed.ncs and b/_module/ncs/zombie_feed.ncs differ diff --git a/_module/ncs/zombiepercieve.ncs b/_module/ncs/zombiepercieve.ncs index d8fc5b89..9136a441 100644 Binary files a/_module/ncs/zombiepercieve.ncs and b/_module/ncs/zombiepercieve.ncs differ diff --git a/_module/nss/diamond_golem_hb.nss b/_module/nss/diamond_golem_hb.nss new file mode 100644 index 00000000..09a6c20f --- /dev/null +++ b/_module/nss/diamond_golem_hb.nss @@ -0,0 +1,196 @@ +#include "x2_inc_spellhook" +#include "prc_inc_combmove" +#include "inc_utility" + +// Constants for tracking steps +const int STEP_SUNBEAM_MOST_POWERFUL = 1; +const int STEP_TRUE_STRIKE_AND_ATTACK = 2; +const int STEP_MOVE_TO_NEAREST = 3; +const int STEP_TRUE_STRIKE_SELF = 4; +const int STEP_ATTACK_NEAREST = 5; +const int STEP_SUNBEAM_OR_TRUE_STRIKE = 6; + + +void DoAwesomeBlow(object oTarget, object oNPC = OBJECT_SELF) +{ + int nHP = GetCurrentHitPoints(oTarget); + int nSizeBonus; + effect eNone; + + // Apply the VFX + ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_REFLEX_SAVE_THROW_USE), oTarget); + + PerformAttack(oTarget, oNPC, eNone, 0.0, -4); + + if (GetLocalInt(oTarget, "PRCCombat_StruckByAttack")) + { + int nDC = nHP - GetCurrentHitPoints(oTarget); // This should be the amount caused by the attack + + if ((PRCGetCreatureSize(oNPC) + nSizeBonus) > PRCGetCreatureSize(oTarget)) + { + if (!PRCMySavingThrow(SAVING_THROW_REFLEX, oTarget, nDC, SAVING_THROW_TYPE_NONE)) + { + _DoBullRushKnockBack(oTarget, oNPC, 10.0); + + // Apply knockdown effect after the knockback with a slight delay + DelayCommand(0.1, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectKnockdown(), oTarget, 6.0)); + + // Trigger dust explosion when the target stops moving + DelayCommand(0.6, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_DUST_EXPLOSION), oTarget)); + } + } + } +} + +// Function to get the most powerful opponent +object GetMostPowerfulOpponent(object oCaster) +{ + float fRadius = 40.0f; // Limit of perception in NWN + int nShape = SHAPE_SPHERE; // Shape type + location lCasterLocation = GetLocation(oCaster); // Correct location type + + object oTarget = GetFirstObjectInShape(nShape, fRadius, lCasterLocation, TRUE); + object oStrongest = OBJECT_INVALID; + float fHighestCR = -1.0f; + + while (oTarget != OBJECT_INVALID) + { + // Check if the target is a creature and hostile to the caster + if (GetObjectType(oTarget) == OBJECT_TYPE_CREATURE && GetIsReactionTypeHostile(oTarget, oCaster)) + { + float fCR = GetChallengeRating(oTarget); + if (fCR > fHighestCR) + { + fHighestCR = fCR; + oStrongest = oTarget; + } + } + oTarget = GetNextObjectInShape(nShape, fRadius, lCasterLocation, TRUE); + } + return oStrongest; +} + +// Function to get the weakest enemy +object GetWeakestEnemy(object oCaster) +{ + float fRadius = 40.0f; // Limit of perception in NWN + int nShape = SHAPE_SPHERE; // Shape type + location lCasterLocation = GetLocation(oCaster); // Correct location type + + object oTarget = GetFirstObjectInShape(nShape, fRadius, lCasterLocation, TRUE); + object oWeakest = OBJECT_INVALID; + float fLowestCR = 9999.0f; + + while (oTarget != OBJECT_INVALID) + { + // Check if the target is a creature and hostile to the caster + if (GetObjectType(oTarget) == OBJECT_TYPE_CREATURE && GetIsReactionTypeHostile(oTarget, oCaster)) + { + float fCR = GetChallengeRating(oTarget); + if (fCR < fLowestCR) + { + fLowestCR = fCR; + oWeakest = oTarget; + } + } + oTarget = GetNextObjectInShape(nShape, fRadius, lCasterLocation, TRUE); + } + return oWeakest; +} + + +// Function to get the nearest enemy +object GetNearestEnemy(object oCaster) +{ + object oTarget = GetNearestCreature(CREATURE_TYPE_IS_ALIVE, TRUE, oCaster, 1, CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY); + return oTarget; +} + +void main() +{ + object oCaster = OBJECT_SELF; + object oNearestEnemy = GetNearestEnemy(oCaster); + + // Retrieve or initialize the current step + int nStep = GetLocalInt(oCaster, "CURRENT_STEP"); + if (nStep == 0) + { + nStep = STEP_SUNBEAM_MOST_POWERFUL; + } + + switch (nStep) { + case STEP_SUNBEAM_MOST_POWERFUL: + { + // 100% chance to use Sunbeam, if memorized, on the most powerful opponent + object oTarget = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN); + if (oTarget != OBJECT_INVALID && GetHasSpell(SPELL_SUNBEAM, oCaster)) + { + AssignCommand(oCaster, ActionCastSpellAtObject(SPELL_SUNBEAM, oTarget)); + } + SetLocalInt(oCaster, "CURRENT_STEP", STEP_TRUE_STRIKE_AND_ATTACK); + break; + } + case STEP_TRUE_STRIKE_AND_ATTACK: + { + // If nearest enemy is within 10 meters, cast True Strike on self & attack nearest enemy + if (oNearestEnemy != OBJECT_INVALID && GetDistanceToObject(oNearestEnemy) <= 10.0f) + { + AssignCommand(oCaster, ActionCastSpellAtObject(SPELL_TRUE_STRIKE, oCaster)); + AssignCommand(oCaster, ActionAttack(oNearestEnemy)); + } + SetLocalInt(oCaster, "CURRENT_STEP", STEP_MOVE_TO_NEAREST); + break; + } + case STEP_MOVE_TO_NEAREST: + { + // If nearest enemy is over 10 meters away, move to nearest enemy + if (oNearestEnemy != OBJECT_INVALID && GetDistanceToObject(oNearestEnemy) > 10.0f) + { + AssignCommand(oCaster, ActionMoveToObject(oNearestEnemy)); + } + SetLocalInt(oCaster, "CURRENT_STEP", STEP_TRUE_STRIKE_SELF); + break; + } + case STEP_TRUE_STRIKE_SELF: + { + // 100% to cast True Strike on self + AssignCommand(oCaster, ActionCastSpellAtObject(SPELL_TRUE_STRIKE, oCaster)); + SetLocalInt(oCaster, "CURRENT_STEP", STEP_ATTACK_NEAREST); + break; + } + case STEP_ATTACK_NEAREST: + { + // Attack nearest enemy + if (oNearestEnemy != OBJECT_INVALID) + { + AssignCommand(oCaster, ActionAttack(oNearestEnemy)); + } + SetLocalInt(oCaster, "CURRENT_STEP", STEP_SUNBEAM_OR_TRUE_STRIKE); + break; + } + case STEP_SUNBEAM_OR_TRUE_STRIKE: + { + // 50% to cast Sunbeam, if memorized, on weakest enemy, else cast True Strike + object oWeakestEnemy = GetWeakestEnemy(oCaster); + if (Random(2) == 0 && GetHasSpell(SPELL_SUNBEAM, oCaster) && oWeakestEnemy != OBJECT_INVALID) + { + AssignCommand(oCaster, ActionCastSpellAtObject(SPELL_SUNBEAM, oWeakestEnemy)); + } + else + { + AssignCommand(oCaster, ActionCastSpellAtObject(SPELL_TRUE_STRIKE, oCaster)); + } + // If under the effects of True Strike, attack nearest enemy, else cast True Strike + if (GetHasSpellEffect(SPELL_TRUE_STRIKE, oCaster) && oNearestEnemy != OBJECT_INVALID) + { + AssignCommand(oCaster, ActionAttack(oNearestEnemy)); + } + else + { + AssignCommand(oCaster, ActionCastSpellAtObject(SPELL_TRUE_STRIKE, oCaster)); + } + SetLocalInt(oCaster, "CURRENT_STEP", STEP_SUNBEAM_MOST_POWERFUL); + break; + } + } +} \ No newline at end of file diff --git a/_module/nss/ms_name_inc.nss b/_module/nss/ms_name_inc.nss index 90de1df5..cd92a207 100644 --- a/_module/nss/ms_name_inc.nss +++ b/_module/nss/ms_name_inc.nss @@ -966,7 +966,7 @@ void ms_Nomenclature(object oNPC = OBJECT_SELF) } else if(nResult == 5) { - sPostfix = "of Ur-Draxa"; + sPostfix = "of Waterdeep"; } else sPostfix = "the Mage"; diff --git a/_module/nss/myhook.nss b/_module/nss/myhook.nss index c5f26ccd..a01c156b 100644 --- a/_module/nss/myhook.nss +++ b/_module/nss/myhook.nss @@ -73,14 +73,16 @@ Open up the No Casting Area and edit the area to see how it's set up properly. void main() { //Declare Major Variables; - int nSpell=GetSpellId(); + object oCaster = OBJECT_SELF; + object sTarget = PRCGetSpellTargetObject(); + object sItem = PRCGetSpellCastItem(); + + int nSpell =PRCGetSpellId(); int nCastLevel = GetCasterLevel(OBJECT_SELF); int zInt; - object oCaster = OBJECT_SELF; - object sTarget = PRCGetSpellTargetObject(); - object sItem = PRCGetSpellCastItem(); + int sClass = GetLastSpellCastClass(); + location sLocation = GetSpellTargetLocation(); - int sClass = GetLastSpellCastClass(); //Let's get the area of the PC string cArea = GetTag(GetArea(oCaster)); @@ -197,7 +199,7 @@ switch (nSpell) ///////////Modifications For All Individual Spells//////////////////////// //Switch/Case Statments (for all spells) - switch(nSpell) +/* switch(nSpell) { case SPELL_ACID_FOG: { @@ -1466,7 +1468,7 @@ switch (nSpell) //End Switch Statement } //End Script -} +} */ /////////////////////////////////////////////////// /* @@ -1552,3 +1554,4 @@ switch (nSpell) // (commenting out end, do not touch this line!) */ //End of Script see ya :) +} \ No newline at end of file diff --git a/_module/nss/no_lib_actions.nss b/_module/nss/no_lib_actions.nss index 6f6e1011..128c1c54 100644 --- a/_module/nss/no_lib_actions.nss +++ b/_module/nss/no_lib_actions.nss @@ -1,160 +1,161 @@ #include "no_inc_ptypes" +#include "prc_inc_racial" //support functions void NO_ActionCastSpellAtLocation( int iSpell, location lTargetLocation, int iMetaMagic=METAMAGIC_ANY, int iCheat=FALSE, int iProjectilePathType=PROJECTILE_PATH_TYPE_DEFAULT, int iInstantSpell=FALSE, int iDefensive=TRUE ) { - int iLevel = 14; - int iConc = GetCombatConcentration(); - int iDefCast = FALSE; - - if ( iDefensive == TRUE && iConc >= iLevel && GetHostileCount( 5.0 ) > 0 ) - { - iDefCast = TRUE; - } - SetActionMode( OBJECT_SELF, ACTION_MODE_DEFENSIVE_CAST, iDefCast ); - ActionCastSpellAtLocation( iSpell, lTargetLocation, iMetaMagic, iCheat, iProjectilePathType, iInstantSpell ); -} + int iLevel = 14; + int iConc = GetCombatConcentration(); + int iDefCast = FALSE; + + if ( iDefensive == TRUE && iConc >= iLevel && GetHostileCount( 5.0 ) > 0 ) + { + iDefCast = TRUE; + } + SetActionMode( OBJECT_SELF, ACTION_MODE_DEFENSIVE_CAST, iDefCast ); + ActionCastSpellAtLocation( iSpell, lTargetLocation, iMetaMagic, iCheat, iProjectilePathType, iInstantSpell ); +} void NO_ActionCastSpellAtObject( int iSpell, object oTarget, int iMetaMagic=METAMAGIC_ANY, int iCheat=FALSE, int iDomainLevel=0, int iProjectilePathType=PROJECTILE_PATH_TYPE_DEFAULT, int iInstantSpell=FALSE, int iDefensive=TRUE ) { - int iLevel = 14; - int iConc = GetCombatConcentration(); - int iDefCast = FALSE; - - if ( iDefensive == TRUE && iConc >= iLevel && GetHostileCount( 5.0 ) > 0 ) - { - iDefCast = TRUE; - } - SetActionMode( OBJECT_SELF, ACTION_MODE_DEFENSIVE_CAST, iDefCast ); - ActionCastSpellAtObject( iSpell, oTarget, iMetaMagic, iCheat, iDomainLevel, iProjectilePathType, iInstantSpell ); + int iLevel = 14; + int iConc = GetCombatConcentration(); + int iDefCast = FALSE; + + if ( iDefensive == TRUE && iConc >= iLevel && GetHostileCount( 5.0 ) > 0 ) + { + iDefCast = TRUE; + } + SetActionMode( OBJECT_SELF, ACTION_MODE_DEFENSIVE_CAST, iDefCast ); + ActionCastSpellAtObject( iSpell, oTarget, iMetaMagic, iCheat, iDomainLevel, iProjectilePathType, iInstantSpell ); } void NO_ActionUseTalentAtLocation( talent tChosenTalent, location lTargetLocation, int iDefensive=TRUE ) { - int iLevel = 14; - int iConc = GetCombatConcentration(); - int iDefCast = FALSE; - - if ( iDefensive == TRUE && iConc >= iLevel && GetHostileCount( 5.0 ) > 0 ) - { - iDefCast = TRUE; - } - SetActionMode( OBJECT_SELF, ACTION_MODE_DEFENSIVE_CAST, iDefCast ); - ActionUseTalentAtLocation( tChosenTalent, lTargetLocation ); + int iLevel = 14; + int iConc = GetCombatConcentration(); + int iDefCast = FALSE; + + if ( iDefensive == TRUE && iConc >= iLevel && GetHostileCount( 5.0 ) > 0 ) + { + iDefCast = TRUE; + } + SetActionMode( OBJECT_SELF, ACTION_MODE_DEFENSIVE_CAST, iDefCast ); + ActionUseTalentAtLocation( tChosenTalent, lTargetLocation ); } void NO_ActionUseTalentOnObject( talent tChosenTalent, object oTarget, int iDefensive=TRUE ) { - int iLevel = 14; - int iConc = GetCombatConcentration(); - int iDefCast = FALSE; - - if ( iDefensive == TRUE && iConc >= iLevel && GetHostileCount( 5.0 ) > 0 ) - { - iDefCast = TRUE; - } - SetActionMode( OBJECT_SELF, ACTION_MODE_DEFENSIVE_CAST, iDefCast ); - ActionUseTalentOnObject( tChosenTalent, oTarget ); + int iLevel = 14; + int iConc = GetCombatConcentration(); + int iDefCast = FALSE; + + if ( iDefensive == TRUE && iConc >= iLevel && GetHostileCount( 5.0 ) > 0 ) + { + iDefCast = TRUE; + } + SetActionMode( OBJECT_SELF, ACTION_MODE_DEFENSIVE_CAST, iDefCast ); + ActionUseTalentOnObject( tChosenTalent, oTarget ); } void ActivateCombatMode( int iMode=0, object oE=OBJECT_SELF ) { - int iM = 0; - - switch( iMode ) - { - case FEAT_DIRTY_FIGHTING: - iM = ACTION_MODE_DIRTY_FIGHTING; - break; - case FEAT_EXPERTISE: - iM = ACTION_MODE_EXPERTISE; - break; - case FEAT_IMPROVED_EXPERTISE: - iM = ACTION_MODE_IMPROVED_EXPERTISE; - break; - case FEAT_FLURRY_OF_BLOWS: - iM = ACTION_MODE_FLURRY_OF_BLOWS; - break; - case FEAT_POWER_ATTACK: - iM = ACTION_MODE_POWER_ATTACK; - break; - case FEAT_IMPROVED_POWER_ATTACK: - iM = ACTION_MODE_IMPROVED_POWER_ATTACK; - break; - case FEAT_RAPID_SHOT: - iM = ACTION_MODE_RAPID_SHOT; - break; - } - if ( GetActionMode( oE, iM ) == FALSE ) - { - SetActionMode( oE, iM, TRUE ); - } + int iM = 0; + + switch( iMode ) + { + case FEAT_DIRTY_FIGHTING: + iM = ACTION_MODE_DIRTY_FIGHTING; + break; + case FEAT_EXPERTISE: + iM = ACTION_MODE_EXPERTISE; + break; + case FEAT_IMPROVED_EXPERTISE: + iM = ACTION_MODE_IMPROVED_EXPERTISE; + break; + case FEAT_FLURRY_OF_BLOWS: + iM = ACTION_MODE_FLURRY_OF_BLOWS; + break; + case FEAT_POWER_ATTACK: + iM = ACTION_MODE_POWER_ATTACK; + break; + case FEAT_IMPROVED_POWER_ATTACK: + iM = ACTION_MODE_IMPROVED_POWER_ATTACK; + break; + case FEAT_RAPID_SHOT: + iM = ACTION_MODE_RAPID_SHOT; + break; + } + if ( GetActionMode( oE, iM ) == FALSE ) + { + SetActionMode( oE, iM, TRUE ); + } } void DeactivateCombatModes( int iException=0, object oE=OBJECT_SELF ) { - if ( iException != FEAT_DIRTY_FIGHTING && GetActionMode( oE, ACTION_MODE_DIRTY_FIGHTING ) == TRUE ) - { - SetActionMode( oE, ACTION_MODE_DIRTY_FIGHTING, FALSE ); - } - if ( iException != FEAT_EXPERTISE && GetActionMode( oE, ACTION_MODE_EXPERTISE ) == TRUE ) - { - SetActionMode( oE, ACTION_MODE_EXPERTISE, FALSE ); - } - if ( iException != FEAT_IMPROVED_EXPERTISE && GetActionMode( oE, ACTION_MODE_IMPROVED_EXPERTISE ) == TRUE ) - { - SetActionMode( oE, ACTION_MODE_IMPROVED_EXPERTISE, FALSE ); - } - if ( iException != FEAT_FLURRY_OF_BLOWS && GetActionMode( oE, ACTION_MODE_FLURRY_OF_BLOWS ) == TRUE ) - { - SetActionMode( oE, ACTION_MODE_FLURRY_OF_BLOWS, FALSE ); - } - if ( iException != FEAT_POWER_ATTACK && GetActionMode( oE, ACTION_MODE_POWER_ATTACK ) == TRUE ) - { - SetActionMode( oE, ACTION_MODE_POWER_ATTACK, FALSE ); - } - if ( iException != FEAT_IMPROVED_POWER_ATTACK && GetActionMode( oE, ACTION_MODE_IMPROVED_POWER_ATTACK ) == TRUE ) - { - SetActionMode( oE, ACTION_MODE_IMPROVED_POWER_ATTACK, FALSE ); - } - if ( iException != FEAT_RAPID_SHOT && GetActionMode( oE, ACTION_MODE_RAPID_SHOT ) == TRUE ) - { - SetActionMode( oE, ACTION_MODE_RAPID_SHOT, FALSE ); - } + if ( iException != FEAT_DIRTY_FIGHTING && GetActionMode( oE, ACTION_MODE_DIRTY_FIGHTING ) == TRUE ) + { + SetActionMode( oE, ACTION_MODE_DIRTY_FIGHTING, FALSE ); + } + if ( iException != FEAT_EXPERTISE && GetActionMode( oE, ACTION_MODE_EXPERTISE ) == TRUE ) + { + SetActionMode( oE, ACTION_MODE_EXPERTISE, FALSE ); + } + if ( iException != FEAT_IMPROVED_EXPERTISE && GetActionMode( oE, ACTION_MODE_IMPROVED_EXPERTISE ) == TRUE ) + { + SetActionMode( oE, ACTION_MODE_IMPROVED_EXPERTISE, FALSE ); + } + if ( iException != FEAT_FLURRY_OF_BLOWS && GetActionMode( oE, ACTION_MODE_FLURRY_OF_BLOWS ) == TRUE ) + { + SetActionMode( oE, ACTION_MODE_FLURRY_OF_BLOWS, FALSE ); + } + if ( iException != FEAT_POWER_ATTACK && GetActionMode( oE, ACTION_MODE_POWER_ATTACK ) == TRUE ) + { + SetActionMode( oE, ACTION_MODE_POWER_ATTACK, FALSE ); + } + if ( iException != FEAT_IMPROVED_POWER_ATTACK && GetActionMode( oE, ACTION_MODE_IMPROVED_POWER_ATTACK ) == TRUE ) + { + SetActionMode( oE, ACTION_MODE_IMPROVED_POWER_ATTACK, FALSE ); + } + if ( iException != FEAT_RAPID_SHOT && GetActionMode( oE, ACTION_MODE_RAPID_SHOT ) == TRUE ) + { + SetActionMode( oE, ACTION_MODE_RAPID_SHOT, FALSE ); + } } int DoHideInPlainSight( object oE=OBJECT_SELF ) { - if ( GetHasFeat( FEAT_HIDE_IN_PLAIN_SIGHT, oE ) ) - { - SetActionMode( oE, ACTION_MODE_STEALTH, TRUE ); - return TRUE; - } - return FALSE; + if ( GetHasFeat( FEAT_HIDE_IN_PLAIN_SIGHT, oE ) ) + { + SetActionMode( oE, ACTION_MODE_STEALTH, TRUE ); + return TRUE; + } + return FALSE; } void DoFireBeholderRay( int iS, object oT ) { - if ( iS < 776 || iS > 784 || iS == 781 || iS == 782 ) //not a valid beholder ray spell definition - { - return; - } - - if ( TouchAttackRanged( oT ) == FALSE ) - { - vector vT; - location lT; - int iF = 785 + Random( 3 ); - - vT = GetPosition( oT ) + 1.0 * AngleToVector( IntToFloat( Random( 360 ) ) ); - lT = Location( GetArea( OBJECT_SELF ), vT, GetFacing( OBJECT_SELF ) ); - //ActionCastFakeSpellAtLocation( iS, lT ); - ActionCastSpellAtLocation( iF, lT, METAMAGIC_ANY, TRUE, PROJECTILE_PATH_TYPE_DEFAULT, TRUE ); - } - else - { - ActionCastSpellAtObject( iS, oT, METAMAGIC_ANY, TRUE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE ); - } + if ( iS < 776 || iS > 784 || iS == 781 || iS == 782 ) //not a valid beholder ray spell definition + { + return; + } + + if ( TouchAttackRanged( oT ) == FALSE ) + { + vector vT; + location lT; + int iF = 785 + Random( 3 ); + + vT = GetPosition( oT ) + 1.0 * AngleToVector( IntToFloat( Random( 360 ) ) ); + lT = Location( GetArea( OBJECT_SELF ), vT, GetFacing( OBJECT_SELF ) ); + //ActionCastFakeSpellAtLocation( iS, lT ); + ActionCastSpellAtLocation( iF, lT, METAMAGIC_ANY, TRUE, PROJECTILE_PATH_TYPE_DEFAULT, TRUE ); + } + else + { + ActionCastSpellAtObject( iS, oT, METAMAGIC_ANY, TRUE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE ); + } } void DoMoveToLocation( location lDest, int bRun=FALSE ) @@ -163,8 +164,8 @@ void DoMoveToLocation( location lDest, int bRun=FALSE ) float fD = 4.0; float fMinDist = 15.0; - //activate hide in plain sight while moving - DoHideInPlainSight(); + //activate hide in plain sight while moving + DoHideInPlainSight(); if ( GetLocalInt( OBJECT_SELF, "TELEPORTER" ) && GetDistanceBetweenLocations( GetLocation( OBJECT_SELF ), lDest ) > fMinDist ) { @@ -172,11 +173,11 @@ void DoMoveToLocation( location lDest, int bRun=FALSE ) } else if ( GetLocalInt( OBJECT_SELF, "FLIER" ) && GetDistanceBetweenLocations( GetLocation( OBJECT_SELF ), lDest ) > fMinDist ) { - if ( !GetLocalInt( OBJECT_SELF, "DRAGONFLIGHTDEL" ) ) - { - SetLocalInt( OBJECT_SELF, "DRAGONFLIGHTDEL", 1 ); - DelayCommand( fD + 0.5, DeleteLocalInt( OBJECT_SELF, "DRAGONFLIGHTDEL" ) ); - ApplyEffectToObject( DURATION_TYPE_TEMPORARY, EffectDisappearAppear( lDest ), OBJECT_SELF, fD ); + if ( !GetLocalInt( OBJECT_SELF, "DRAGONFLIGHTDEL" ) ) + { + SetLocalInt( OBJECT_SELF, "DRAGONFLIGHTDEL", 1 ); + DelayCommand( fD + 0.5, DeleteLocalInt( OBJECT_SELF, "DRAGONFLIGHTDEL" ) ); + ApplyEffectToObject( DURATION_TYPE_TEMPORARY, EffectDisappearAppear( lDest ), OBJECT_SELF, fD ); } } else @@ -192,8 +193,8 @@ void DoMoveToObject( object oDest, int bRun=FALSE, float fDist=1.0f ) float fD = 4.0; float fMinDist = 15.0; - //activate hide in plain sight while moving - DoHideInPlainSight(); + //activate hide in plain sight while moving + DoHideInPlainSight(); if ( GetIsObjectValid( oDest ) ) { @@ -205,13 +206,13 @@ void DoMoveToObject( object oDest, int bRun=FALSE, float fDist=1.0f ) } else if ( GetLocalInt( OBJECT_SELF, "FLIER" ) && GetDistanceBetweenLocations( GetLocation( OBJECT_SELF ), GetLocation( oDest ) ) > fMinDist ) { - if ( !GetLocalInt( OBJECT_SELF, "DRAGONFLIGHTDEL" ) ) - { - vT = GetPosition( oDest ) + fDist * VectorNormalize( GetPosition( OBJECT_SELF ) - GetPosition( oDest ) ); - lDest = Location( GetArea( oDest ), vT, VectorToAngle( GetPosition( oDest ) - vT ) ); - SetLocalInt( OBJECT_SELF, "DRAGONFLIGHTDEL", 1 ); - DelayCommand( fD + 0.5, DeleteLocalInt( OBJECT_SELF, "DRAGONFLIGHTDEL" ) ); - ApplyEffectToObject( DURATION_TYPE_TEMPORARY, EffectDisappearAppear( lDest ), OBJECT_SELF, fD ); + if ( !GetLocalInt( OBJECT_SELF, "DRAGONFLIGHTDEL" ) ) + { + vT = GetPosition( oDest ) + fDist * VectorNormalize( GetPosition( OBJECT_SELF ) - GetPosition( oDest ) ); + lDest = Location( GetArea( oDest ), vT, VectorToAngle( GetPosition( oDest ) - vT ) ); + SetLocalInt( OBJECT_SELF, "DRAGONFLIGHTDEL", 1 ); + DelayCommand( fD + 0.5, DeleteLocalInt( OBJECT_SELF, "DRAGONFLIGHTDEL" ) ); + ApplyEffectToObject( DURATION_TYPE_TEMPORARY, EffectDisappearAppear( lDest ), OBJECT_SELF, fD ); } } else @@ -237,31 +238,31 @@ object GetTarget() object oH = GetNearestCreature( CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_HEARD, CREATURE_TYPE_IS_ALIVE, TRUE ); object oT = OBJECT_INVALID; - if ( !GetIsPerceived( oS, NO_PERCEPTION_SEEN ) ) - { - oS = OBJECT_INVALID; - } - if ( !GetIsPerceived( oH, NO_PERCEPTION_HEARD ) ) - { - oH = OBJECT_INVALID; - } - - if ( GetIsObjectValid( oS ) && GetIsObjectValid( oH ) ) - { - //target the closer of the two - oT = GetDistanceBetween( OBJECT_SELF, oH ) < GetDistanceBetween( OBJECT_SELF, oS ) ? oH : oS; - } - else if ( GetIsObjectValid( oS ) ) - { - //oH is invalid - oT = oS; - } - else - { - //oS is invalid - oT = oH; - } - return oT; + if ( !GetIsPerceived( oS, NO_PERCEPTION_SEEN ) ) + { + oS = OBJECT_INVALID; + } + if ( !GetIsPerceived( oH, NO_PERCEPTION_HEARD ) ) + { + oH = OBJECT_INVALID; + } + + if ( GetIsObjectValid( oS ) && GetIsObjectValid( oH ) ) + { + //target the closer of the two + oT = GetDistanceBetween( OBJECT_SELF, oH ) < GetDistanceBetween( OBJECT_SELF, oS ) ? oH : oS; + } + else if ( GetIsObjectValid( oS ) ) + { + //oH is invalid + oT = oS; + } + else + { + //oS is invalid + oT = oH; + } + return oT; } float DotProduct( vector v1, vector v2 ) @@ -304,31 +305,31 @@ void DoEquipMelee( object oT ) { if ( GetIsObjectValid( oR ) ) { - if ( !GetIsObjectValid( GetItemPossessor( oR ) ) ) - { - //weapon is on the ground after being disarmed? - //try to pick it up - ActionPickUpItem( oR ); - ActionEquipItem( oR, INVENTORY_SLOT_RIGHTHAND ); - } - else if ( GetItemPossessor( oR ) == OBJECT_SELF && GetItemInSlot( INVENTORY_SLOT_RIGHTHAND ) != oR ) - { - ActionEquipItem( oR, INVENTORY_SLOT_RIGHTHAND ); - } + if ( !GetIsObjectValid( GetItemPossessor( oR ) ) ) + { + //weapon is on the ground after being disarmed? + //try to pick it up + ActionPickUpItem( oR ); + ActionEquipItem( oR, INVENTORY_SLOT_RIGHTHAND ); + } + else if ( GetItemPossessor( oR ) == OBJECT_SELF && GetItemInSlot( INVENTORY_SLOT_RIGHTHAND ) != oR ) + { + ActionEquipItem( oR, INVENTORY_SLOT_RIGHTHAND ); + } } if ( GetIsObjectValid( oL ) ) { - if ( !GetIsObjectValid( GetItemPossessor( oL ) ) ) - { - //weapon is on the ground after being disarmed? - //try to pick it up - ActionPickUpItem( oL ); - ActionEquipItem( oL, INVENTORY_SLOT_LEFTHAND ); - } - else if ( GetItemPossessor( oL ) == OBJECT_SELF && GetItemInSlot( INVENTORY_SLOT_LEFTHAND ) != oL ) - { - ActionEquipItem( oL, INVENTORY_SLOT_LEFTHAND ); - } + if ( !GetIsObjectValid( GetItemPossessor( oL ) ) ) + { + //weapon is on the ground after being disarmed? + //try to pick it up + ActionPickUpItem( oL ); + ActionEquipItem( oL, INVENTORY_SLOT_LEFTHAND ); + } + else if ( GetItemPossessor( oL ) == OBJECT_SELF && GetItemInSlot( INVENTORY_SLOT_LEFTHAND ) != oL ) + { + ActionEquipItem( oL, INVENTORY_SLOT_LEFTHAND ); + } } } else if ( GetIsObjectValid( oT ) ) @@ -344,23 +345,23 @@ void DoEquipMelee( object oT ) talent GetTalentSpell( int iCat, int iD ) { - int iCR = 21; - talent tT; - talent iT; //reserve for invalid talent return - - while ( --iCR ) - { - tT = GetCreatureTalentBest( iCat, iCR ); - if ( ( GetIsTalentValid( tT ) && GetIdFromTalent( tT ) == iD ) || !GetIsTalentValid( tT ) ) - { - break; - } - } - if ( GetIsTalentValid( tT ) && GetIdFromTalent( tT ) == iD ) - { - return tT; - } - return iT; + int iCR = 21; + talent tT; + talent iT; //reserve for invalid talent return + + while ( --iCR ) + { + tT = GetCreatureTalentBest( iCat, iCR ); + if ( ( GetIsTalentValid( tT ) && GetIdFromTalent( tT ) == iD ) || !GetIsTalentValid( tT ) ) + { + break; + } + } + if ( GetIsTalentValid( tT ) && GetIdFromTalent( tT ) == iD ) + { + return tT; + } + return iT; } @@ -373,17 +374,17 @@ void DoFightBroadcast() int iLast = GetLocalInt( OBJECT_SELF, "#LASTCREBC" ); int iS = iTime < iLast ? iTime + 60 : iTime; int iVol = NO_CAN_USE_DM_CHANNEL ? TALKVOLUME_SILENT_SHOUT : TALKVOLUME_SILENT_TALK; - + //anti-spamloop delay if ( iS - iLast >= iDelay ) { - //only broadcast noise if silence is not in effect - if ( !( GetEffectsOnObject() & NO_EFFECT_SILENCE ) ) - { - SpeakString( "BC_FIGHTING", iVol ); - } - SetLocalInt( OBJECT_SELF, "#LASTCREBC", iTime ); - DeleteLocalInt( OBJECT_SELF, "#LASTREST" ); + //only broadcast noise if silence is not in effect + if ( !( GetEffectsOnObject() & NO_EFFECT_SILENCE ) ) + { + SpeakString( "BC_FIGHTING", iVol ); + } + SetLocalInt( OBJECT_SELF, "#LASTCREBC", iTime ); + DeleteLocalInt( OBJECT_SELF, "#LASTREST" ); } } @@ -399,102 +400,102 @@ int GetTimeSinceLastCombat() void DoConditionalRestart( float fT=6.0 ) { - DeleteLocalInt( OBJECT_SELF, "#RESTARTQUEUED" ); - if ( GetLocalInt( OBJECT_SELF, "#ACTIVE" ) && GetTimeSinceLastCombat() > FloatToInt( fT ) ) - { - ClearAllActions(); - DeleteLocalInt( OBJECT_SELF, "#COMBATQUEUED" ); - //SetReadyStatus(); - DelayCommand( 0.1, DoQueueCombat( 8.0, 8.0 ) ); - } + DeleteLocalInt( OBJECT_SELF, "#RESTARTQUEUED" ); + if ( GetLocalInt( OBJECT_SELF, "#ACTIVE" ) && GetTimeSinceLastCombat() > FloatToInt( fT ) ) + { + ClearAllActions(); + DeleteLocalInt( OBJECT_SELF, "#COMBATQUEUED" ); + //SetReadyStatus(); + DelayCommand( 0.1, DoQueueCombat( 8.0, 8.0 ) ); + } } void DoQueueShutdown( float fT=0.0 ) { - if ( !GetLocalInt( OBJECT_SELF, "#QUEUESHUTDOWN" ) ) - { - SetLocalInt( OBJECT_SELF, "#QUEUESHUTDOWN", 1 ); - DelayCommand( fT, ExecuteScript( "no_scr_shutdown", OBJECT_SELF ) ); - } + if ( !GetLocalInt( OBJECT_SELF, "#QUEUESHUTDOWN" ) ) + { + SetLocalInt( OBJECT_SELF, "#QUEUESHUTDOWN", 1 ); + DelayCommand( fT, ExecuteScript( "no_scr_shutdown", OBJECT_SELF ) ); + } } void DoQueueCombat( float fD=6.0, float fT=6.0 ) { - if ( !GetLocalInt( OBJECT_SELF, "#ACTIVE" ) ) - { - SetLocalInt( OBJECT_SELF, "#ACTIVE", 1 ); - DelayCommand( 0.1, ClearAllActions() ); - } - if ( !GetLocalInt( OBJECT_SELF, "#COMBATQUEUED" ) ) - { - SetLocalInt( OBJECT_SELF, "#COMBATQUEUED", 1 ); - DelayCommand( 0.2, ActionDoCommand( DoCombat() ) ); - } - if ( !GetLocalInt( OBJECT_SELF, "#RESTARTQUEUED" ) ) - { - SetLocalInt( OBJECT_SELF, "#RESTARTQUEUED", 1 ); - DelayCommand( fD, DoConditionalRestart( fT ) ); - } + if ( !GetLocalInt( OBJECT_SELF, "#ACTIVE" ) ) + { + SetLocalInt( OBJECT_SELF, "#ACTIVE", 1 ); + DelayCommand( 0.1, ClearAllActions() ); + } + if ( !GetLocalInt( OBJECT_SELF, "#COMBATQUEUED" ) ) + { + SetLocalInt( OBJECT_SELF, "#COMBATQUEUED", 1 ); + DelayCommand( 0.2, ActionDoCommand( DoCombat() ) ); + } + if ( !GetLocalInt( OBJECT_SELF, "#RESTARTQUEUED" ) ) + { + SetLocalInt( OBJECT_SELF, "#RESTARTQUEUED", 1 ); + DelayCommand( fD, DoConditionalRestart( fT ) ); + } } void InitCombat( object oE=OBJECT_INVALID ) { - int iT = GetLastActionTimestamp(); - - if ( IsActive() == FALSE || GetCurrentAction() == ACTION_INVALID || iT > 8 ) - { - ClearAllActions(); - SetIsActive( TRUE ); - DoCombat(); - } -} + int iT = GetLastActionTimestamp(); + + if ( IsActive() == FALSE || GetCurrentAction() == ACTION_INVALID || iT > 8 ) + { + ClearAllActions(); + SetIsActive( TRUE ); + DoCombat(); + } +} void DoVoiceChat( int iV=-1 ) { - int iC = GetLocalInt( OBJECT_SELF, "#VCC_" + IntToString( iV ) ); + int iC = GetLocalInt( OBJECT_SELF, "#VCC_" + IntToString( iV ) ); - if ( iC == -1 || !CanAct() ) - { - //do not do this voice chat - return; - } - if ( iC == 0 ) - { - //no specific setting for this voice chat, use default chance - iC = GetLocalInt( OBJECT_SELF, "#VCC" ); - } - if ( Random( 100 ) < iC ) - { - //don't bother talking to ourselves, look for a nearby friend - object oF = GetNearestCreature( CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_FRIEND, OBJECT_SELF, 1, CREATURE_TYPE_IS_ALIVE, TRUE ); - if ( GetIsObjectValid( oF ) && GetDistanceBetween( OBJECT_SELF, oF ) < 50.0 ) - { - //there is a friendly nearby, do the voice chat - int iD = iV; - if ( iV == NO_VC_MELEE || iV == NO_VC_RANGED || iV == NO_VC_MELEEASSIST ) - { - //custom voice chat handling - iD = Random( 5 ); - switch( iD ) - { - case 1: iD = VOICE_CHAT_ATTACK; - case 2: iD = VOICE_CHAT_BATTLECRY1; - case 3: iD = VOICE_CHAT_BATTLECRY2; - case 4: iD = VOICE_CHAT_BATTLECRY3; - default: iD = VOICE_CHAT_TAUNT; - } - } - PlayVoiceChat( iD ); - } - } + if ( iC == -1 || !CanAct() ) + { + //do not do this voice chat + return; + } + if ( iC == 0 ) + { + //no specific setting for this voice chat, use default chance + iC = GetLocalInt( OBJECT_SELF, "#VCC" ); + } + if ( Random( 100 ) < iC ) + { + //don't bother talking to ourselves, look for a nearby friend + object oF = GetNearestCreature( CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_FRIEND, OBJECT_SELF, 1, CREATURE_TYPE_IS_ALIVE, TRUE ); + if ( GetIsObjectValid( oF ) && GetDistanceBetween( OBJECT_SELF, oF ) < 50.0 ) + { + //there is a friendly nearby, do the voice chat + int iD = iV; + if ( iV == NO_VC_MELEE || iV == NO_VC_RANGED || iV == NO_VC_MELEEASSIST ) + { + //custom voice chat handling + iD = Random( 5 ); + switch( iD ) + { + case 1: iD = VOICE_CHAT_ATTACK; + case 2: iD = VOICE_CHAT_BATTLECRY1; + case 3: iD = VOICE_CHAT_BATTLECRY2; + case 4: iD = VOICE_CHAT_BATTLECRY3; + default: iD = VOICE_CHAT_TAUNT; + } + } + PlayVoiceChat( iD ); + } + } } void DoMainCombatLoop() { - int iCnt = 1; + int iCnt = 1; string sPri = GetPriority( iCnt ); int iPri = GetPriorityChance( iCnt++ ); - + while ( sPri != "" ) { if ( sPri == "+ATKMELEE" && Random( 100 ) < iPri && DoAttackMelee() ) //atkmelee @@ -785,6 +786,33 @@ void DoMainCombatLoop() //SetLastActionTimestamp(); break; } + else if ( sPri == "+EN4INVIS" && Random( 100 ) < iPri && DoEN4Invis() ) + { + SetLastAction( sPri ); + break; + } + else if ( sPri == "+EN4DMGSHIELD" && Random( 100 ) < iPri && DoEN4DmgShield() ) + { + SetLastAction( sPri ); + break; + } + else if ( sPri == "+UNDEADHEAL" && Random( 100 ) < iPri && DoSpellUndeadHeal() ) //heal + { + //PrintString( "+HEAL: " + GetName( OBJECT_SELF ) ); + //return; + SetLastAction( sPri ); + //SetLastActionTimestamp(); + break; + } + else if ( sPri == "+UNDEADHEALSELF" && Random( 100 ) < iPri && DoUndeadHealSelf() ) //heal self + { + //PrintString( "+HEALSELF: " + GetName( OBJECT_SELF ) ); + //return; + SetLastAction( sPri ); + //SetLastActionTimestamp(); + break; + } + sPri = GetPriority( iCnt ); iPri = GetPriorityChance( iCnt++ ); } @@ -796,21 +824,21 @@ void DoCombat() //int iTime, iLast, iDiff; int iAct; float fDelay = 0.0; - - //delete queue marker + + //delete queue marker DeleteLocalInt( OBJECT_SELF, "#COMBATQUEUED" ); - + if ( GetIsDead( OBJECT_SELF ) ) { - return; + return; } - //int iE = GetHostileCount( 50.0 ); - int iE = GetOmniscientHostileCount( 50.0 ); - if ( iE == 0 ) - { - return; - } + //int iE = GetHostileCount( 50.0 ); + int iE = GetOmniscientHostileCount( 50.0 ); + if ( iE == 0 ) + { + return; + } //make combat noise for nearby listeners DoFightBroadcast(); @@ -826,29 +854,29 @@ void DoCombat() } else { - //can take action - //If creature is busy do not proceed - iAct = GetCurrentAction(); - if ( iAct == ACTION_CASTSPELL || iAct == ACTION_HEAL || iAct == ACTION_ITEMCASTSPELL || iAct == ACTION_PICKUPITEM || iAct == ACTION_WAIT || - GetLocalInt( OBJECT_SELF, "#EYERAYS" ) == 1 ) - { - //do nothing - } - else - { - //run the combat response table - ClearAllActions(); - DoMainCombatLoop(); - SetLastActionTimestamp(); - } - } - DoHideInPlainSight(); //testing HIPS between actions + //can take action + //If creature is busy do not proceed + iAct = GetCurrentAction(); + if ( iAct == ACTION_CASTSPELL || iAct == ACTION_HEAL || iAct == ACTION_ITEMCASTSPELL || iAct == ACTION_PICKUPITEM || iAct == ACTION_WAIT || + GetLocalInt( OBJECT_SELF, "#EYERAYS" ) == 1 ) + { + //do nothing + } + else + { + //run the combat response table + ClearAllActions(); + DoMainCombatLoop(); + SetLastActionTimestamp(); + } + } + DoHideInPlainSight(); //testing HIPS between actions - if ( !CanAct() || ShortAction() ) - { - //DoQueueCombat( 8.0, 8.0 ); - fDelay += 0.1; - DelayCommand( fDelay, ActionDoCommand( DoCombat() ) ); + if ( !CanAct() || ShortAction() ) + { + //DoQueueCombat( 8.0, 8.0 ); + fDelay += 0.1; + DelayCommand( fDelay, ActionDoCommand( DoCombat() ) ); } } @@ -865,11 +893,11 @@ int DoAttackMelee( object oT=OBJECT_INVALID ) vector vT, vU; object test; - if ( GetIsObjectValid( oT ) ) - { - oTarget = oT; - } - else if ( iMelee ) + if ( GetIsObjectValid( oT ) ) + { + oTarget = oT; + } + else if ( iMelee ) { oTarget = GetNearestCreature( CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, iCnt++, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN, CREATURE_TYPE_IS_ALIVE, TRUE ); while ( GetIsObjectValid( oTarget ) && GetDistanceBetween( OBJECT_SELF, oTarget ) <= 5.0 && GetAttackTarget( oTarget ) != OBJECT_SELF ) @@ -890,11 +918,11 @@ int DoAttackMelee( object oT=OBJECT_INVALID ) //combat modes if ( iMode = SelectMeleeCombatModes( oTarget ) ) { - iPen = GetCombatModeModifier( iMode ); - DeactivateCombatModes( iMode ); - ActivateCombatMode( iMode ); - //ActionUseFeat( iMode, oTarget ); - + iPen = GetCombatModeModifier( iMode ); + DeactivateCombatModes( iMode ); + ActivateCombatMode( iMode ); + //ActionUseFeat( iMode, oTarget ); + } //special melee attacks if ( iSpecial = GetBestMeleeSpecial( oTarget, iPen ) ) @@ -918,7 +946,7 @@ int DoAttackMelee( object oT=OBJECT_INVALID ) } if ( GetIsObjectValid( oTarget ) && GetDistanceBetween( OBJECT_SELF, oTarget ) <= 40.0 ) { - /* + /* vU = GetPosition( OBJECT_SELF ); vT = GetPosition( oTarget ) - vU; vT = VectorMagnitude( vT ) * VectorNormalize( AngleToVector( VectorToAngle( vT ) - 45.0 + IntToFloat( Random( 90 ) ) ) ); @@ -944,33 +972,33 @@ int DoAttackRanged( object oT=OBJECT_INVALID ) int iChat; location lLoc; - //don't proceed if enemies are close - //if creature should avoid melee that should be added as a priority - //above this behaviour - if ( GetHostileCount( 5.0 ) ) - { - return FALSE; - } + //don't proceed if enemies are close + //if creature should avoid melee that should be added as a priority + //above this behaviour + if ( GetHostileCount( 5.0 ) ) + { + return FALSE; + } + + //raging barbarians should not use ranged attack + if ( GetHasFeatEffect( FEAT_BARBARIAN_RAGE, OBJECT_SELF ) || GetHasFeatEffect( FEAT_MIGHTY_RAGE, OBJECT_SELF ) ) + { + //raging barbarians should skip ranged + return FALSE; + } + + if ( !GetLocalInt( OBJECT_SELF, "#RANGEDCAPABLE" ) ) + { + if ( !GetHasRangedCapability() ) + { + return FALSE; + } + SetLocalInt( OBJECT_SELF, "#RANGEDCAPABLE", 1 ); + } - //raging barbarians should not use ranged attack - if ( GetHasFeatEffect( FEAT_BARBARIAN_RAGE, OBJECT_SELF ) || GetHasFeatEffect( FEAT_MIGHTY_RAGE, OBJECT_SELF ) ) - { - //raging barbarians should skip ranged - return FALSE; - } - - if ( !GetLocalInt( OBJECT_SELF, "#RANGEDCAPABLE" ) ) - { - if ( !GetHasRangedCapability() ) - { - return FALSE; - } - SetLocalInt( OBJECT_SELF, "#RANGEDCAPABLE", 1 ); - } - if ( GetIsObjectValid( oTarget ) && !iAtk ) { - /* This should be done explicitly with the avoid melee behaviour + /* This should be done explicitly with the avoid melee behaviour if ( GetHostileCount( 5.0 ) ) { if ( DoAvoidMelee() ) @@ -984,11 +1012,11 @@ int DoAttackRanged( object oT=OBJECT_INVALID ) //PrintString( GetName( OBJECT_SELF ) + " ranged attack " + GetName( oTarget ) + ": " + IntToString( iAtk ) + FloatToString( GetDistanceBetween( OBJECT_SELF, oTarget ) ) ); if ( !GetIsObjectValid( oT ) ) //not specifically told to attack a target { - if ( DoAbilityCheck( ABILITY_INTELLIGENCE, 5 ) && - GetIsObjectValid( oHurt = GetMostDamagedAlly( 20.0, oTarget, TRUE ) ) ) - { - oTarget = oHurt; - } + if ( DoAbilityCheck( ABILITY_INTELLIGENCE, 5 ) && + GetIsObjectValid( oHurt = GetMostDamagedAlly( 20.0, oTarget, TRUE ) ) ) + { + oTarget = oHurt; + } } ActionEquipMostDamagingRanged( oTarget ); @@ -996,10 +1024,10 @@ int DoAttackRanged( object oT=OBJECT_INVALID ) //combat modes if ( iMode = SelectRangedCombatModes( oTarget ) ) { - iPen = GetCombatModeModifier( iMode ); - DeactivateCombatModes( iMode ); - ActivateCombatMode( iMode ); - ActionUseFeat( iMode, oTarget ); + iPen = GetCombatModeModifier( iMode ); + DeactivateCombatModes( iMode ); + ActivateCombatMode( iMode ); + ActionUseFeat( iMode, oTarget ); } //special ranged attacks if ( iSpecial = GetBestRangedSpecial( oTarget, iPen ) ) @@ -1072,13 +1100,13 @@ int DoRegroup( object oT=OBJECT_INVALID ) vector vU, vT, vM; location lLoc; - //check for order to regroup to a particular object - if ( GetIsObjectValid( oT ) ) - { - DoMoveToObject( oT, TRUE, 5.0 ); - return TRUE; - } - + //check for order to regroup to a particular object + if ( GetIsObjectValid( oT ) ) + { + DoMoveToObject( oT, TRUE, 5.0 ); + return TRUE; + } + //don't bother if we have time stop if ( GetHasSpellEffect( SPELL_TIME_STOP ) ) { @@ -1099,16 +1127,16 @@ int DoRegroup( object oT=OBJECT_INVALID ) vT = vT / IntToFloat( iCnt - 1 ); } - if ( VectorMagnitude( vT ) == 0.0 ) - { - oFriend = GetNearestCreature( CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_FRIEND, OBJECT_SELF, 1, CREATURE_TYPE_IS_ALIVE, TRUE ); - if ( GetIsObjectValid( oFriend ) && GetDistanceBetween( OBJECT_SELF, oFriend ) < 60.0 /*&& GetDistanceBetween( OBJECT_SELF, oFriend ) > 30.0*/ ) - { - //we do have friends nearby but can't see them - DoMoveToLocation( GetLocation( oFriend ), TRUE ); - return TRUE; - } - } + if ( VectorMagnitude( vT ) == 0.0 ) + { + oFriend = GetNearestCreature( CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_FRIEND, OBJECT_SELF, 1, CREATURE_TYPE_IS_ALIVE, TRUE ); + if ( GetIsObjectValid( oFriend ) && GetDistanceBetween( OBJECT_SELF, oFriend ) < 60.0 /*&& GetDistanceBetween( OBJECT_SELF, oFriend ) > 30.0*/ ) + { + //we do have friends nearby but can't see them + DoMoveToLocation( GetLocation( oFriend ), TRUE ); + return TRUE; + } + } if ( VectorMagnitude( vT ) > 25.0 ) { if ( DoAbilityCheck( ABILITY_INTELLIGENCE, 5 ) ) @@ -1211,46 +1239,46 @@ int DoDefendSelf() int DoDefendSingle( object oT=OBJECT_INVALID ) { - object oD; - int iSpell; - struct sSpellDefStatus strM; - struct sPhysDefStatus strP; - - oD = ( GetIsObjectValid( oT ) ) ? oT : GetLeastDefendedAlly( 20.0 ); - if ( GetIsObjectValid( oD ) ) - { - strM = EvaluateSpellDefenses( oD ); - strP = EvaluatePhysicalDefenses( oD ); - if ( strM.iTotal < strP.iTotal ) - { - if ( iSpell = GetBestMagicDefenseSingle( oD ) ) - { - //PrintString( "DDSM: " + GetName( OBJECT_SELF ) + " -> " + GetName( oD ) + " (" + IntToString( iSpell ) + ")" ); - //ActionCastSpellAtObject( iSpell, oD ); - NO_ActionCastSpellAtObject( iSpell, oD ); - return TRUE; - } - } - else - { - //strP.iTotal <= strM.iTotal - if ( iSpell = GetBestPhysDefenseSingle( oD ) ) - { - //PrintString( "DDSP: " + GetName( OBJECT_SELF ) + " -> " + GetName( oD ) + " (" + IntToString( iSpell ) + ")" ); - //ActionCastSpellAtObject( iSpell, oD ); - NO_ActionCastSpellAtObject( iSpell, oD ); - return TRUE; - } - } - } - return FALSE; + object oD; + int iSpell; + struct sSpellDefStatus strM; + struct sPhysDefStatus strP; + + oD = ( GetIsObjectValid( oT ) ) ? oT : GetLeastDefendedAlly( 20.0 ); + if ( GetIsObjectValid( oD ) ) + { + strM = EvaluateSpellDefenses( oD ); + strP = EvaluatePhysicalDefenses( oD ); + if ( strM.iTotal < strP.iTotal ) + { + if ( iSpell = GetBestMagicDefenseSingle( oD ) ) + { + //PrintString( "DDSM: " + GetName( OBJECT_SELF ) + " -> " + GetName( oD ) + " (" + IntToString( iSpell ) + ")" ); + //ActionCastSpellAtObject( iSpell, oD ); + NO_ActionCastSpellAtObject( iSpell, oD ); + return TRUE; + } + } + else + { + //strP.iTotal <= strM.iTotal + if ( iSpell = GetBestPhysDefenseSingle( oD ) ) + { + //PrintString( "DDSP: " + GetName( OBJECT_SELF ) + " -> " + GetName( oD ) + " (" + IntToString( iSpell ) + ")" ); + //ActionCastSpellAtObject( iSpell, oD ); + NO_ActionCastSpellAtObject( iSpell, oD ); + return TRUE; + } + } + } + return FALSE; } - + int DoEnhanceSelf() { - int iMinLvl = GetHitDice( OBJECT_SELF ); - iMinLvl = iMinLvl > 20 ? 20 : iMinLvl; - iMinLvl = iMinLvl / 3; + int iMinLvl = GetHitDice( OBJECT_SELF ); + iMinLvl = iMinLvl > 20 ? 20 : iMinLvl; + iMinLvl = iMinLvl / 3; int iSpell = GetEnhanceSpellSelf( iMinLvl ); vector vT, vU; location lM; @@ -1269,17 +1297,17 @@ int DoEnhanceSelf() NO_ActionCastSpellAtObject( iSpell, OBJECT_SELF ); if ( iSpell == SPELL_INVISIBILITY || iSpell == SPELL_IMPROVED_INVISIBILITY ) { - //move a bit after casting invisibility on self - if ( VectorMagnitude( vT = GetHostileVector( 10.0 ) ) > 0.0 ) - { - vU = GetPosition( OBJECT_SELF ); - vT = 5.0 * AngleToVector( VectorToAngle( vT ) + 90.0 + IntToFloat( Random( 180 ) ) ); - lM = Location( GetArea( OBJECT_SELF ), vU + vT, VectorToAngle( vT ) ); - DoMoveToLocation( lM, TRUE ); - vT = 5.0 * AngleToVector( VectorToAngle( vT ) - 90.0 + IntToFloat( Random( 180 ) ) ); - lM = Location( GetArea( OBJECT_SELF ), vU + vT, VectorToAngle( vT ) ); - DoMoveToLocation( lM, TRUE ); - } + //move a bit after casting invisibility on self + if ( VectorMagnitude( vT = GetHostileVector( 10.0 ) ) > 0.0 ) + { + vU = GetPosition( OBJECT_SELF ); + vT = 5.0 * AngleToVector( VectorToAngle( vT ) + 90.0 + IntToFloat( Random( 180 ) ) ); + lM = Location( GetArea( OBJECT_SELF ), vU + vT, VectorToAngle( vT ) ); + DoMoveToLocation( lM, TRUE ); + vT = 5.0 * AngleToVector( VectorToAngle( vT ) - 90.0 + IntToFloat( Random( 180 ) ) ); + lM = Location( GetArea( OBJECT_SELF ), vU + vT, VectorToAngle( vT ) ); + DoMoveToLocation( lM, TRUE ); + } } return TRUE; } @@ -1288,42 +1316,42 @@ int DoEnhanceSelf() int DoEnhanceSingle( object oT=OBJECT_INVALID ) { - int iMinLvl = GetHitDice( OBJECT_SELF ); - iMinLvl = iMinLvl > 20 ? 20 : iMinLvl; - iMinLvl = iMinLvl / 3; + int iMinLvl = GetHitDice( OBJECT_SELF ); + iMinLvl = iMinLvl > 20 ? 20 : iMinLvl; + iMinLvl = iMinLvl / 3; int iSpell = 0; vector vT, vU; location lM; - object oE = ( GetIsObjectValid( oT ) ) ? oT : GetLeastBuffedAlly( 20.0, TRUE ); - - if ( GetIsObjectValid( oE ) ) - { - if ( iSpell = GetEnhanceSpellSingle( iMinLvl, oE ) ) - { - //PrintString( "DES: " + GetName( OBJECT_SELF ) + " -> " + GetName( oE ) + " (" + IntToString( iSpell ) + ")" ); - //ActionCastSpellAtObject( iSpell, oE ); - NO_ActionCastSpellAtObject( iSpell, oE ); - return TRUE; - } - if ( oE == OBJECT_SELF ) - { - if ( iSpell == SPELL_INVISIBILITY || iSpell == SPELL_IMPROVED_INVISIBILITY ) - { - //move a bit after casting invisibility on self - if ( VectorMagnitude( vT = GetHostileVector( 10.0 ) ) > 0.0 ) - { - vU = GetPosition( OBJECT_SELF ); - vT = 5.0 * AngleToVector( VectorToAngle( vT ) + 90.0 + IntToFloat( Random( 180 ) ) ); - lM = Location( GetArea( OBJECT_SELF ), vU + vT, VectorToAngle( vT ) ); - DoMoveToLocation( lM, TRUE ); - vT = 5.0 * AngleToVector( VectorToAngle( vT ) - 90.0 + IntToFloat( Random( 180 ) ) ); - lM = Location( GetArea( OBJECT_SELF ), vU + vT, VectorToAngle( vT ) ); - DoMoveToLocation( lM, TRUE ); - } - } - } - } - return FALSE; + object oE = ( GetIsObjectValid( oT ) ) ? oT : GetLeastBuffedAlly( 20.0, TRUE ); + + if ( GetIsObjectValid( oE ) ) + { + if ( iSpell = GetEnhanceSpellSingle( iMinLvl, oE ) ) + { + //PrintString( "DES: " + GetName( OBJECT_SELF ) + " -> " + GetName( oE ) + " (" + IntToString( iSpell ) + ")" ); + //ActionCastSpellAtObject( iSpell, oE ); + NO_ActionCastSpellAtObject( iSpell, oE ); + return TRUE; + } + if ( oE == OBJECT_SELF ) + { + if ( iSpell == SPELL_INVISIBILITY || iSpell == SPELL_IMPROVED_INVISIBILITY ) + { + //move a bit after casting invisibility on self + if ( VectorMagnitude( vT = GetHostileVector( 10.0 ) ) > 0.0 ) + { + vU = GetPosition( OBJECT_SELF ); + vT = 5.0 * AngleToVector( VectorToAngle( vT ) + 90.0 + IntToFloat( Random( 180 ) ) ); + lM = Location( GetArea( OBJECT_SELF ), vU + vT, VectorToAngle( vT ) ); + DoMoveToLocation( lM, TRUE ); + vT = 5.0 * AngleToVector( VectorToAngle( vT ) - 90.0 + IntToFloat( Random( 180 ) ) ); + lM = Location( GetArea( OBJECT_SELF ), vU + vT, VectorToAngle( vT ) ); + DoMoveToLocation( lM, TRUE ); + } + } + } + } + return FALSE; } /* @@ -1336,8 +1364,8 @@ Notes: Problem with this behaviour is that it always looks for most hampered all it will not help anyone. If there are less hampered allies that it could help it will never know because it goes straight to the most hampered -Possible fix: First generate full list of possible help it can provide stored as bits and do bitwise AND against -effects on each ally. If there are no matches at all, do not consider them. Store the ally with the most matches +Possible fix: First generate full list of possible help it can provide stored as bits and do bitwise AND against +effects on each ally. If there are no matches at all, do not consider them. Store the ally with the most matches of available help vs hampering effects. Not yet tried. ==================== */ @@ -1381,17 +1409,17 @@ int DoSpellHeal( object oT=OBJECT_INVALID ) oHurt = ( GetIsObjectValid( oT ) ) ? oT : GetLowestHPAllyNoHealer( 30.0, iMin, OBJECT_SELF, TRUE ); if ( GetIsObjectValid( oHurt ) ) { - /* - // Need to use this hack with talents because GetHasSpell will pick up spontaneous casting ability - // but ActionCastSpell* cannot do the spontaneous casting, which leaves the creature daydreaming - // rather than acting - */ + /* + // Need to use this hack with talents because GetHasSpell will pick up spontaneous casting ability + // but ActionCastSpell* cannot do the spontaneous casting, which leaves the creature daydreaming + // rather than acting + */ iHeal = GetBestHeal( oHurt, iMin ); tHeal = GetTalentSpell( TALENT_CATEGORY_BENEFICIAL_HEALING_TOUCH, iHeal ); //if ( iHeal ) if ( GetIsTalentValid( tHeal ) ) { - //PrintString( "HEAL: " + GetName( OBJECT_SELF ) + " -> " + GetName( oHurt ) + " (" + IntToString( iHeal ) + ")" ); + //PrintString( "HEAL: " + GetName( OBJECT_SELF ) + " -> " + GetName( oHurt ) + " (" + IntToString( iHeal ) + ")" ); SetLocalObject( oHurt, "#HEALER", OBJECT_SELF ); DelayCommand( 6.0, DeleteLocalObject( oHurt, "#HEALER" ) ); //ActionCastSpellAtObject( iHeal, oHurt ); @@ -1443,25 +1471,25 @@ int DoSpellBreach( object oT=OBJECT_INVALID ) //add breach check before doing search? if ( GetIsObjectValid( oT ) ) { - oTarget = oT; + oTarget = oT; } else { - while ( !GetIsObjectValid( oTarget ) && GetIsObjectValid( oSub ) ) - { - if ( !GetIsDead( oSub ) && !GetIsObjectValid( GetLocalObject( oSub, "BREACHER" ) ) ) - { - strMDef = EvaluateSpellDefenses( oSub ); - strPDef = EvaluatePhysicalDefenses( oSub ); - - if ( strMDef.iTotal + strPDef.iTotal > iMaxLvl ) - { - oTarget = oSub; - iMaxLvl = strMDef.iTotal + strPDef.iTotal; - } - } - oSub = GetNearestCreature( CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, iCnt++, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN ); - } + while ( !GetIsObjectValid( oTarget ) && GetIsObjectValid( oSub ) ) + { + if ( !GetIsDead( oSub ) && !GetIsObjectValid( GetLocalObject( oSub, "BREACHER" ) ) ) + { + strMDef = EvaluateSpellDefenses( oSub ); + strPDef = EvaluatePhysicalDefenses( oSub ); + + if ( strMDef.iTotal + strPDef.iTotal > iMaxLvl ) + { + oTarget = oSub; + iMaxLvl = strMDef.iTotal + strPDef.iTotal; + } + } + oSub = GetNearestCreature( CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, iCnt++, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN ); + } } if ( GetIsObjectValid( oTarget ) ) @@ -1495,7 +1523,7 @@ int DoSpellDirect( object oT=OBJECT_INVALID ) //enemies are visible to caller if ( GetIsObjectValid( oT ) ) { - oTarget = oT; + oTarget = oT; } else if ( !GetIsObjectValid( oTarget = GetLeastMagicDefendedEnemy( fRange ) ) ) { @@ -1531,7 +1559,7 @@ int DoSpellDirect( object oT=OBJECT_INVALID ) //Testing immunity checks //result: feh, doesn't work properly, 100% immunity to damage type doesn't count as "immunity". go figure. //SpeakString( "IT " + GetName( oTarget ) + " " + IntToString( FortitudeSave( oTarget, 1000, SAVING_THROW_TYPE_FIRE ) ) ); - + /* Spell/Talent Issue if ( iSpell > -1 ) { @@ -1550,7 +1578,7 @@ int DoSpellDirect( object oT=OBJECT_INVALID ) int DoTouch( object oT=OBJECT_INVALID ) { - int iSpell = -1; + int iSpell = -1; int iMinLvl = 0; float fRange = 20.0; object oHurt; @@ -1561,7 +1589,7 @@ int DoTouch( object oT=OBJECT_INVALID ) //enemies are visible to caller if ( GetIsObjectValid( oT ) ) { - oTarget = oT; + oTarget = oT; } else if ( !GetIsObjectValid( oTarget = GetLeastMagicDefendedEnemy( fRange ) ) ) { @@ -1584,7 +1612,7 @@ int DoTouch( object oT=OBJECT_INVALID ) { iSpell = GetTouchSpell( oTarget, iMinLvl ); } - + /* Spell/Talent Issue if ( iSpell > -1 ) { @@ -1598,7 +1626,7 @@ int DoTouch( object oT=OBJECT_INVALID ) //ActionUseTalentOnObject( tSpell, oTarget ); return TRUE; } - return FALSE; + return FALSE; } int DoSpellArea() @@ -1621,145 +1649,145 @@ int DoSpellArea() object oD; talent tSpell; - if ( !iHostiles ) - { - return FALSE; - } - - //estimate average enemy hit dice to get an idea of what spell level range we should consider - iMinLvl = GetSafeAverageEnemyLevel(); - - if ( iHostiles == 1 ) - { - oTarget = GetTarget(); - if ( !GetIsObjectValid( oTarget ) ) - { - return FALSE; - } - else - { - fMaxSearch = GetDistanceBetween( OBJECT_SELF, oTarget ); - iSpell = GetAreaSpell( Vector( 0.0, 0.0, 0.0 ), FALSE, iMinLvl, fMaxSearch ); - if ( iSpell == -1 ) - { - return FALSE; - } - fRad = GetAreaSpellRadius( iSpell ); - vT = GetPosition( oTarget ) - GetPosition( OBJECT_SELF ); - } - } - else if ( iHostiles > 1 ) - { - //fMaxSearch = VectorMagnitude( GetHostileVector( 40.0 ) ); - /* - oD = GetMostDistantEnemy( 40.0 ); - if ( GetIsObjectValid( oD ) ) - { - fMaxSearch = GetDistanceBetween( OBJECT_SELF, oD ); - } - else - { - //apparently no enemies spotted, should be impossible at this point - fMaxSearch = 40.0; - } - */ - fMaxSearch = GetAverageDistanceToEnemy( 40.0 ); - //SpeakString( "ADtE: " + FloatToString( fMaxSearch ) + " AEL: " + IntToString( iMinLvl ) ); - iSpell = GetAreaSpell( Vector( 0.0, 0.0, 0.0 ), FALSE, iMinLvl, fMaxSearch ); - if ( iSpell < 0 ) - { - //SpeakString( "No spell" ); - return FALSE; - } - //SpeakString( "Spell: " + IntToString( iSpell ) ); - fRad = GetAreaSpellRadius( iSpell ); - vT = GetAreaTarget( iSpell, fRad, fMinSearch, fMaxSearch ); - vS = GetAverageEnemySaveInArea( vT, fRad ); - //SpeakString( "AES: " + FloatToString( vS.x ) + " " + FloatToString( vS.y ) + " " + FloatToString( vS.z ) ); - } + if ( !iHostiles ) + { + return FALSE; + } - //PrintString( GetName( OBJECT_SELF ) + " AS" + IntToString( iMinLvl ) ); - - fRange = GetSpellRange( iSpell ); - vU = GetPosition( OBJECT_SELF ); - //single target case - if ( iHostiles == 1 ) - { - lMark = GetLocation( OBJECT_SELF ); - if ( GetIsDiscriminantSpell( iSpell ) ) - { - if ( fRange == 0.0 ) - { - //ActionCastSpellAtLocation( iSpell, lMark ); - NO_ActionCastSpellAtLocation( iSpell, lMark ); - } - else - { - //ActionCastSpellAtObject( iSpell, oTarget ); - NO_ActionCastSpellAtObject( iSpell, oTarget ); - } - return TRUE; - } - else - { - if ( fRange == 0.0 ) - { - fRatio = GetFriendFoeRatio( lMark, fRad ); - if ( fRatio < GetFriendFoeTolerance() ) - { - iSpell = GetAreaSpell( Vector( 0.0, 0.0, 0.0 ), TRUE, iMinLvl, fMaxSearch ); - if ( iSpell < 0 ) - { - //fRatio not acceptable, no discriminant spells - return FALSE; - } - } - //either fRatio is okay or we have a discriminant spell - fRange = GetSpellRange( iSpell ); - if ( fRange == 0.0 ) - { - //ActionCastSpellAtLocation( iSpell, lMark ); - NO_ActionCastSpellAtLocation( iSpell, lMark ); - } - else - { - //ActionCastSpellAtObject( iSpell, oTarget ); - NO_ActionCastSpellAtObject( iSpell, oTarget ); - } - return TRUE; - } - fRatio = GetFriendFoeRatio( GetLocation( oTarget ), fRad ); - if ( fRatio < GetFriendFoeTolerance() ) - { - iSpell = GetAreaSpell( Vector( 0.0, 0.0, 0.0 ), TRUE, iMinLvl, fMaxSearch ); - if ( iSpell < 0 ) - { - return FALSE; - } - } - //either fRatio is okay or we have a discriminant spell - fRange = GetSpellRange( iSpell ); - if ( fRange == 0.0 ) - { - //ActionCastSpellAtLocation( iSpell, lMark ); - NO_ActionCastSpellAtLocation( iSpell, lMark ); - } - else - { - //ActionCastSpellAtObject( iSpell, oTarget ); - NO_ActionCastSpellAtObject( iSpell, oTarget ); - } - return TRUE; - } - } - //multiple target case - if ( iHostiles > 1 ) - { - //PrintString( "AREA: " + GetName( OBJECT_SELF ) + FloatToString( fMaxSearch ) ); + //estimate average enemy hit dice to get an idea of what spell level range we should consider + iMinLvl = GetSafeAverageEnemyLevel(); + + if ( iHostiles == 1 ) + { + oTarget = GetTarget(); + if ( !GetIsObjectValid( oTarget ) ) + { + return FALSE; + } + else + { + fMaxSearch = GetDistanceBetween( OBJECT_SELF, oTarget ); + iSpell = GetAreaSpell( Vector( 0.0, 0.0, 0.0 ), FALSE, iMinLvl, fMaxSearch ); + if ( iSpell == -1 ) + { + return FALSE; + } + fRad = GetAreaSpellRadius( iSpell ); + vT = GetPosition( oTarget ) - GetPosition( OBJECT_SELF ); + } + } + else if ( iHostiles > 1 ) + { + //fMaxSearch = VectorMagnitude( GetHostileVector( 40.0 ) ); + /* + oD = GetMostDistantEnemy( 40.0 ); + if ( GetIsObjectValid( oD ) ) + { + fMaxSearch = GetDistanceBetween( OBJECT_SELF, oD ); + } + else + { + //apparently no enemies spotted, should be impossible at this point + fMaxSearch = 40.0; + } + */ + fMaxSearch = GetAverageDistanceToEnemy( 40.0 ); + //SpeakString( "ADtE: " + FloatToString( fMaxSearch ) + " AEL: " + IntToString( iMinLvl ) ); + iSpell = GetAreaSpell( Vector( 0.0, 0.0, 0.0 ), FALSE, iMinLvl, fMaxSearch ); + if ( iSpell < 0 ) + { + //SpeakString( "No spell" ); + return FALSE; + } + //SpeakString( "Spell: " + IntToString( iSpell ) ); + fRad = GetAreaSpellRadius( iSpell ); + vT = GetAreaTarget( iSpell, fRad, fMinSearch, fMaxSearch ); + vS = GetAverageEnemySaveInArea( vT, fRad ); + //SpeakString( "AES: " + FloatToString( vS.x ) + " " + FloatToString( vS.y ) + " " + FloatToString( vS.z ) ); + } + + //PrintString( GetName( OBJECT_SELF ) + " AS" + IntToString( iMinLvl ) ); + + fRange = GetSpellRange( iSpell ); + vU = GetPosition( OBJECT_SELF ); + //single target case + if ( iHostiles == 1 ) + { + lMark = GetLocation( OBJECT_SELF ); + if ( GetIsDiscriminantSpell( iSpell ) ) + { + if ( fRange == 0.0 ) + { + //ActionCastSpellAtLocation( iSpell, lMark ); + NO_ActionCastSpellAtLocation( iSpell, lMark ); + } + else + { + //ActionCastSpellAtObject( iSpell, oTarget ); + NO_ActionCastSpellAtObject( iSpell, oTarget ); + } + return TRUE; + } + else + { + if ( fRange == 0.0 ) + { + fRatio = GetFriendFoeRatio( lMark, fRad ); + if ( fRatio < GetFriendFoeTolerance() ) + { + iSpell = GetAreaSpell( Vector( 0.0, 0.0, 0.0 ), TRUE, iMinLvl, fMaxSearch ); + if ( iSpell < 0 ) + { + //fRatio not acceptable, no discriminant spells + return FALSE; + } + } + //either fRatio is okay or we have a discriminant spell + fRange = GetSpellRange( iSpell ); + if ( fRange == 0.0 ) + { + //ActionCastSpellAtLocation( iSpell, lMark ); + NO_ActionCastSpellAtLocation( iSpell, lMark ); + } + else + { + //ActionCastSpellAtObject( iSpell, oTarget ); + NO_ActionCastSpellAtObject( iSpell, oTarget ); + } + return TRUE; + } + fRatio = GetFriendFoeRatio( GetLocation( oTarget ), fRad ); + if ( fRatio < GetFriendFoeTolerance() ) + { + iSpell = GetAreaSpell( Vector( 0.0, 0.0, 0.0 ), TRUE, iMinLvl, fMaxSearch ); + if ( iSpell < 0 ) + { + return FALSE; + } + } + //either fRatio is okay or we have a discriminant spell + fRange = GetSpellRange( iSpell ); + if ( fRange == 0.0 ) + { + //ActionCastSpellAtLocation( iSpell, lMark ); + NO_ActionCastSpellAtLocation( iSpell, lMark ); + } + else + { + //ActionCastSpellAtObject( iSpell, oTarget ); + NO_ActionCastSpellAtObject( iSpell, oTarget ); + } + return TRUE; + } + } + //multiple target case + if ( iHostiles > 1 ) + { + //PrintString( "AREA: " + GetName( OBJECT_SELF ) + FloatToString( fMaxSearch ) ); if ( VectorMagnitude( vT ) == 0.0 ) { - //SpeakString( "No target" ); - return FALSE; + //SpeakString( "No target" ); + return FALSE; } /* if ( 5 - GetAbilityModifier( ABILITY_INTELLIGENCE ) > 0 ) @@ -1824,9 +1852,9 @@ int DoSpellArea() //maybe later add something to see if I am immune to the spell //and cast anyway if so //Spells with range of 0 should be okay to cast - else if ( GetIsDiscriminantSpell( iSpell ) || - ( GetSpellRange( iSpell ) > 0.0 && VectorMagnitude( vT ) > fRad ) || GetSpellRange( iSpell ) == 0.0 || - IsCone( iSpell ) ) + else if ( GetIsDiscriminantSpell( iSpell ) || + ( GetSpellRange( iSpell ) > 0.0 && VectorMagnitude( vT ) > fRad ) || GetSpellRange( iSpell ) == 0.0 || + IsCone( iSpell ) ) { //ActionCastSpellAtLocation( iSpell, lMark ); NO_ActionCastSpellAtLocation( iSpell, lMark ); @@ -1846,8 +1874,8 @@ int DoSpellSummon() if ( iSpell && !GetLocalInt( OBJECT_SELF, "#SUMMONDEL" ) && !GetIsObjectValid( GetAssociate( ASSOCIATE_TYPE_SUMMONED ) ) ) { - /* - vT = AngleToVector( GetFacing( OBJECT_SELF ) - 90.0 + IntToFloat( Random( 180 ) ) ); + /* + vT = AngleToVector( GetFacing( OBJECT_SELF ) - 90.0 + IntToFloat( Random( 180 ) ) ); //testing addition to stop summoning creatures into AOEs if ( GetAOECount( 10.0 ) ) { @@ -1890,8 +1918,8 @@ int DoFeatEnhance() int DoDragonFlight() { - //unused due to lack of re-entry animation - /* + //unused due to lack of re-entry animation + /* int iCnt = 1; object oTarget = OBJECT_INVALID; @@ -1934,7 +1962,7 @@ int DoAvoidMelee() vT = GetHostileEvacVector( GetHostileVector( 15.0 ) ); if ( VectorMagnitude( vT ) > 5.0 ) { - SetLocalLocation( OBJECT_SELF, "#LASTHOTSPOT", GetLocation( OBJECT_SELF ) ); + SetLocalLocation( OBJECT_SELF, "#LASTHOTSPOT", GetLocation( OBJECT_SELF ) ); SetLocalFloat( OBJECT_SELF, "#LASTAMANGLE", VectorToAngle( vT ) ); vT = GetPosition( OBJECT_SELF ) - vT; lLoc = Location( GetArea( OBJECT_SELF ), vT, VectorToAngle( vT ) ); @@ -1947,45 +1975,45 @@ int DoAvoidMelee() */ int DoAvoidMelee() { - vector vT; - location lD; - - if ( GetHasSpellEffect( SPELL_TIME_STOP, OBJECT_SELF ) == TRUE ) - { - //don't bother if we have time stop, dish out some pain instead - return FALSE; - } - - if ( GetHostileCount( 5.0 ) ) - { - vT = ( -1.0 * ( 10.0 + IntToFloat( Random( 20 ) ) ) ) * VectorNormalize( GetHostileVector( 20.0 ) ); - lD = Location( GetArea( OBJECT_SELF ), vT + GetPosition( OBJECT_SELF ), VectorToAngle( vT ) ); - if ( GetLocalInt( OBJECT_SELF, "#LASTDEST" ) ) - { - if ( GetDistanceBetweenLocations( GetLocalLocation( OBJECT_SELF, "#LASTDEST" ), GetLocation( OBJECT_SELF ) ) < 5.0 ) - { - //close enough to target location - DeleteLocalInt( OBJECT_SELF, "#LASTDEST" ); - DeleteLocalLocation( OBJECT_SELF, "#LASTDEST" ); - } - else if ( GetDistanceBetweenLocations( GetLocalLocation( OBJECT_SELF, "#LASTDEST" ), GetLocation( OBJECT_SELF ) ) > 5.0 ) - { - //didn't make it close enough to our last desired location for some reason - vT = ( 10.0 + IntToFloat( Random( 20 ) ) ) * VectorNormalize( AngleToVector( VectorToAngle( vT ) - 90.0 + 180 * IntToFloat( Random( 2 ) ) ) ); - lD = Location( GetArea( OBJECT_SELF ), vT + GetPosition( OBJECT_SELF ), VectorToAngle( vT ) ); - } - } - SetLocalInt( OBJECT_SELF, "#LASTDEST", 1 ); - SetLocalLocation( OBJECT_SELF, "#LASTDEST", lD ); - DoMoveToLocation( lD, TRUE ); - /*XXX this queueing now handled by main combat loop - ActionDoCommand( DelayCommand( 1.0, DoCombat() ) ); - */ - return TRUE; - } - return FALSE; + vector vT; + location lD; + + if ( GetHasSpellEffect( SPELL_TIME_STOP, OBJECT_SELF ) == TRUE ) + { + //don't bother if we have time stop, dish out some pain instead + return FALSE; + } + + if ( GetHostileCount( 5.0 ) ) + { + vT = ( -1.0 * ( 10.0 + IntToFloat( Random( 20 ) ) ) ) * VectorNormalize( GetHostileVector( 20.0 ) ); + lD = Location( GetArea( OBJECT_SELF ), vT + GetPosition( OBJECT_SELF ), VectorToAngle( vT ) ); + if ( GetLocalInt( OBJECT_SELF, "#LASTDEST" ) ) + { + if ( GetDistanceBetweenLocations( GetLocalLocation( OBJECT_SELF, "#LASTDEST" ), GetLocation( OBJECT_SELF ) ) < 5.0 ) + { + //close enough to target location + DeleteLocalInt( OBJECT_SELF, "#LASTDEST" ); + DeleteLocalLocation( OBJECT_SELF, "#LASTDEST" ); + } + else if ( GetDistanceBetweenLocations( GetLocalLocation( OBJECT_SELF, "#LASTDEST" ), GetLocation( OBJECT_SELF ) ) > 5.0 ) + { + //didn't make it close enough to our last desired location for some reason + vT = ( 10.0 + IntToFloat( Random( 20 ) ) ) * VectorNormalize( AngleToVector( VectorToAngle( vT ) - 90.0 + 180 * IntToFloat( Random( 2 ) ) ) ); + lD = Location( GetArea( OBJECT_SELF ), vT + GetPosition( OBJECT_SELF ), VectorToAngle( vT ) ); + } + } + SetLocalInt( OBJECT_SELF, "#LASTDEST", 1 ); + SetLocalLocation( OBJECT_SELF, "#LASTDEST", lD ); + DoMoveToLocation( lD, TRUE ); + /*XXX this queueing now handled by main combat loop + ActionDoCommand( DelayCommand( 1.0, DoCombat() ) ); + */ + return TRUE; + } + return FALSE; } - + int DoTimeStop() { int iEnemy = GetHostileCount( 40.0f ); @@ -2004,30 +2032,30 @@ int DoTimeStop() int DoVision() { - object oS; - int iCnt = 1; - int iSpell = 0; - - if ( !GetHasVisionSpells() ) - { - return FALSE; - } - - oS = GetVisionDeprived( 20.0 ); - if ( GetIsObjectValid( oS ) ) - { - iSpell = GetVisionSpellNeeded( oS ); - if ( iSpell ) - { - //oS should be creature that needs vision, iSpell is the spell needed - SetLocalObject( oS, "#VISION", OBJECT_SELF ); - DelayCommand( 6.0, DeleteLocalObject( oS, "#VISION" ) ); - //ActionCastSpellAtObject( iSpell, oS ); - NO_ActionCastSpellAtObject( iSpell, oS ); - return TRUE; - } - } - return FALSE; + object oS; + int iCnt = 1; + int iSpell = 0; + + if ( !GetHasVisionSpells() ) + { + return FALSE; + } + + oS = GetVisionDeprived( 20.0 ); + if ( GetIsObjectValid( oS ) ) + { + iSpell = GetVisionSpellNeeded( oS ); + if ( iSpell ) + { + //oS should be creature that needs vision, iSpell is the spell needed + SetLocalObject( oS, "#VISION", OBJECT_SELF ); + DelayCommand( 6.0, DeleteLocalObject( oS, "#VISION" ) ); + //ActionCastSpellAtObject( iSpell, oS ); + NO_ActionCastSpellAtObject( iSpell, oS ); + return TRUE; + } + } + return FALSE; } int DoBreathWeapon() @@ -2042,36 +2070,36 @@ int DoBreathWeapon() location lMark; int iMeta= METAMAGIC_ANY; int iCheat = TRUE; - - if ( iSpell && GetLocalInt( OBJECT_SELF, "#BDEL" ) == 0 ) - { - iHostiles = GetHostileCount( 50.0 ); - if ( iHostiles == 1 ) - { - //we have a breath weapon ready to go, single target - oT = GetTarget(); - if ( oT != OBJECT_INVALID ) - { - //ActionCastSpellAtObject( iSpell, oT, iMeta, iCheat ); - NO_ActionCastSpellAtObject( iSpell, oT, iMeta, iCheat, 0, PROJECTILE_PATH_TYPE_DEFAULT, FALSE, FALSE ); - SetLocalInt( OBJECT_SELF, "#BDEL", 1 ); - DelayCommand( RoundsToSeconds( d4() ), DeleteLocalInt( OBJECT_SELF, "#BDEL" ) ); - return TRUE; - } - } - else if ( iHostiles > 1 ) - { - //we have a breath weapon ready to go, multiple targets - vT = GetAreaTarget( iSpell, fRad, fMinSearch, fMaxSearch ); - if ( VectorMagnitude( vT ) > 0.0 ) - { - lMark = Location( GetArea( OBJECT_SELF ), GetPosition( OBJECT_SELF ) + vT, GetFacing( OBJECT_SELF ) ); - //ActionCastSpellAtLocation( iSpell, lMark ); - NO_ActionCastSpellAtLocation( iSpell, lMark, iMeta, iCheat, PROJECTILE_PATH_TYPE_DEFAULT, FALSE, FALSE ); - SetLocalInt( OBJECT_SELF, "#BDEL", 1 ); - DelayCommand( RoundsToSeconds( d4() ), DeleteLocalInt( OBJECT_SELF, "#BDEL" ) ); - return TRUE; - } + + if ( iSpell && GetLocalInt( OBJECT_SELF, "#BDEL" ) == 0 ) + { + iHostiles = GetHostileCount( 50.0 ); + if ( iHostiles == 1 ) + { + //we have a breath weapon ready to go, single target + oT = GetTarget(); + if ( oT != OBJECT_INVALID ) + { + //ActionCastSpellAtObject( iSpell, oT, iMeta, iCheat ); + NO_ActionCastSpellAtObject( iSpell, oT, iMeta, iCheat, 0, PROJECTILE_PATH_TYPE_DEFAULT, FALSE, FALSE ); + SetLocalInt( OBJECT_SELF, "#BDEL", 1 ); + DelayCommand( RoundsToSeconds( d4() ), DeleteLocalInt( OBJECT_SELF, "#BDEL" ) ); + return TRUE; + } + } + else if ( iHostiles > 1 ) + { + //we have a breath weapon ready to go, multiple targets + vT = GetAreaTarget( iSpell, fRad, fMinSearch, fMaxSearch ); + if ( VectorMagnitude( vT ) > 0.0 ) + { + lMark = Location( GetArea( OBJECT_SELF ), GetPosition( OBJECT_SELF ) + vT, GetFacing( OBJECT_SELF ) ); + //ActionCastSpellAtLocation( iSpell, lMark ); + NO_ActionCastSpellAtLocation( iSpell, lMark, iMeta, iCheat, PROJECTILE_PATH_TYPE_DEFAULT, FALSE, FALSE ); + SetLocalInt( OBJECT_SELF, "#BDEL", 1 ); + DelayCommand( RoundsToSeconds( d4() ), DeleteLocalInt( OBJECT_SELF, "#BDEL" ) ); + return TRUE; + } } } return FALSE; @@ -2102,8 +2130,8 @@ int DoTurning() int DoSpellCone() { - //moving this over to DoSpellArea() - /* + //moving this over to DoSpellArea() + /* object oT; int iSpell, iMinLvl; float fRad = 10.0; @@ -2171,24 +2199,24 @@ int DoHealSelf() iFeat = 0; } } - + //iCR = 20; iCR = 10; iHealTalent = 0; - if ( GetRacialType( OBJECT_SELF ) != RACIAL_TYPE_UNDEAD ) //undead do not use healing potions + if ( MyPRCGetRacialType( OBJECT_SELF ) != RACIAL_TYPE_UNDEAD ) //undead do not use healing potions { - //while ( iCR && GetIsTalentValid( tP = GetCreatureTalentBest( TALENT_CATEGORY_BENEFICIAL_HEALING_POTION, iCR-- ) ) ) - while ( iCR-- && GetIsTalentValid( tP = GetCreatureTalentRandom( TALENT_CATEGORY_BENEFICIAL_HEALING_POTION ) ) ) - { - if ( iP = GetTalentPotionHealAmount( tP ) ) - { - if ( iP > iHealTalent && iP < iDam ) - { - tHeal = tP; - iHealTalent = iP; - } - } - } + //while ( iCR && GetIsTalentValid( tP = GetCreatureTalentBest( TALENT_CATEGORY_BENEFICIAL_HEALING_POTION, iCR-- ) ) ) + while ( iCR-- && GetIsTalentValid( tP = GetCreatureTalentRandom( TALENT_CATEGORY_BENEFICIAL_HEALING_POTION ) ) ) + { + if ( iP = GetTalentPotionHealAmount( tP ) ) + { + if ( iP > iHealTalent && iP < iDam ) + { + tHeal = tP; + iHealTalent = iP; + } + } + } } if ( iFeat ) { @@ -2220,21 +2248,21 @@ int DoSpellGroupEnhance() iMinLvl = GetAverageEnemyLevel() / 3; } - //try feats first - if ( iSpell = GetGroupEnhanceFeat() ) - { - fRad = GetGroupEnhanceFeatRadius( iSpell ); - vU = GetPosition( OBJECT_SELF ); - vT = GetFriendlyAreaTarget( fRad, iSpell, 1 ); - if ( VectorMagnitude( vT ) > 0.0 ) - { - lLoc = Location( GetArea( OBJECT_SELF ), vU + vT, VectorToAngle( vT ) ); - DoMoveToLocation( lLoc, TRUE ); - ActionUseFeat( iSpell, OBJECT_SELF ); - return TRUE; - } - } - //then spells + //try feats first + if ( iSpell = GetGroupEnhanceFeat() ) + { + fRad = GetGroupEnhanceFeatRadius( iSpell ); + vU = GetPosition( OBJECT_SELF ); + vT = GetFriendlyAreaTarget( fRad, iSpell, 1 ); + if ( VectorMagnitude( vT ) > 0.0 ) + { + lLoc = Location( GetArea( OBJECT_SELF ), vU + vT, VectorToAngle( vT ) ); + DoMoveToLocation( lLoc, TRUE ); + ActionUseFeat( iSpell, OBJECT_SELF ); + return TRUE; + } + } + //then spells if ( iSpell = GetGroupEnhanceSpell( iMinLvl ) ) { fRad = GetGroupEnhanceSpellRadius( iSpell ); @@ -2319,7 +2347,7 @@ int DoDispelSingle() iAverage = GetAverageEffectCasterLevel( oTarget ); if ( ( iSpell = GetBestDispel( iAverage, iCL ) ) ) { - //PrintString( "DISPEL: " + GetName( OBJECT_SELF ) + " " + IntToString( iSpell ) + " " + GetName( oTarget ) ); + //PrintString( "DISPEL: " + GetName( OBJECT_SELF ) + " " + IntToString( iSpell ) + " " + GetName( oTarget ) ); //ActionCastSpellAtObject( iSpell, oTarget ); NO_ActionCastSpellAtObject( iSpell, oTarget ); return TRUE; @@ -2330,77 +2358,77 @@ int DoDispelSingle() int DoDismissal() { - int iSpell; - float fRad = RADIUS_SIZE_COLOSSAL; - object oT; - vector vT; - location lT; - - //banishment and dismissal is next optimal choices for enemy summons - iSpell = GetHasSpell( SPELL_BANISHMENT, OBJECT_SELF ) ? SPELL_BANISHMENT : SPELL_DISMISSAL; - if ( GetHasSpell( iSpell, OBJECT_SELF ) ) - { - vT = GetEnemySummonedAssociatesVector( fRad ); - if ( VectorMagnitude( vT ) > 0.0 ) - { - lT = Location( GetArea( OBJECT_SELF ), GetPosition( OBJECT_SELF ) + vT, VectorToAngle( vT ) ); - //ActionCastSpellAtLocation( iSpell, lT ); - NO_ActionCastSpellAtLocation( iSpell, lT ); - return TRUE; - } - } - //next check is to look for Outsiders and Elementals and clear them out with Word of Faith - //this will pick up against summoned and non-summoned planars - iSpell = SPELL_WORD_OF_FAITH; - if ( GetHasSpell( iSpell, OBJECT_SELF ) ) - { - vT = GetEnemyPlanarVector( fRad ); - if ( VectorMagnitude( vT ) > 0.0 ) - { - lT = Location( GetArea( OBJECT_SELF ), GetPosition( OBJECT_SELF ) + vT, VectorToAngle( vT ) ); - //ActionCastSpellAtLocation( iSpell, lT ); - NO_ActionCastSpellAtLocation( iSpell, lT ); - return TRUE; - } - } - //no dismissal, look for a summoned associate owner to use dispel magic on if we have it - if ( iSpell = GetDispelSpell() ) - { - //we have a dispel - if ( GetIsObjectValid( oT = GetStrongestEnemySummonedAssociateOwner( 30.0 ) ) ) - { - //ActionCastSpellAtObject( iSpell, oT ); - NO_ActionCastSpellAtObject( iSpell, oT ); - return TRUE; - } - } - return FALSE; + int iSpell; + float fRad = RADIUS_SIZE_COLOSSAL; + object oT; + vector vT; + location lT; + + //banishment and dismissal is next optimal choices for enemy summons + iSpell = GetHasSpell( SPELL_BANISHMENT, OBJECT_SELF ) ? SPELL_BANISHMENT : SPELL_DISMISSAL; + if ( GetHasSpell( iSpell, OBJECT_SELF ) ) + { + vT = GetEnemySummonedAssociatesVector( fRad ); + if ( VectorMagnitude( vT ) > 0.0 ) + { + lT = Location( GetArea( OBJECT_SELF ), GetPosition( OBJECT_SELF ) + vT, VectorToAngle( vT ) ); + //ActionCastSpellAtLocation( iSpell, lT ); + NO_ActionCastSpellAtLocation( iSpell, lT ); + return TRUE; + } + } + //next check is to look for Outsiders and Elementals and clear them out with Word of Faith + //this will pick up against summoned and non-summoned planars + iSpell = SPELL_WORD_OF_FAITH; + if ( GetHasSpell( iSpell, OBJECT_SELF ) ) + { + vT = GetEnemyPlanarVector( fRad ); + if ( VectorMagnitude( vT ) > 0.0 ) + { + lT = Location( GetArea( OBJECT_SELF ), GetPosition( OBJECT_SELF ) + vT, VectorToAngle( vT ) ); + //ActionCastSpellAtLocation( iSpell, lT ); + NO_ActionCastSpellAtLocation( iSpell, lT ); + return TRUE; + } + } + //no dismissal, look for a summoned associate owner to use dispel magic on if we have it + if ( iSpell = GetDispelSpell() ) + { + //we have a dispel + if ( GetIsObjectValid( oT = GetStrongestEnemySummonedAssociateOwner( 30.0 ) ) ) + { + //ActionCastSpellAtObject( iSpell, oT ); + NO_ActionCastSpellAtObject( iSpell, oT ); + return TRUE; + } + } + return FALSE; } int DoFastBuffs() { - int iSpell = 0; - int iCnt; - - if ( !GetLocalInt( OBJECT_SELF, "#FASTBUFFER" ) || GetLocalInt( OBJECT_SELF, "#FASTBUFFED" ) ) - { - return FALSE; - } - - iCnt = GenerateFastBuffList(); - - while ( iCnt ) - { - iSpell = GetLocalInt( OBJECT_SELF, "#SPL_FB" + IntToString( iCnt ) ); - ActionCastSpellAtObject( iSpell, OBJECT_SELF, METAMAGIC_ANY, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE ); - DeleteLocalInt( OBJECT_SELF, "#SPL_FB" + IntToString( iCnt-- ) ); - } - - if ( iSpell ) - { - return TRUE; - } - return FALSE; + int iSpell = 0; + int iCnt; + + if ( !GetLocalInt( OBJECT_SELF, "#FASTBUFFER" ) || GetLocalInt( OBJECT_SELF, "#FASTBUFFED" ) ) + { + return FALSE; + } + + iCnt = GenerateFastBuffList(); + + while ( iCnt ) + { + iSpell = GetLocalInt( OBJECT_SELF, "#SPL_FB" + IntToString( iCnt ) ); + ActionCastSpellAtObject( iSpell, OBJECT_SELF, METAMAGIC_ANY, FALSE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE ); + DeleteLocalInt( OBJECT_SELF, "#SPL_FB" + IntToString( iCnt-- ) ); + } + + if ( iSpell ) + { + return TRUE; + } + return FALSE; } /* @@ -2417,7 +2445,7 @@ int DoFlee() vT = GetHostileEvacVector( GetHostileVector( 15.0 ) ); if ( VectorMagnitude( vT ) > 5.0 ) { - SetLocalLocation( OBJECT_SELF, "#LASTHOTSPOT", GetLocation( OBJECT_SELF ) ); + SetLocalLocation( OBJECT_SELF, "#LASTHOTSPOT", GetLocation( OBJECT_SELF ) ); SetLocalFloat( OBJECT_SELF, "#LASTAMANGLE", VectorToAngle( vT ) ); vT = GetPosition( OBJECT_SELF ) - vT; lLoc = Location( GetArea( OBJECT_SELF ), vT, VectorToAngle( vT ) ); @@ -2431,422 +2459,422 @@ int DoFlee() int DoMeleeAssist() { - object oF, oE, oT, oTarget; - int iCnt1, iCnt2, iF, iE, iChat, iSpecial; - float fAssistRange = 30.0; - float fMeleeRange = 3.0; - float fRatio, fT, fDist, fDistMin; - - oT = OBJECT_INVALID; - fT = 1.0; - //look for a friend who needs assistance in melee - iCnt1 = 0; - oF = GetNearestCreature( CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_FRIEND, OBJECT_SELF, ++iCnt1, CREATURE_TYPE_IS_ALIVE, TRUE ); - while ( GetIsObjectValid( oF ) && GetDistanceBetween( OBJECT_SELF, oF ) < fAssistRange ) - { - if ( GetObjectSeen( oF ) || GetObjectHeard( oF ) ) - { - iF = GetHitDice( oF ) + GetAllyHD( fMeleeRange, oF ); - iE = GetHostileHD( fMeleeRange, oF ); - fRatio = IntToFloat( iE ) / IntToFloat( iF ); - if ( fRatio > fT ) - { - fT = fRatio; - oT = oF; - } - } - oF = GetNearestCreature( CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_FRIEND, OBJECT_SELF, ++iCnt1, CREATURE_TYPE_IS_ALIVE, TRUE ); - } - - if ( GetIsObjectValid( oT ) ) - { - //found a friend in trouble, stored highest enemy concentration to aid friend - //should be closest friend in a given melee - //get nearest enemy fighting friend - fDistMin = 100.0; - iCnt1 = 0; - oTarget = OBJECT_INVALID; - oE = GetNearestCreature( CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, oT, ++iCnt1, CREATURE_TYPE_IS_ALIVE, TRUE ); - while ( GetIsObjectValid( oE ) ) - { - if ( GetObjectSeen( oE ) || GetObjectHeard( oE ) ) - { - if ( ( fDist = GetDistanceBetween( OBJECT_SELF, oE ) ) < fDistMin ) - { - oTarget = oE; - fDistMin = fDist; - } - } - oE = GetNearestCreature( CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, oT, ++iCnt1, CREATURE_TYPE_IS_ALIVE, TRUE ); - } - //should now have a valid enemy to target, closest to me in target group - if ( GetIsObjectValid( oTarget ) ) - { - //SpeakString( "Assisting " + GetName( oT ) ); - DoEquipMelee( oTarget ); - DoVoiceChat( NO_VC_MELEEASSIST ); - if ( iSpecial = GetBestMeleeSpecial( oTarget ) ) - { - //use special attack type - ActionUseFeat( iSpecial, oTarget ); - } - else - { - ActionAttack( oTarget ); - } - return TRUE; + object oF, oE, oT, oTarget; + int iCnt1, iCnt2, iF, iE, iChat, iSpecial; + float fAssistRange = 30.0; + float fMeleeRange = 3.0; + float fRatio, fT, fDist, fDistMin; + + oT = OBJECT_INVALID; + fT = 1.0; + //look for a friend who needs assistance in melee + iCnt1 = 0; + oF = GetNearestCreature( CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_FRIEND, OBJECT_SELF, ++iCnt1, CREATURE_TYPE_IS_ALIVE, TRUE ); + while ( GetIsObjectValid( oF ) && GetDistanceBetween( OBJECT_SELF, oF ) < fAssistRange ) + { + if ( GetObjectSeen( oF ) || GetObjectHeard( oF ) ) + { + iF = GetHitDice( oF ) + GetAllyHD( fMeleeRange, oF ); + iE = GetHostileHD( fMeleeRange, oF ); + fRatio = IntToFloat( iE ) / IntToFloat( iF ); + if ( fRatio > fT ) + { + fT = fRatio; + oT = oF; + } } - } - - //either nobody needs help or I couldn't find a target - return FALSE; + oF = GetNearestCreature( CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_FRIEND, OBJECT_SELF, ++iCnt1, CREATURE_TYPE_IS_ALIVE, TRUE ); + } + + if ( GetIsObjectValid( oT ) ) + { + //found a friend in trouble, stored highest enemy concentration to aid friend + //should be closest friend in a given melee + //get nearest enemy fighting friend + fDistMin = 100.0; + iCnt1 = 0; + oTarget = OBJECT_INVALID; + oE = GetNearestCreature( CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, oT, ++iCnt1, CREATURE_TYPE_IS_ALIVE, TRUE ); + while ( GetIsObjectValid( oE ) ) + { + if ( GetObjectSeen( oE ) || GetObjectHeard( oE ) ) + { + if ( ( fDist = GetDistanceBetween( OBJECT_SELF, oE ) ) < fDistMin ) + { + oTarget = oE; + fDistMin = fDist; + } + } + oE = GetNearestCreature( CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, oT, ++iCnt1, CREATURE_TYPE_IS_ALIVE, TRUE ); + } + //should now have a valid enemy to target, closest to me in target group + if ( GetIsObjectValid( oTarget ) ) + { + //SpeakString( "Assisting " + GetName( oT ) ); + DoEquipMelee( oTarget ); + DoVoiceChat( NO_VC_MELEEASSIST ); + if ( iSpecial = GetBestMeleeSpecial( oTarget ) ) + { + //use special attack type + ActionUseFeat( iSpecial, oTarget ); + } + else + { + ActionAttack( oTarget ); + } + return TRUE; + } + } + + //either nobody needs help or I couldn't find a target + return FALSE; } int DoFlank( object oE=OBJECT_INVALID ) { - object oF = OBJECT_INVALID; - location lL = GetLocation( OBJECT_SELF ); - int iCnt = 0; - - if ( GetIsObjectValid( oE ) ) - { - oF = oE; - } - else - { - oE = GetNearestCreature( CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, ++iCnt, CREATURE_TYPE_IS_ALIVE, TRUE ); - while ( GetIsObjectValid( oE ) && !GetIsObjectValid( oF ) ) - { - if ( GetObjectSeen( oE, OBJECT_SELF ) || GetObjectHeard( oE, OBJECT_SELF ) ) - { - if ( GetDistanceBetween( oE, OBJECT_SELF ) > 10.0 ) - { - //enemy is seen or heard and more than 10.0 away, flank it - oF = oE; - } - else - { - //creature is within minimum range, abort flank - break; - } - } - oE = GetNearestCreature( CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, ++iCnt, CREATURE_TYPE_IS_ALIVE, TRUE ); - } - } - if ( GetIsObjectValid( oF ) ) - { - lL = GetFlankLoc( oF, lL ); - DoMoveToLocation( lL, TRUE ); - /*XXX - ActionDoCommand( DelayCommand( 1.0, DoCombat() ) ); - */ - return TRUE; - } - return FALSE; + object oF = OBJECT_INVALID; + location lL = GetLocation( OBJECT_SELF ); + int iCnt = 0; + + if ( GetIsObjectValid( oE ) ) + { + oF = oE; + } + else + { + oE = GetNearestCreature( CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, ++iCnt, CREATURE_TYPE_IS_ALIVE, TRUE ); + while ( GetIsObjectValid( oE ) && !GetIsObjectValid( oF ) ) + { + if ( GetObjectSeen( oE, OBJECT_SELF ) || GetObjectHeard( oE, OBJECT_SELF ) ) + { + if ( GetDistanceBetween( oE, OBJECT_SELF ) > 10.0 ) + { + //enemy is seen or heard and more than 10.0 away, flank it + oF = oE; + } + else + { + //creature is within minimum range, abort flank + break; + } + } + oE = GetNearestCreature( CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, ++iCnt, CREATURE_TYPE_IS_ALIVE, TRUE ); + } + } + if ( GetIsObjectValid( oF ) ) + { + lL = GetFlankLoc( oF, lL ); + DoMoveToLocation( lL, TRUE ); + /*XXX + ActionDoCommand( DelayCommand( 1.0, DoCombat() ) ); + */ + return TRUE; + } + return FALSE; } int DoMindBlast() { - vector vT; - object oT; - int iSpell = -69; - int iEnemies = GetHostileCount( 40.0 ); - int iEff; - float fRad = 15.0; - float fMinSrch = 0.0; - float fMaxSrch = 30.0; - location lMark; - - if ( iEnemies == 1 ) - { - oT = GetTarget(); - if ( GetIsObjectValid( oT ) ) - { - iEff = GetEffectsOnObject( oT ); - if ( ( iEff & NO_EFFECT_STUNNED ) + ( iEff & NO_EFFECT_PARALYZE ) + ( iEff & NO_EFFECT_DAZED ) == 0 ) - { - //target not stunned, paralyzed or dazed - //should switch to direct targetting once function is available - //ActionMindBlast( oT, GetLocation( oT ) ); - //ActionCastSpellAtObject( 1522, oT, METAMAGIC_ANY, TRUE ); - ActionCastSpellAtObject( CODI_MIND_BLAST, oT, METAMAGIC_ANY, TRUE ); - return TRUE; - } - } - } - else if ( iEnemies > 1 ) - { - vT = GetAreaTarget( iSpell, fRad, fMinSrch, fMaxSrch ); - if ( VectorMagnitude( vT ) > 0.0 ) - { - lMark = Location( GetArea( OBJECT_SELF ), GetPosition( OBJECT_SELF ) + vT, VectorToAngle( vT ) ); - //ActionMindBlast( OBJECT_INVALID, lMark ); - //ActionCastSpellAtLocation( 1522, lMark, METAMAGIC_ANY, TRUE ); - ActionCastSpellAtLocation( CODI_MIND_BLAST, lMark, METAMAGIC_ANY, TRUE ); - return TRUE; - } - } - return FALSE; + vector vT; + object oT; + int iSpell = -69; + int iEnemies = GetHostileCount( 40.0 ); + int iEff; + float fRad = 15.0; + float fMinSrch = 0.0; + float fMaxSrch = 30.0; + location lMark; + + if ( iEnemies == 1 ) + { + oT = GetTarget(); + if ( GetIsObjectValid( oT ) ) + { + iEff = GetEffectsOnObject( oT ); + if ( ( iEff & NO_EFFECT_STUNNED ) + ( iEff & NO_EFFECT_PARALYZE ) + ( iEff & NO_EFFECT_DAZED ) == 0 ) + { + //target not stunned, paralyzed or dazed + //should switch to direct targetting once function is available + //ActionMindBlast( oT, GetLocation( oT ) ); + //ActionCastSpellAtObject( 1522, oT, METAMAGIC_ANY, TRUE ); + ActionCastSpellAtObject( CODI_MIND_BLAST, oT, METAMAGIC_ANY, TRUE ); + return TRUE; + } + } + } + else if ( iEnemies > 1 ) + { + vT = GetAreaTarget( iSpell, fRad, fMinSrch, fMaxSrch ); + if ( VectorMagnitude( vT ) > 0.0 ) + { + lMark = Location( GetArea( OBJECT_SELF ), GetPosition( OBJECT_SELF ) + vT, VectorToAngle( vT ) ); + //ActionMindBlast( OBJECT_INVALID, lMark ); + //ActionCastSpellAtLocation( 1522, lMark, METAMAGIC_ANY, TRUE ); + ActionCastSpellAtLocation( CODI_MIND_BLAST, lMark, METAMAGIC_ANY, TRUE ); + return TRUE; + } + } + return FALSE; } int DoBrainExtraction() { - float fScanRange = 30.0; - float fImmRange = 10.0; - object oT = GetNearestAddledEnemyNoExtractor( fScanRange ); - int iCnt = 0; - int iC = 0; - int iH = 0; - int iEff; - int iDo = TRUE; + float fScanRange = 30.0; + float fImmRange = 10.0; + object oT = GetNearestAddledEnemyNoExtractor( fScanRange ); + int iCnt = 0; + int iC = 0; + int iH = 0; + int iEff; + int iDo = TRUE; - if ( !GetIsObjectValid( oT ) ) - { - //look for non-petrified enemy close by - oT = GetNearestCreature( CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, ++iCnt, CREATURE_TYPE_IS_ALIVE, TRUE, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN ); - while ( GetIsObjectValid( oT ) && GetDistanceBetween( OBJECT_SELF, oT ) < fImmRange ) - { - if ( IsBrainExtractable( oT ) ) - { - break; - } - oT = GetNearestCreature( CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, ++iCnt, CREATURE_TYPE_IS_ALIVE, TRUE, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN ); - } - //double check we aren't looking at a petrified enemy - if ( GetIsObjectValid( oT ) ) - { - if ( !IsBrainExtractable( oT ) ) - { - oT = OBJECT_INVALID; - } - } - //see if we have decent chances of extracting - if ( GetIsObjectValid( oT ) ) - { - iDo = FALSE; - int iAttNorm = GetCreatureAttackBonus( OBJECT_SELF ); - int iDefAC = GetAC( oT ) - 10; - if ( iAttNorm > iDefAC ) - { - int iAttGrap = GetGrappleBonus( OBJECT_SELF ); - int iDefGrap = GetGrappleBonus( oT ); - if ( iAttGrap > iDefGrap ) - { - //we will probably hit and probably win a grapple - iDo = TRUE; - } - } - } - } - if ( GetIsObjectValid( oT ) && iDo ) - { - //got a target, go for the brains - SetLocalInt( oT, "#EXTRACTING", 1 ); - DelayCommand( 12.0, DeleteLocalInt( oT, "#EXTRACTING" ) ); //death redundancy - if ( GetDistanceBetween( OBJECT_SELF, oT ) > 10.0 ) - { - DoMoveToObject( oT, TRUE, 2.1 ); - } - //ActionHeadSuck( oT ); - //ActionCastSpellAtObject( 1523, oT, METAMAGIC_ANY, TRUE ); - ActionCastSpellAtObject( CODI_BRAIN_EXTRACT, oT, METAMAGIC_ANY, TRUE ); - ActionDoCommand( DeleteLocalInt( oT, "#EXTRACTING" ) ); - return TRUE; - } - return FALSE; + if ( !GetIsObjectValid( oT ) ) + { + //look for non-petrified enemy close by + oT = GetNearestCreature( CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, ++iCnt, CREATURE_TYPE_IS_ALIVE, TRUE, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN ); + while ( GetIsObjectValid( oT ) && GetDistanceBetween( OBJECT_SELF, oT ) < fImmRange ) + { + if ( IsBrainExtractable( oT ) ) + { + break; + } + oT = GetNearestCreature( CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, ++iCnt, CREATURE_TYPE_IS_ALIVE, TRUE, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN ); + } + //double check we aren't looking at a petrified enemy + if ( GetIsObjectValid( oT ) ) + { + if ( !IsBrainExtractable( oT ) ) + { + oT = OBJECT_INVALID; + } + } + //see if we have decent chances of extracting + if ( GetIsObjectValid( oT ) ) + { + iDo = FALSE; + int iAttNorm = GetCreatureAttackBonus( OBJECT_SELF ); + int iDefAC = GetAC( oT ) - 10; + if ( iAttNorm > iDefAC ) + { + int iAttGrap = GetGrappleBonus( OBJECT_SELF ); + int iDefGrap = GetGrappleBonus( oT ); + if ( iAttGrap > iDefGrap ) + { + //we will probably hit and probably win a grapple + iDo = TRUE; + } + } + } + } + if ( GetIsObjectValid( oT ) && iDo ) + { + //got a target, go for the brains + SetLocalInt( oT, "#EXTRACTING", 1 ); + DelayCommand( 12.0, DeleteLocalInt( oT, "#EXTRACTING" ) ); //death redundancy + if ( GetDistanceBetween( OBJECT_SELF, oT ) > 10.0 ) + { + DoMoveToObject( oT, TRUE, 2.1 ); + } + //ActionHeadSuck( oT ); + //ActionCastSpellAtObject( 1523, oT, METAMAGIC_ANY, TRUE ); + ActionCastSpellAtObject( CODI_BRAIN_EXTRACT, oT, METAMAGIC_ANY, TRUE ); + ActionDoCommand( DeleteLocalInt( oT, "#EXTRACTING" ) ); + return TRUE; + } + return FALSE; } int DoAvoidEnemies() { - object oE = GetNearestCreature( CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, 1, CREATURE_TYPE_IS_ALIVE, TRUE, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN ); - vector vE; - vector vT; - location lL; - - if ( GetIsObjectValid( oE ) && GetDistanceBetween( OBJECT_SELF, oE ) < 15.0 ) - { - vE = GetHostileVector( 20.0 ); - vT = -10.0 * VectorNormalize( vE ); - lL = Location( GetArea( OBJECT_SELF ), GetPosition( OBJECT_SELF ) + vT, VectorToAngle( vT ) ); - DoMoveToLocation( lL, TRUE ); - /*XXX - ActionDoCommand( DelayCommand( 1.0, DoCombat() ) ); - */ - return TRUE; - } - else - { - vE = GetHostileVector( 20.0 ); - if ( VectorMagnitude( vE ) > 0.0 ) - { - vT = -10.0 * VectorNormalize( vE ); - } - else - { - vT = 5.0 * VectorNormalize( AngleToVector( IntToFloat( Random( 360 ) ) ) ); - } - lL = Location( GetArea( OBJECT_SELF ), GetPosition( OBJECT_SELF ) + vT, VectorToAngle( vT ) ); - DoMoveToLocation( lL, TRUE ); - /*XXX - ActionDoCommand( DelayCommand( 1.0, DoCombat() ) ); - */ - return TRUE; - } - //should never get down here - return FALSE; + object oE = GetNearestCreature( CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, 1, CREATURE_TYPE_IS_ALIVE, TRUE, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN ); + vector vE; + vector vT; + location lL; + + if ( GetIsObjectValid( oE ) && GetDistanceBetween( OBJECT_SELF, oE ) < 15.0 ) + { + vE = GetHostileVector( 20.0 ); + vT = -10.0 * VectorNormalize( vE ); + lL = Location( GetArea( OBJECT_SELF ), GetPosition( OBJECT_SELF ) + vT, VectorToAngle( vT ) ); + DoMoveToLocation( lL, TRUE ); + /*XXX + ActionDoCommand( DelayCommand( 1.0, DoCombat() ) ); + */ + return TRUE; + } + else + { + vE = GetHostileVector( 20.0 ); + if ( VectorMagnitude( vE ) > 0.0 ) + { + vT = -10.0 * VectorNormalize( vE ); + } + else + { + vT = 5.0 * VectorNormalize( AngleToVector( IntToFloat( Random( 360 ) ) ) ); + } + lL = Location( GetArea( OBJECT_SELF ), GetPosition( OBJECT_SELF ) + vT, VectorToAngle( vT ) ); + DoMoveToLocation( lL, TRUE ); + /*XXX + ActionDoCommand( DelayCommand( 1.0, DoCombat() ) ); + */ + return TRUE; + } + //should never get down here + return FALSE; } int DoGrenade() { - return FALSE; + return FALSE; } int DoBeholderRays() { - float fM = GetFacing( OBJECT_SELF ); - float fH; - float fS = 5.5 / BEHOLDER_MAX_RAYS; - int iRep = 95; //chance to use multiple rays on one target if enemies < rays - int iH = GetHostileCount( 40.0 ); - int iC = 0; - int iQ1 = 0; - int iQ2 = 0; - int iQ3 = 0; - int iQ4 = 0; - int iR = 0; - int iS; - int iM; - object oT; - - InitializeBeholderRaySelection(); - - if ( GetHasSpellEffect( SPELL_HASTE, OBJECT_SELF ) || GetHasSpellEffect( SPELL_MASS_HASTE, OBJECT_SELF ) && GetHasFeatEffect( FEAT_EPIC_BLINDING_SPEED, OBJECT_SELF ) ) - { - fS *= 0.5; - } - - oT = GetNearestCreature( CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, ++iC, CREATURE_TYPE_IS_ALIVE, TRUE ); - while ( iC <= iH && iR < BEHOLDER_MAX_RAYS ) - { - iM = TRUE; //default is that we will not target multiple rays at individual targets - if ( GetIsObjectValid( oT ) == FALSE ) - { - //run out of targets unexpectedly - break; - } - else if ( GetIsPerceived( oT, NO_PERCEPTION_SEEN ) == FALSE && GetIsPerceived( oT, NO_PERCEPTION_HEARD ) == FALSE ) - { - //can't see or hear this creature, ignore it - iC++; - } - else - { - SetLocalInt( OBJECT_SELF, "#EYERAYS", 1 ); //flag the beholder as being busy shooting eye rays - //oT is valid, we can see or hear it - fH = VectorToAngle( GetPosition( oT ) - GetPosition( OBJECT_SELF ) ); - fH = fH < fM ? fH + 360.0 : fH; - fH -= fM; - if ( fH > 315.0 || fH < 45.0 ) - { - if ( iQ1 < 3 && GetIsCentralEyeOpen() == FALSE ) - { - //first quadrant target, still have rays available in this quadrant - iS = MatchRayToTarget( oT ); - if ( iS != 0 ) - { - iQ1++; - iR++; - RemoveBeholderRayFromSelection( iS ); - DelayCommand( fS * iR, DoFireBeholderRay( iS, oT ) ); - if ( iH - iC < BEHOLDER_MAX_RAYS - iR ) //we have more rays left to fire than enemies remaining to fire them at - { - if ( iQ1 < 3 && Random( 100 ) < iRep ) //we have rays left in this quadrant, random chance to shoot another at this target - { - iM = FALSE; //we will shoot more rays at this target, not moving on - } - } - } - } - } - else if ( fH < 135.0 ) - { - if ( iQ2 < 3 ) - { - //second quadrant target, still have rays available in this quadrant - iS = MatchRayToTarget( oT ); - if ( iS != 0 ) - { - iQ2++; - iR++; - RemoveBeholderRayFromSelection( iS ); - DelayCommand( fS * iR, DoFireBeholderRay( iS, oT ) ); - if ( iH - iC < BEHOLDER_MAX_RAYS - iR ) //we have more rays left to fire than enemies remaining to fire them at - { - if ( iQ2 < 3 && Random( 100 ) < iRep ) //we have rays left in this quadrant, random chance to shoot another at this target - { - iM = FALSE; //we will shoot more rays at this target, not moving on - } - } - } - } - } - else if ( fH < 225.0 ) - { - if ( iQ3 < 3 ) - { - //third quadrant target, still have rays available in this quadrant - iS = MatchRayToTarget( oT ); - if ( iS != 0 ) - { - iQ3++; - iR++; - RemoveBeholderRayFromSelection( iS ); - DelayCommand( fS * iR, DoFireBeholderRay( iS, oT ) ); - if ( iH - iC < BEHOLDER_MAX_RAYS - iR ) //we have more rays left to fire than enemies remaining to fire them at - { - if ( iQ3 < 3 && Random( 100 ) < iRep ) //we have rays left in this quadrant, random chance to shoot another at this target - { - iM = FALSE; //we will shoot more rays at this target, not moving on - } - } - } - } - } - else if ( iQ4 < 3 ) - { - //fourth quadrant target, still have rays available in this quadrant - iS = MatchRayToTarget( oT ); - if ( iS != 0 ) - { - iQ4++; - iR++; - RemoveBeholderRayFromSelection( iS ); - DelayCommand( fS * iR, DoFireBeholderRay( iS, oT ) ); - if ( iH - iC < BEHOLDER_MAX_RAYS - iR ) //we have more rays left to fire than enemies remaining to fire them at - { - if ( iQ4 < 3 && Random( 100 ) < iRep ) //we have rays left in this quadrant, random chance to shoot another at this target - { - iM = FALSE; //we will shoot more rays at this target, not moving on - } - } - } - } - } - //we're either getting the same target again or moving onto the next target - iC += iM; //if iM is true we are moving onto next target, iC is incremented, otherwise it stays where it is - oT = GetNearestCreature( CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, iC, CREATURE_TYPE_IS_ALIVE, TRUE ); - } - DelayCommand( fS * ( iR + 1 ), DeleteLocalInt( OBJECT_SELF, "#EYERAYS" ) ); - - ClearBeholderRaySelection(); - - if ( iR > 0 ) - { - //we have fired some rays - return TRUE; - } - //we have not fired any rays - return FALSE; + float fM = GetFacing( OBJECT_SELF ); + float fH; + float fS = 5.5 / BEHOLDER_MAX_RAYS; + int iRep = 95; //chance to use multiple rays on one target if enemies < rays + int iH = GetHostileCount( 40.0 ); + int iC = 0; + int iQ1 = 0; + int iQ2 = 0; + int iQ3 = 0; + int iQ4 = 0; + int iR = 0; + int iS; + int iM; + object oT; + + InitializeBeholderRaySelection(); + + if ( GetHasSpellEffect( SPELL_HASTE, OBJECT_SELF ) || GetHasSpellEffect( SPELL_MASS_HASTE, OBJECT_SELF ) && GetHasFeatEffect( FEAT_EPIC_BLINDING_SPEED, OBJECT_SELF ) ) + { + fS *= 0.5; + } + + oT = GetNearestCreature( CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, ++iC, CREATURE_TYPE_IS_ALIVE, TRUE ); + while ( iC <= iH && iR < BEHOLDER_MAX_RAYS ) + { + iM = TRUE; //default is that we will not target multiple rays at individual targets + if ( GetIsObjectValid( oT ) == FALSE ) + { + //run out of targets unexpectedly + break; + } + else if ( GetIsPerceived( oT, NO_PERCEPTION_SEEN ) == FALSE && GetIsPerceived( oT, NO_PERCEPTION_HEARD ) == FALSE ) + { + //can't see or hear this creature, ignore it + iC++; + } + else + { + SetLocalInt( OBJECT_SELF, "#EYERAYS", 1 ); //flag the beholder as being busy shooting eye rays + //oT is valid, we can see or hear it + fH = VectorToAngle( GetPosition( oT ) - GetPosition( OBJECT_SELF ) ); + fH = fH < fM ? fH + 360.0 : fH; + fH -= fM; + if ( fH > 315.0 || fH < 45.0 ) + { + if ( iQ1 < 3 && GetIsCentralEyeOpen() == FALSE ) + { + //first quadrant target, still have rays available in this quadrant + iS = MatchRayToTarget( oT ); + if ( iS != 0 ) + { + iQ1++; + iR++; + RemoveBeholderRayFromSelection( iS ); + DelayCommand( fS * iR, DoFireBeholderRay( iS, oT ) ); + if ( iH - iC < BEHOLDER_MAX_RAYS - iR ) //we have more rays left to fire than enemies remaining to fire them at + { + if ( iQ1 < 3 && Random( 100 ) < iRep ) //we have rays left in this quadrant, random chance to shoot another at this target + { + iM = FALSE; //we will shoot more rays at this target, not moving on + } + } + } + } + } + else if ( fH < 135.0 ) + { + if ( iQ2 < 3 ) + { + //second quadrant target, still have rays available in this quadrant + iS = MatchRayToTarget( oT ); + if ( iS != 0 ) + { + iQ2++; + iR++; + RemoveBeholderRayFromSelection( iS ); + DelayCommand( fS * iR, DoFireBeholderRay( iS, oT ) ); + if ( iH - iC < BEHOLDER_MAX_RAYS - iR ) //we have more rays left to fire than enemies remaining to fire them at + { + if ( iQ2 < 3 && Random( 100 ) < iRep ) //we have rays left in this quadrant, random chance to shoot another at this target + { + iM = FALSE; //we will shoot more rays at this target, not moving on + } + } + } + } + } + else if ( fH < 225.0 ) + { + if ( iQ3 < 3 ) + { + //third quadrant target, still have rays available in this quadrant + iS = MatchRayToTarget( oT ); + if ( iS != 0 ) + { + iQ3++; + iR++; + RemoveBeholderRayFromSelection( iS ); + DelayCommand( fS * iR, DoFireBeholderRay( iS, oT ) ); + if ( iH - iC < BEHOLDER_MAX_RAYS - iR ) //we have more rays left to fire than enemies remaining to fire them at + { + if ( iQ3 < 3 && Random( 100 ) < iRep ) //we have rays left in this quadrant, random chance to shoot another at this target + { + iM = FALSE; //we will shoot more rays at this target, not moving on + } + } + } + } + } + else if ( iQ4 < 3 ) + { + //fourth quadrant target, still have rays available in this quadrant + iS = MatchRayToTarget( oT ); + if ( iS != 0 ) + { + iQ4++; + iR++; + RemoveBeholderRayFromSelection( iS ); + DelayCommand( fS * iR, DoFireBeholderRay( iS, oT ) ); + if ( iH - iC < BEHOLDER_MAX_RAYS - iR ) //we have more rays left to fire than enemies remaining to fire them at + { + if ( iQ4 < 3 && Random( 100 ) < iRep ) //we have rays left in this quadrant, random chance to shoot another at this target + { + iM = FALSE; //we will shoot more rays at this target, not moving on + } + } + } + } + } + //we're either getting the same target again or moving onto the next target + iC += iM; //if iM is true we are moving onto next target, iC is incremented, otherwise it stays where it is + oT = GetNearestCreature( CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, iC, CREATURE_TYPE_IS_ALIVE, TRUE ); + } + DelayCommand( fS * ( iR + 1 ), DeleteLocalInt( OBJECT_SELF, "#EYERAYS" ) ); + + ClearBeholderRaySelection(); + + if ( iR > 0 ) + { + //we have fired some rays + return TRUE; + } + //we have not fired any rays + return FALSE; } int DoBeholderCentralEye() @@ -2861,39 +2889,220 @@ int DoBeholderCentralEye() location lMark; int iMeta= METAMAGIC_ANY; int iCheat = TRUE; - - if ( iSpell && GetLastAction() != "+CENTRALEYE" ) - { - iHostiles = GetHostileCount( 50.0 ); - if ( iHostiles == 1 ) - { - //we have a breath weapon ready to go, single target - oT = GetTarget(); - if ( oT != OBJECT_INVALID ) - { - //ActionCastSpellAtObject( iSpell, oT, iMeta, iCheat ); - NO_ActionCastSpellAtObject( iSpell, oT, iMeta, iCheat, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE, FALSE ); - SetIsCentralEyeOpen( TRUE ); - DoBeholderRays(); - SetIsCentralEyeOpen( FALSE ); - return TRUE; - } - } - else if ( iHostiles > 1 ) - { - //we have a breath weapon ready to go, multiple targets - vT = GetAreaTarget( iSpell, fRad, fMinSearch, fMaxSearch ); - if ( VectorMagnitude( vT ) > 0.0 ) - { - lMark = Location( GetArea( OBJECT_SELF ), GetPosition( OBJECT_SELF ) + vT, GetFacing( OBJECT_SELF ) ); - //ActionCastSpellAtLocation( iSpell, lMark ); - NO_ActionCastSpellAtLocation( iSpell, lMark, iMeta, iCheat, PROJECTILE_PATH_TYPE_DEFAULT, TRUE, FALSE ); - SetIsCentralEyeOpen( TRUE ); - DoBeholderRays(); - SetIsCentralEyeOpen( FALSE ); - return TRUE; - } + + if ( iSpell && GetLastAction() != "+CENTRALEYE" ) + { + iHostiles = GetHostileCount( 50.0 ); + if ( iHostiles == 1 ) + { + //we have a breath weapon ready to go, single target + oT = GetTarget(); + if ( oT != OBJECT_INVALID ) + { + //ActionCastSpellAtObject( iSpell, oT, iMeta, iCheat ); + NO_ActionCastSpellAtObject( iSpell, oT, iMeta, iCheat, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE, FALSE ); + SetIsCentralEyeOpen( TRUE ); + DoBeholderRays(); + SetIsCentralEyeOpen( FALSE ); + return TRUE; + } + } + else if ( iHostiles > 1 ) + { + //we have a breath weapon ready to go, multiple targets + vT = GetAreaTarget( iSpell, fRad, fMinSearch, fMaxSearch ); + if ( VectorMagnitude( vT ) > 0.0 ) + { + lMark = Location( GetArea( OBJECT_SELF ), GetPosition( OBJECT_SELF ) + vT, GetFacing( OBJECT_SELF ) ); + //ActionCastSpellAtLocation( iSpell, lMark ); + NO_ActionCastSpellAtLocation( iSpell, lMark, iMeta, iCheat, PROJECTILE_PATH_TYPE_DEFAULT, TRUE, FALSE ); + SetIsCentralEyeOpen( TRUE ); + DoBeholderRays(); + SetIsCentralEyeOpen( FALSE ); + return TRUE; + } } } return FALSE; -} \ No newline at end of file +} + +int DoEN4Invis() +{ + int iEnemy = GetHostileCount( 40.0f ); + + if ( iEnemy ) + { + if (GetHasSpellEffect( SPELL_IMPROVED_INVISIBILITY ) || GetHasSpellEffect( SPELL_INVISIBILITY_SPHERE ) || GetHasSpellEffect( SPELL_INVISIBILITY ) || GetLocalInt(OBJECT_SELF,"EN4InvisEvent") == 1) + return FALSE; + + if ( GetHasSpell( SPELL_IMPROVED_INVISIBILITY )) + { + //ActionCastSpellAtObject( SPELL_TIME_STOP, OBJECT_SELF ); + NO_ActionCastSpellAtObject( SPELL_IMPROVED_INVISIBILITY, OBJECT_SELF ); + SetLocalInt(OBJECT_SELF,"EN4InvisEvent",1); + return TRUE; + } + + if ( GetHasSpell( SPELL_INVISIBILITY_SPHERE ) ) + { + //ActionCastSpellAtObject( SPELL_TIME_STOP, OBJECT_SELF ); + NO_ActionCastSpellAtObject( SPELL_INVISIBILITY_SPHERE, OBJECT_SELF ); + SetLocalInt(OBJECT_SELF,"EN4InvisEvent",1); + return TRUE; + } + + if ( GetHasSpell( SPELL_INVISIBILITY ) ) + { + //ActionCastSpellAtObject( SPELL_TIME_STOP, OBJECT_SELF ); + NO_ActionCastSpellAtObject( SPELL_INVISIBILITY, OBJECT_SELF ); + SetLocalInt(OBJECT_SELF,"EN4InvisEvent",1); + return TRUE; + } + + } + return FALSE; +} + +int DoEN4DmgShield() +{ + int iEnemy = GetHostileCount( 40.0f ); + + if ( iEnemy ) + { + if (GetLocalInt(OBJECT_SELF,"EN4DmgShieldEvent") > 0) + return FALSE; + + if ( GetHasSpell( SPELL_MESTILS_ACID_SHEATH ) && !GetHasSpellEffect( SPELL_MESTILS_ACID_SHEATH )) + { + //ActionCastSpellAtObject( SPELL_TIME_STOP, OBJECT_SELF ); + NO_ActionCastSpellAtObject( SPELL_MESTILS_ACID_SHEATH, OBJECT_SELF ); + SetLocalInt(OBJECT_SELF,"EN4DmgShieldEvent",1); + return TRUE; + } + if ( GetHasSpell( SPELL_ELEMENTAL_SHIELD ) && !GetHasSpellEffect( SPELL_ELEMENTAL_SHIELD )) + { + //ActionCastSpellAtObject( SPELL_TIME_STOP, OBJECT_SELF ); + NO_ActionCastSpellAtObject( SPELL_ELEMENTAL_SHIELD, OBJECT_SELF ); + SetLocalInt(OBJECT_SELF,"EN4DmgShieldEvent",1); + return TRUE; + } + if ( GetHasSpell( SPELL_WOUNDING_WHISPERS ) && !GetHasSpellEffect( SPELL_WOUNDING_WHISPERS )) + { + //ActionCastSpellAtObject( SPELL_TIME_STOP, OBJECT_SELF ); + NO_ActionCastSpellAtObject( SPELL_WOUNDING_WHISPERS, OBJECT_SELF ); + SetLocalInt(OBJECT_SELF,"EN4DmgShieldEvent",1); + return TRUE; + } + if ( GetHasSpell( SPELL_DEATH_ARMOR ) && !GetHasSpellEffect( SPELL_DEATH_ARMOR )) + { + //ActionCastSpellAtObject( SPELL_TIME_STOP, OBJECT_SELF ); + NO_ActionCastSpellAtObject( SPELL_DEATH_ARMOR, OBJECT_SELF ); + SetLocalInt(OBJECT_SELF,"EN4DmgShieldEvent",1); + return TRUE; + } + } + return FALSE; +} + +int DoUndeadHealSelf( object oT=OBJECT_INVALID ) +{ +int iDamage; +int iHeal; + +iDamage = GetMaxHitPoints( oT ) - GetCurrentHitPoints( oT ); + +if (iDamage > GetMaxHitPoints( oT )/2) + { + iHeal = GetBestUndeadHeal( oT, iDamage ); + if (iHeal != 0) + { + NO_ActionCastSpellAtObject( iHeal, OBJECT_SELF ); + return TRUE; + } + } + +return FALSE; +} + +int DoSpellUndeadHeal( object oT=OBJECT_INVALID ) +{ + //original heal code + object oHurt; + int iHeal, iCR; + talent tHeal; + int iMin = 8; + + if ( GetHasHealingAbility() ) + //if ( GetIsTalentValid( GetCreatureTalentBest( TALENT_CATEGORY_BENEFICIAL_HEALING_TOUCH, 20 ) ) ) + { + oHurt = ( GetIsObjectValid( oT ) ) ? oT : GetLowestHPAllyNoHealer( 30.0, iMin, OBJECT_SELF, TRUE ); + if ( GetIsObjectValid( oHurt ) ) + { + /* + // Need to use this hack with talents because GetHasSpell will pick up spontaneous casting ability + // but ActionCastSpell* cannot do the spontaneous casting, which leaves the creature daydreaming + // rather than acting + */ + if (MyPRCGetRacialType(oHurt) == RACIAL_TYPE_UNDEAD) + iHeal = GetBestUndeadHeal( oHurt, iMin ); + else + iHeal = GetBestHeal( oHurt, iMin ); + + if (iHeal != 0) + { + tHeal = GetTalentSpell( TALENT_CATEGORY_BENEFICIAL_HEALING_TOUCH, iHeal ); + //if ( iHeal ) + if ( GetIsTalentValid( tHeal ) ) + { + //PrintString( "HEAL: " + GetName( OBJECT_SELF ) + " -> " + GetName( oHurt ) + " (" + IntToString( iHeal ) + ")" ); + SetLocalObject( oHurt, "#HEALER", OBJECT_SELF ); + DelayCommand( 6.0, DeleteLocalObject( oHurt, "#HEALER" ) ); + //ActionCastSpellAtObject( iHeal, oHurt ); + //ActionUseTalentOnObject( tHeal, oHurt ); + NO_ActionUseTalentOnObject( tHeal, oHurt ); + return TRUE; + } + } + } + } + return FALSE; +} + +int GetBestUndeadHeal( object oEnt=OBJECT_SELF, int iMin=10 ) +{ + int iDamage = 0; + + if ( GetIsObjectValid( oEnt ) ) + { + iDamage = GetMaxHitPoints( oEnt ) - GetCurrentHitPoints( oEnt ); + if ( iDamage < iMin ) + { + return 0; + } + if ( iDamage >= 60 && GetHasSpell( SPELL_HARM ) ) + { + return SPELL_HARM; + } + if ( iDamage >= 40 ) + { + if ( GetHasSpell( SPELL_INFLICT_CRITICAL_WOUNDS ) ) + { + return SPELL_INFLICT_CRITICAL_WOUNDS; + } + } + if ( iDamage >= 30 && GetHasSpell( SPELL_INFLICT_SERIOUS_WOUNDS ) ) + { + return SPELL_INFLICT_SERIOUS_WOUNDS; + } + if ( iDamage >= 20 && GetHasSpell( SPELL_INFLICT_MODERATE_WOUNDS ) ) + { + return SPELL_INFLICT_MODERATE_WOUNDS; + } + if ( iDamage >= 10 && GetHasSpell( SPELL_INFLICT_LIGHT_WOUNDS ) ) + { + return SPELL_INFLICT_LIGHT_WOUNDS; + } + } + return 0; +} + diff --git a/_module/nss/no_lib_analysis.nss b/_module/nss/no_lib_analysis.nss index aa444a9f..f277d726 100644 --- a/_module/nss/no_lib_analysis.nss +++ b/_module/nss/no_lib_analysis.nss @@ -1,4 +1,5 @@ #include "no_inc_ptypes" +#include "prc_inc_racial" //functions int GetAOEThreat( object oArea, object oEnt=OBJECT_SELF ) @@ -276,7 +277,7 @@ object GetLowestHPAllyNoHealer( float fRad=15.0, int iLim=0, object oEnt=OBJECT_ while ( GetIsObjectValid( oSub ) && GetDistanceBetween( oEnt, oSub ) < fRad ) { - iU = GetRacialType( oSub ) == RACIAL_TYPE_UNDEAD; + iU = MyPRCGetRacialType( oSub ) == RACIAL_TYPE_UNDEAD; if ( ( iLive || iU ) && ( !iLive || !iU ) ) { iDam = GetMaxHitPoints( oSub ) - GetCurrentHitPoints( oSub ); @@ -1330,7 +1331,7 @@ int GetIsValidTurnTarget( object oT, int iL=0, object oEnt=OBJECT_SELF ) iVermin = GetHasFeat( FEAT_PLANT_DOMAIN_POWER ) + GetHasFeat( FEAT_ANIMAL_COMPANION ); iConstructs = GetHasFeat( FEAT_DESTRUCTION_DOMAIN_POWER ); iOutsider = GetHasFeat( FEAT_GOOD_DOMAIN_POWER ) + GetHasFeat( FEAT_EVIL_DOMAIN_POWER ); - iRace = GetRacialType( oT ); + iRace = MyPRCGetRacialType( oT ); if ( iRace == RACIAL_TYPE_UNDEAD ) { @@ -2011,7 +2012,7 @@ vector GetEnemyPlanarVector( float fRad=10.0, object oEnt=OBJECT_SELF ) { iCnt2 = 0; iCnt3 = 0; - if ( GetRacialType( oT1 ) == RACIAL_TYPE_OUTSIDER || GetRacialType( oT1 ) == RACIAL_TYPE_ELEMENTAL ) + if ( MyPRCGetRacialType( oT1 ) == RACIAL_TYPE_OUTSIDER || MyPRCGetRacialType( oT1 ) == RACIAL_TYPE_ELEMENTAL ) { //PrintString( "GEPV: " + GetName( oT1 ) ); if ( GetCurrentAction( oT1 ) != ACTION_MOVETOPOINT ) @@ -2027,7 +2028,7 @@ vector GetEnemyPlanarVector( float fRad=10.0, object oEnt=OBJECT_SELF ) //don't count them as target if they're on the move if ( GetCurrentAction( oT2 ) != ACTION_MOVETOPOINT ) { - if ( GetRacialType( oT2 ) == RACIAL_TYPE_OUTSIDER || GetRacialType( oT2 ) == RACIAL_TYPE_ELEMENTAL ) + if ( MyPRCGetRacialType( oT2 ) == RACIAL_TYPE_OUTSIDER || MyPRCGetRacialType( oT2 ) == RACIAL_TYPE_ELEMENTAL ) { iCnt3++; vT = vT + GetPosition( oT2 ) - vU; @@ -2367,7 +2368,7 @@ int IsBrainExtractable( object oT ) if ( GetIsObjectValid( oT ) ) { iEff = GetEffectsOnObject( oT ); - iR = GetRacialType( oT ); + iR = MyPRCGetRacialType( oT ); if ( iEff & NO_EFFECT_PETRIFY || GetLocalInt( oT, "#EXTRACTING" ) || iR == RACIAL_TYPE_CONSTRUCT || iR == RACIAL_TYPE_ELEMENTAL || iR == RACIAL_TYPE_UNDEAD || iR == RACIAL_TYPE_VERMIN ) diff --git a/_module/nss/no_lib_bio.nss b/_module/nss/no_lib_bio.nss index 633fa5b6..0fa2bd0d 100644 --- a/_module/nss/no_lib_bio.nss +++ b/_module/nss/no_lib_bio.nss @@ -10,6 +10,7 @@ Some changes have been made to these functions where necessary. #include "x0_i0_position" #include "x0_i0_voice" #include "no_inc_ptypes" +#include "prc_inc_racial" //Master Constants int NW_FLAG_SPECIAL_CONVERSATION = 0x00000001; @@ -167,7 +168,7 @@ void SetListeningPatterns() } SetListening(OBJECT_SELF, TRUE); - + //NO: Broadcast listen patterns SetListenPattern( OBJECT_SELF, "BC_DEAD", 691 ); SetListenPattern( OBJECT_SELF, "BC_FIGHTING", 699 ); @@ -280,7 +281,7 @@ void WalkWayPoints(int nRun = FALSE, float fPause = 1.0) //Run first circuit SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS, FALSE); SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS, FALSE); } - + if(GetIsObjectValid(oWay1)) { int nNth = 1; @@ -545,10 +546,10 @@ int GetBehaviorState(int nCondition) void PlayMobileAmbientAnimations() { - if(!GetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS_AVIAN)) { - // not a bird - PlayMobileAmbientAnimations_NonAvian(); - } else { + if(!GetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS_AVIAN)) { + // not a bird + PlayMobileAmbientAnimations_NonAvian(); + } else { // a bird PlayMobileAmbientAnimations_Avian(); } @@ -589,7 +590,7 @@ void DetermineSpecialBehavior(object oIntruder = OBJECT_INVALID) { if(GetIsObjectValid(oTarget) && GetDistanceToObject(oTarget) <= 8.0) { - if(!GetIsFriend(oTarget)) + if(GetIsEnemy(oTarget)) { if(GetLevelByClass(CLASS_TYPE_DRUID, oTarget) == 0 && GetLevelByClass(CLASS_TYPE_RANGER, oTarget) == 0) { @@ -864,7 +865,7 @@ object GetCurrentInteractionTarget() // if it was set outside. void CheckIsCivilized() { - int nRacialType = GetRacialType(OBJECT_SELF); + int nRacialType = MyPRCGetRacialType(OBJECT_SELF); switch (nRacialType) { case RACIAL_TYPE_ELF : case RACIAL_TYPE_GNOME : @@ -2170,4 +2171,4 @@ void AnimActionPlayRandomAnimation() } } return; -} \ No newline at end of file +} diff --git a/_module/nss/no_lib_magic.nss b/_module/nss/no_lib_magic.nss index 99144742..df4290e6 100644 --- a/_module/nss/no_lib_magic.nss +++ b/_module/nss/no_lib_magic.nss @@ -1,4 +1,5 @@ #include "no_inc_ptypes" +#include "prc_inc_racial" //functions int GetBestMagicDefenseSelf( object oEnt=OBJECT_SELF ) @@ -1077,7 +1078,7 @@ int GetAreaSpell( vector vS, int iDisc=FALSE, int iMinLvl=0, float fR=40.0, obje //SPELLABILITIES //if ( GetHasSpell( SPELLABILITY_DRAGON_WING_BUFFET, oCaster ) && fR < fM ) /* Doesn't work? May need a custom script for this - if ( GetRacialType( oCaster ) == RACIAL_TYPE_DRAGON && fR < fM ) + if ( MyPRCGetRacialType( oCaster ) == RACIAL_TYPE_DRAGON && fR < fM ) { SpeakString( "Wingbuff" ); SetLocalInt( oCaster, "#SPL_" + IntToString( ++iCnt ), SPELLABILITY_DRAGON_WING_BUFFET ); @@ -1683,7 +1684,7 @@ int GetDirectSpell( object oT, int iDisc=FALSE, int iMinLvl=0, object oCaster=OB //6TH LEVEL CLR //6TH LEVEL DRD if ( GetHasSpell( SPELL_CRUMBLE, oCaster ) && - ( GetRacialType( oT ) == RACIAL_TYPE_CONSTRUCT || GetLevelByClass( CLASS_TYPE_CONSTRUCT, oT ) > 0 ) ) + ( MyPRCGetRacialType( oT ) == RACIAL_TYPE_CONSTRUCT || GetLevelByClass( CLASS_TYPE_CONSTRUCT, oT ) > 0 ) ) //this spell is only useful against constructs so no ability check should be made here { SetLocalInt( oCaster, "#SPL_" + IntToString( ++iCnt ), SPELL_CRUMBLE ); @@ -1838,7 +1839,7 @@ int GetDirectSpell( object oT, int iDisc=FALSE, int iMinLvl=0, object oCaster=OB { SetLocalInt( oCaster, "#SPL_" + IntToString( ++iCnt ), SPELL_HEALING_STING ); } - if ( GetHasSpell( SPELL_INFESTATION_OF_MAGGOTS, oCaster ) && GetRacialType( oT ) != RACIAL_TYPE_UNDEAD && + if ( GetHasSpell( SPELL_INFESTATION_OF_MAGGOTS, oCaster ) && MyPRCGetRacialType( oT ) != RACIAL_TYPE_UNDEAD && ( DoAbilityCheck( ABILITY_INTELLIGENCE, 10 ) == FALSE || GetIsImmune( oT, IMMUNITY_TYPE_ABILITY_DECREASE ) ) ) { SetLocalInt( oCaster, "#SPL_" + IntToString( ++iCnt ), SPELL_INFESTATION_OF_MAGGOTS ); @@ -2222,7 +2223,7 @@ int GetTouchSpell( object oT, int iMinLvl=0, object oCaster=OBJECT_SELF ) if ( !iCnt || iMinLvl <= 6 ) { //6TH LEVEL CLR - if ( GetHasSpell( SPELL_HARM, oCaster ) && GetRacialType( oT ) != RACIAL_TYPE_UNDEAD && + if ( GetHasSpell( SPELL_HARM, oCaster ) && MyPRCGetRacialType( oT ) != RACIAL_TYPE_UNDEAD && !( DoAbilityCheck( ABILITY_INTELLIGENCE, 10 ) && GetCurrentHitPoints( oT ) > 60 ) ) { SetLocalInt( oCaster, "#SPL_" + IntToString( ++iCnt ), SPELL_HARM ); @@ -2234,14 +2235,14 @@ int GetTouchSpell( object oT, int iMinLvl=0, object oCaster=OBJECT_SELF ) { //4TH LEVEL BLK /* these spellabilities do not register - if ( GetHasSpell( SPELLABILITY_BG_INFLICT_CRITICAL_WOUNDS, oCaster ) && GetRacialType( oT ) != RACIAL_TYPE_UNDEAD && + if ( GetHasSpell( SPELLABILITY_BG_INFLICT_CRITICAL_WOUNDS, oCaster ) && MyPRCGetRacialType( oT ) != RACIAL_TYPE_UNDEAD && !( DoAbilityCheck( ABILITY_INTELLIGENCE, 10 ) && GetCurrentHitPoints( oT ) > 40 ) ) { SetLocalInt( oCaster, "#SPL_" + IntToString( ++iCnt ), SPELLABILITY_BG_INFLICT_CRITICAL_WOUNDS ); } */ //4TH LEVEL CLR - if ( GetHasSpell( SPELL_INFLICT_CRITICAL_WOUNDS, oCaster ) && GetRacialType( oT ) != RACIAL_TYPE_UNDEAD && + if ( GetHasSpell( SPELL_INFLICT_CRITICAL_WOUNDS, oCaster ) && MyPRCGetRacialType( oT ) != RACIAL_TYPE_UNDEAD && !( DoAbilityCheck( ABILITY_INTELLIGENCE, 10 ) && GetCurrentHitPoints( oT ) > 40 ) ) { SetLocalInt( oCaster, "#SPL_" + IntToString( ++iCnt ), SPELL_INFLICT_CRITICAL_WOUNDS ); @@ -2264,14 +2265,14 @@ int GetTouchSpell( object oT, int iMinLvl=0, object oCaster=OBJECT_SELF ) { //3RD LEVEL BLK /* these spellabilities do not register - if ( GetHasSpell( SPELLABILITY_BG_INFLICT_SERIOUS_WOUNDS, oCaster ) && GetRacialType( oT ) != RACIAL_TYPE_UNDEAD && + if ( GetHasSpell( SPELLABILITY_BG_INFLICT_SERIOUS_WOUNDS, oCaster ) && MyPRCGetRacialType( oT ) != RACIAL_TYPE_UNDEAD && !( DoAbilityCheck( ABILITY_INTELLIGENCE, 10 ) && GetCurrentHitPoints( oT ) > 30 ) ) { SetLocalInt( oCaster, "#SPL_" + IntToString( ++iCnt ), SPELLABILITY_BG_INFLICT_SERIOUS_WOUNDS ); } */ //3RD LEVEL CLR - if ( GetHasSpell( SPELL_INFLICT_SERIOUS_WOUNDS, oCaster ) && GetRacialType( oT ) != RACIAL_TYPE_UNDEAD && + if ( GetHasSpell( SPELL_INFLICT_SERIOUS_WOUNDS, oCaster ) && MyPRCGetRacialType( oT ) != RACIAL_TYPE_UNDEAD && !( DoAbilityCheck( ABILITY_INTELLIGENCE, 10 ) && GetCurrentHitPoints( oT ) > 30 ) ) { SetLocalInt( oCaster, "#SPL_" + IntToString( ++iCnt ), SPELL_INFLICT_SERIOUS_WOUNDS ); @@ -2309,7 +2310,7 @@ int GetTouchSpell( object oT, int iMinLvl=0, object oCaster=OBJECT_SELF ) { SetLocalInt( oCaster, "#SPL_" + IntToString( ++iCnt ), SPELL_GHOUL_TOUCH ); } - if ( GetHasSpell( SPELL_INFLICT_MODERATE_WOUNDS, oCaster ) && GetRacialType( oT ) != RACIAL_TYPE_UNDEAD && + if ( GetHasSpell( SPELL_INFLICT_MODERATE_WOUNDS, oCaster ) && MyPRCGetRacialType( oT ) != RACIAL_TYPE_UNDEAD && !( DoAbilityCheck( ABILITY_INTELLIGENCE, 10 ) && GetCurrentHitPoints( oT ) > 20 ) ) { SetLocalInt( oCaster, "#SPL_" + IntToString( ++iCnt ), SPELL_INFLICT_MODERATE_WOUNDS ); @@ -2320,7 +2321,7 @@ int GetTouchSpell( object oT, int iMinLvl=0, object oCaster=OBJECT_SELF ) if ( !iCnt || iMinLvl <=1 ) { //1ST LEVEL CLR - if ( GetHasSpell( SPELL_INFLICT_LIGHT_WOUNDS, oCaster ) && GetRacialType( oT ) != RACIAL_TYPE_UNDEAD && + if ( GetHasSpell( SPELL_INFLICT_LIGHT_WOUNDS, oCaster ) && MyPRCGetRacialType( oT ) != RACIAL_TYPE_UNDEAD && !( DoAbilityCheck( ABILITY_INTELLIGENCE, 10 ) && GetCurrentHitPoints( oT ) > 10 ) ) { SetLocalInt( oCaster, "#SPL_" + IntToString( ++iCnt ), SPELL_INFLICT_LIGHT_WOUNDS ); @@ -2331,7 +2332,7 @@ int GetTouchSpell( object oT, int iMinLvl=0, object oCaster=OBJECT_SELF ) if ( !iCnt || iMinLvl <=0 ) { //0TH LEVEL CLR - if ( GetHasSpell( SPELL_INFLICT_MINOR_WOUNDS, oCaster ) && GetRacialType( oT ) != RACIAL_TYPE_UNDEAD ) + if ( GetHasSpell( SPELL_INFLICT_MINOR_WOUNDS, oCaster ) && MyPRCGetRacialType( oT ) != RACIAL_TYPE_UNDEAD ) { SetLocalInt( oCaster, "#SPL_" + IntToString( ++iCnt ), SPELL_INFLICT_MINOR_WOUNDS ); } @@ -2837,7 +2838,7 @@ int GetEnhanceSpellSelf( int iMinLvl=1, object oCaster=OBJECT_SELF ) { SetLocalInt( oCaster, "#SPL_" + IntToString( ++iCnt ), SPELL_FOXS_CUNNING ); } - if ( GetHasSpell( SPELL_STONE_BONES, oCaster ) && GetRacialType( oCaster ) == RACIAL_TYPE_UNDEAD && !GetHasSpellEffect( SPELL_STONE_BONES, oCaster ) ) + if ( GetHasSpell( SPELL_STONE_BONES, oCaster ) && MyPRCGetRacialType( oCaster ) == RACIAL_TYPE_UNDEAD && !GetHasSpellEffect( SPELL_STONE_BONES, oCaster ) ) { SetLocalInt( oCaster, "#SPL_" + IntToString( ++iCnt ), SPELL_STONE_BONES ); } @@ -3002,7 +3003,7 @@ int GetEnhanceSpellSingle( int iMinLvl=1, object oEnt=OBJECT_SELF, object oCaste { SetLocalInt( oCaster, "#SPL_" + IntToString( ++iCnt ), SPELL_CATS_GRACE ); } - if ( GetHasSpell( SPELL_STONE_BONES, oCaster ) && GetRacialType( oEnt ) == RACIAL_TYPE_UNDEAD && !GetHasSpellEffect( SPELL_STONE_BONES, oEnt ) ) + if ( GetHasSpell( SPELL_STONE_BONES, oCaster ) && MyPRCGetRacialType( oEnt ) == RACIAL_TYPE_UNDEAD && !GetHasSpellEffect( SPELL_STONE_BONES, oEnt ) ) { SetLocalInt( oCaster, "#SPL_" + IntToString( ++iCnt ), SPELL_STONE_BONES ); } diff --git a/_module/nss/no_lib_priority.nss b/_module/nss/no_lib_priority.nss index 90684f0c..d09d9ea5 100644 --- a/_module/nss/no_lib_priority.nss +++ b/_module/nss/no_lib_priority.nss @@ -1,4 +1,5 @@ #include "no_inc_ptypes" +#include "prc_inc_racial" //functions void AddBehaviour( string sB, int iC, object oEnt=OBJECT_SELF ) @@ -293,7 +294,7 @@ int GetLastActionTimestamp( object oE=OBJECT_SELF ) void SetCorpseDelay( int iT=60, object oC=OBJECT_SELF ) { - if ( GetRacialType( oC ) != RACIAL_TYPE_UNDEAD && GetStringLeft( GetTag( oC ), 6 ) != "NO_AI_" && + if ( MyPRCGetRacialType( oC ) != RACIAL_TYPE_UNDEAD && GetStringLeft( GetTag( oC ), 6 ) != "NO_AI_" && GetName( GetItemInSlot( INVENTORY_SLOT_CARMOUR, oC ) ) != "Gargoyle Properties" ) { //not summoned, not undead, default decay time @@ -304,7 +305,7 @@ void SetCorpseDelay( int iT=60, object oC=OBJECT_SELF ) void SetIsFlier( int iF=FALSE, object oF=OBJECT_SELF ) { - if ( iF == TRUE || GetRacialType( oF ) == RACIAL_TYPE_DRAGON ) + if ( iF == TRUE || MyPRCGetRacialType( oF ) == RACIAL_TYPE_DRAGON ) { SetLocalInt( oF, "FLIER", 1 ); } diff --git a/_module/nss/nw_c2_default1.nss b/_module/nss/nw_c2_default1.nss index 76fd44d5..310c2d3e 100644 --- a/_module/nss/nw_c2_default1.nss +++ b/_module/nss/nw_c2_default1.nss @@ -25,6 +25,22 @@ void main() if (GetAILevel() == AI_LEVEL_VERY_LOW) return; ExecuteScript("prc_npc_hb", OBJECT_SELF); + +//:: Run Special AIs + //:: Diamond Golem AI + int nDiamondGolem = GetStringLeft(GetTag(OBJECT_SELF), 13) == "WT_DIAMONDGOL" ? TRUE : FALSE; + if(nDiamondGolem) + { + ExecuteScript("diamond_golem_hb",OBJECT_SELF); + + // Send the user-defined event signal if specified + if(GetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT)) + { + SignalEvent(OBJECT_SELF, EventUserDefined(EVENT_HEARTBEAT)); + } + + return; + } // Buff ourselves up right away if we should if(GetSpawnInCondition(NW_FLAG_FAST_BUFF_ENEMY)) diff --git a/_module/nss/nwnx_admin.nss b/_module/nss/nwnx_admin.nss index 7cd016e5..86cb319a 100644 --- a/_module/nss/nwnx_admin.nss +++ b/_module/nss/nwnx_admin.nss @@ -2,7 +2,6 @@ /// @brief Various admin related functions /// @{ /// @file nwnx_admin.nss -#include "nwnx" const string NWNX_Administration = "NWNX_Administration"; ///< @private @@ -179,213 +178,161 @@ void NWNX_Administration_SetMaxLevel(int nLevel); string NWNX_Administration_GetPlayerPassword() { - string sFunc = "GetPlayerPassword"; - - NWNX_CallFunction(NWNX_Administration, sFunc); - return NWNX_GetReturnValueString(); + NWNXCall(NWNX_Administration, "GetPlayerPassword"); + return NWNXPopString(); } void NWNX_Administration_SetPlayerPassword(string password) { - string sFunc = "SetPlayerPassword"; - - NWNX_PushArgumentString(password); - NWNX_CallFunction(NWNX_Administration, sFunc); + NWNXPushString(password); + NWNXCall(NWNX_Administration, "SetPlayerPassword"); } void NWNX_Administration_ClearPlayerPassword() { - string sFunc = "ClearPlayerPassword"; - - NWNX_CallFunction(NWNX_Administration, sFunc); + NWNXCall(NWNX_Administration, "ClearPlayerPassword"); } string NWNX_Administration_GetDMPassword() { - string sFunc = "GetDMPassword"; - - NWNX_CallFunction(NWNX_Administration, sFunc); - return NWNX_GetReturnValueString(); + NWNXCall(NWNX_Administration, "GetDMPassword"); + return NWNXPopString(); } void NWNX_Administration_SetDMPassword(string password) { - string sFunc = "SetDMPassword"; - - NWNX_PushArgumentString(password); - NWNX_CallFunction(NWNX_Administration, sFunc); + NWNXPushString(password); + NWNXCall(NWNX_Administration, "SetDMPassword"); } void NWNX_Administration_ShutdownServer() { - string sFunc = "ShutdownServer"; - - NWNX_CallFunction(NWNX_Administration, sFunc); + NWNXCall(NWNX_Administration, "ShutdownServer"); } void NWNX_Administration_DeletePlayerCharacter(object oPC, int bPreserveBackup = TRUE, string sKickMessage = "") { - string sFunc = "DeletePlayerCharacter"; - - NWNX_PushArgumentString(sKickMessage); - NWNX_PushArgumentInt(bPreserveBackup); - NWNX_PushArgumentObject(oPC); - NWNX_CallFunction(NWNX_Administration, sFunc); + NWNXPushString(sKickMessage); + NWNXPushInt(bPreserveBackup); + NWNXPushObject(oPC); + NWNXCall(NWNX_Administration, "DeletePlayerCharacter"); } void NWNX_Administration_AddBannedIP(string ip) { - string sFunc = "AddBannedIP"; - - NWNX_PushArgumentString(ip); - NWNX_CallFunction(NWNX_Administration, sFunc); + NWNXPushString(ip); + NWNXCall(NWNX_Administration, "AddBannedIP"); } void NWNX_Administration_RemoveBannedIP(string ip) { - string sFunc = "RemoveBannedIP"; - - NWNX_PushArgumentString(ip); - NWNX_CallFunction(NWNX_Administration, sFunc); + NWNXPushString(ip); + NWNXCall(NWNX_Administration, "RemoveBannedIP"); } void NWNX_Administration_AddBannedCDKey(string key) { - string sFunc = "AddBannedCDKey"; - - NWNX_PushArgumentString(key); - NWNX_CallFunction(NWNX_Administration, sFunc); + NWNXPushString(key); + NWNXCall(NWNX_Administration, "AddBannedCDKey"); } void NWNX_Administration_RemoveBannedCDKey(string key) { - string sFunc = "RemoveBannedCDKey"; - - NWNX_PushArgumentString(key); - NWNX_CallFunction(NWNX_Administration, sFunc); + NWNXPushString(key); + NWNXCall(NWNX_Administration, "RemoveBannedCDKey"); } void NWNX_Administration_AddBannedPlayerName(string playerName) { - string sFunc = "AddBannedPlayerName"; - - NWNX_PushArgumentString(playerName); - NWNX_CallFunction(NWNX_Administration, sFunc); + NWNXPushString(playerName); + NWNXCall(NWNX_Administration, "AddBannedPlayerName"); } void NWNX_Administration_RemoveBannedPlayerName(string playerName) { - string sFunc = "RemoveBannedPlayerName"; - - NWNX_PushArgumentString(playerName); - NWNX_CallFunction(NWNX_Administration, sFunc); + NWNXPushString(playerName); + NWNXCall(NWNX_Administration, "RemoveBannedPlayerName"); } string NWNX_Administration_GetBannedList() { - string sFunc = "GetBannedList"; - - NWNX_CallFunction(NWNX_Administration, sFunc); - return NWNX_GetReturnValueString(); + NWNXCall(NWNX_Administration, "GetBannedList"); + return NWNXPopString(); } void NWNX_Administration_SetModuleName(string name) { - string sFunc = "SetModuleName"; - - NWNX_PushArgumentString(name); - NWNX_CallFunction(NWNX_Administration, sFunc); + NWNXPushString(name); + NWNXCall(NWNX_Administration, "SetModuleName"); } void NWNX_Administration_SetServerName(string name) { - string sFunc = "SetServerName"; - - NWNX_PushArgumentString(name); - NWNX_CallFunction(NWNX_Administration, sFunc); + NWNXPushString(name); + NWNXCall(NWNX_Administration, "SetServerName"); } string NWNX_Administration_GetServerName() { - string sFunc = "GetServerName"; - NWNX_CallFunction(NWNX_Administration, sFunc); - return NWNX_GetReturnValueString(); + NWNXCall(NWNX_Administration, "GetServerName"); + return NWNXPopString(); } int NWNX_Administration_GetPlayOption(int option) { - string sFunc = "GetPlayOption"; - - NWNX_PushArgumentInt(option); - NWNX_CallFunction(NWNX_Administration, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushInt(option); + NWNXCall(NWNX_Administration, "GetPlayOption"); + return NWNXPopInt(); } void NWNX_Administration_SetPlayOption(int option, int value) { - string sFunc = "SetPlayOption"; - - NWNX_PushArgumentInt(value); - NWNX_PushArgumentInt(option); - NWNX_CallFunction(NWNX_Administration, sFunc); + NWNXPushInt(value); + NWNXPushInt(option); + NWNXCall(NWNX_Administration, "SetPlayOption"); } int NWNX_Administration_DeleteTURD(string playerName, string characterName) { - string sFunc = "DeleteTURD"; - - NWNX_PushArgumentString(characterName); - NWNX_PushArgumentString(playerName); - NWNX_CallFunction(NWNX_Administration, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushString(characterName); + NWNXPushString(playerName); + NWNXCall(NWNX_Administration, "DeleteTURD"); + return NWNXPopInt(); } int NWNX_Administration_GetDebugValue(int type) { - string sFunc = "GetDebugValue"; - - NWNX_PushArgumentInt(type); - NWNX_CallFunction(NWNX_Administration, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushInt(type); + NWNXCall(NWNX_Administration, "GetDebugValue"); + return NWNXPopInt(); } void NWNX_Administration_SetDebugValue(int type, int state) { - string sFunc = "SetDebugValue"; - - NWNX_PushArgumentInt(state); - NWNX_PushArgumentInt(type); - NWNX_CallFunction(NWNX_Administration, sFunc); + NWNXPushInt(state); + NWNXPushInt(type); + NWNXCall(NWNX_Administration, "SetDebugValue"); } void NWNX_Administration_ReloadRules() { - string sFunc = "ReloadRules"; - - NWNX_CallFunction(NWNX_Administration, sFunc); + NWNXCall(NWNX_Administration, "ReloadRules"); } int NWNX_Administration_GetMinLevel() { - string sFunc = "GetMinLevel"; - NWNX_CallFunction(NWNX_Administration, sFunc); - return NWNX_GetReturnValueInt(); + NWNXCall(NWNX_Administration, "GetMinLevel"); + return NWNXPopInt(); } void NWNX_Administration_SetMinLevel(int nLevel) { - string sFunc = "SetMinLevel"; - NWNX_PushArgumentInt(nLevel); - NWNX_CallFunction(NWNX_Administration, sFunc); + NWNXPushInt(nLevel); + NWNXCall(NWNX_Administration, "SetMinLevel"); } int NWNX_Administration_GetMaxLevel() { - string sFunc = "GetMaxLevel"; - NWNX_CallFunction(NWNX_Administration, sFunc); - return NWNX_GetReturnValueInt(); + NWNXCall(NWNX_Administration, "GetMaxLevel"); + return NWNXPopInt(); } void NWNX_Administration_SetMaxLevel(int nLevel) { - string sFunc = "SetMaxLevel"; - NWNX_PushArgumentInt(nLevel); - NWNX_CallFunction(NWNX_Administration, sFunc); + NWNXPushInt(nLevel); + NWNXCall(NWNX_Administration, "SetMaxLevel"); } diff --git a/_module/nss/nwnx_appearance.nss b/_module/nss/nwnx_appearance.nss index 9e8ed1fd..4c85eb14 100644 --- a/_module/nss/nwnx_appearance.nss +++ b/_module/nss/nwnx_appearance.nss @@ -2,7 +2,6 @@ /// @brief Allows the appearance and some other things of creatures to be overridden per player. /// @{ /// @file nwnx_appearance.nss -#include "nwnx" const string NWNX_Appearance = "NWNX_Appearance"; ///< @private @@ -49,25 +48,18 @@ int NWNX_Appearance_GetOverride(object oPlayer, object oCreature, int nType); void NWNX_Appearance_SetOverride(object oPlayer, object oCreature, int nType, int nValue) { - string sFunc = "SetOverride"; - - NWNX_PushArgumentInt(nValue); - NWNX_PushArgumentInt(nType); - NWNX_PushArgumentObject(oCreature); - NWNX_PushArgumentObject(oPlayer); - - NWNX_CallFunction(NWNX_Appearance, sFunc); + NWNXPushInt(nValue); + NWNXPushInt(nType); + NWNXPushObject(oCreature); + NWNXPushObject(oPlayer); + NWNXCall(NWNX_Appearance, "SetOverride"); } int NWNX_Appearance_GetOverride(object oPlayer, object oCreature, int nType) { - string sFunc = "GetOverride"; - - NWNX_PushArgumentInt(nType); - NWNX_PushArgumentObject(oCreature); - NWNX_PushArgumentObject(oPlayer); - - NWNX_CallFunction(NWNX_Appearance, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushInt(nType); + NWNXPushObject(oCreature); + NWNXPushObject(oPlayer); + NWNXCall(NWNX_Appearance, "GetOverride"); + return NWNXPopInt(); } diff --git a/_module/nss/nwnx_area.nss b/_module/nss/nwnx_area.nss index cfb90add..d096c8a4 100644 --- a/_module/nss/nwnx_area.nss +++ b/_module/nss/nwnx_area.nss @@ -2,7 +2,6 @@ /// @brief Functions exposing additional area properties as well as creating transitions. /// @{ /// @file nwnx_area.nss -#include "nwnx" const string NWNX_Area = "NWNX_Area"; ///< @private @@ -353,536 +352,396 @@ void NWNX_Area_SetDefaultObjectUiDiscoveryMask(object oArea, int nObjectTypes, i int NWNX_Area_GetNumberOfPlayersInArea(object area) { - string sFunc = "GetNumberOfPlayersInArea"; - - NWNX_PushArgumentObject(area); - NWNX_CallFunction(NWNX_Area, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(area); + NWNXCall(NWNX_Area, "GetNumberOfPlayersInArea"); + return NWNXPopInt(); } object NWNX_Area_GetLastEntered(object area) { - string sFunc = "GetLastEntered"; - - NWNX_PushArgumentObject(area); - NWNX_CallFunction(NWNX_Area, sFunc); - - return NWNX_GetReturnValueObject(); + NWNXPushObject(area); + NWNXCall(NWNX_Area, "GetLastEntered"); + return NWNXPopObject(); } object NWNX_Area_GetLastLeft(object area) { - string sFunc = "GetLastLeft"; - - NWNX_PushArgumentObject(area); - NWNX_CallFunction(NWNX_Area, sFunc); - - return NWNX_GetReturnValueObject(); + NWNXPushObject(area); + NWNXCall(NWNX_Area, "GetLastLeft"); + return NWNXPopObject(); } int NWNX_Area_GetPVPSetting(object area) { - string sFunc = "GetPVPSetting"; - - NWNX_PushArgumentObject(area); - NWNX_CallFunction(NWNX_Area, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(area); + NWNXCall(NWNX_Area, "GetPVPSetting"); + return NWNXPopInt(); } void NWNX_Area_SetPVPSetting(object area, int pvpSetting) { - string sFunc = "SetPVPSetting"; - - NWNX_PushArgumentInt(pvpSetting); - NWNX_PushArgumentObject(area); - NWNX_CallFunction(NWNX_Area, sFunc); + NWNXPushInt(pvpSetting); + NWNXPushObject(area); + NWNXCall(NWNX_Area, "SetPVPSetting"); } int NWNX_Area_GetAreaSpotModifier(object area) { - string sFunc = "GetAreaSpotModifier"; - - NWNX_PushArgumentObject(area); - NWNX_CallFunction(NWNX_Area, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(area); + NWNXCall(NWNX_Area, "GetAreaSpotModifier"); + return NWNXPopInt(); } void NWNX_Area_SetAreaSpotModifier(object area, int spotModifier) { - string sFunc = "SetAreaSpotModifier"; - - NWNX_PushArgumentInt(spotModifier); - NWNX_PushArgumentObject(area); - NWNX_CallFunction(NWNX_Area, sFunc); + NWNXPushInt(spotModifier); + NWNXPushObject(area); + NWNXCall(NWNX_Area, "SetAreaSpotModifier"); } int NWNX_Area_GetAreaListenModifier(object area) { - string sFunc = "GetAreaListenModifier"; - - NWNX_PushArgumentObject(area); - NWNX_CallFunction(NWNX_Area, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(area); + NWNXCall(NWNX_Area, "GetAreaListenModifier"); + return NWNXPopInt(); } void NWNX_Area_SetAreaListenModifier(object area, int listenModifier) { - string sFunc = "SetAreaListenModifier"; - - NWNX_PushArgumentInt(listenModifier); - NWNX_PushArgumentObject(area); - NWNX_CallFunction(NWNX_Area, sFunc); + NWNXPushInt(listenModifier); + NWNXPushObject(area); + NWNXCall(NWNX_Area, "SetAreaListenModifier"); } int NWNX_Area_GetNoRestingAllowed(object area) { - string sFunc = "GetNoRestingAllowed"; - - NWNX_PushArgumentObject(area); - NWNX_CallFunction(NWNX_Area, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(area); + NWNXCall(NWNX_Area, "GetNoRestingAllowed"); + return NWNXPopInt(); } void NWNX_Area_SetNoRestingAllowed(object area, int bNoRestingAllowed) { - string sFunc = "SetNoRestingAllowed"; - - NWNX_PushArgumentInt(bNoRestingAllowed); - NWNX_PushArgumentObject(area); - NWNX_CallFunction(NWNX_Area, sFunc); + NWNXPushInt(bNoRestingAllowed); + NWNXPushObject(area); + NWNXCall(NWNX_Area, "SetNoRestingAllowed"); } int NWNX_Area_GetWindPower(object area) { - string sFunc = "GetWindPower"; - - NWNX_PushArgumentObject(area); - NWNX_CallFunction(NWNX_Area, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(area); + NWNXCall(NWNX_Area, "GetWindPower"); + return NWNXPopInt(); } void NWNX_Area_SetWindPower(object area, int windPower) { - string sFunc = "SetWindPower"; - - NWNX_PushArgumentInt(windPower); - NWNX_PushArgumentObject(area); - NWNX_CallFunction(NWNX_Area, sFunc); + NWNXPushInt(windPower); + NWNXPushObject(area); + NWNXCall(NWNX_Area, "SetWindPower"); } int NWNX_Area_GetWeatherChance(object area, int type) { - string sFunc = "GetWeatherChance"; - - NWNX_PushArgumentInt(type); - NWNX_PushArgumentObject(area); - NWNX_CallFunction(NWNX_Area, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushInt(type); + NWNXPushObject(area); + NWNXCall(NWNX_Area, "GetWeatherChance"); + return NWNXPopInt(); } void NWNX_Area_SetWeatherChance(object area, int type, int chance) { - string sFunc = "SetWeatherChance"; - - NWNX_PushArgumentInt(chance); - NWNX_PushArgumentInt(type); - NWNX_PushArgumentObject(area); - NWNX_CallFunction(NWNX_Area, sFunc); + NWNXPushInt(chance); + NWNXPushInt(type); + NWNXPushObject(area); + NWNXCall(NWNX_Area, "SetWeatherChance"); } float NWNX_Area_GetFogClipDistance(object area) { - string sFunc = "GetFogClipDistance"; - - NWNX_PushArgumentObject(area); - NWNX_CallFunction(NWNX_Area, sFunc); - - return NWNX_GetReturnValueFloat(); + NWNXPushObject(area); + NWNXCall(NWNX_Area, "GetFogClipDistance"); + return NWNXPopFloat(); } void NWNX_Area_SetFogClipDistance(object area, float distance) { - string sFunc = "SetFogClipDistance"; - - NWNX_PushArgumentFloat(distance); - NWNX_PushArgumentObject(area); - NWNX_CallFunction(NWNX_Area, sFunc); + NWNXPushFloat(distance); + NWNXPushObject(area); + NWNXCall(NWNX_Area, "SetFogClipDistance"); } int NWNX_Area_GetShadowOpacity(object area) { - string sFunc = "GetShadowOpacity"; - - NWNX_PushArgumentObject(area); - NWNX_CallFunction(NWNX_Area, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(area); + NWNXCall(NWNX_Area, "GetShadowOpacity"); + return NWNXPopInt(); } void NWNX_Area_SetShadowOpacity(object area, int shadowOpacity) { - string sFunc = "SetShadowOpacity"; - - NWNX_PushArgumentInt(shadowOpacity); - NWNX_PushArgumentObject(area); - NWNX_CallFunction(NWNX_Area, sFunc); + NWNXPushInt(shadowOpacity); + NWNXPushObject(area); + NWNXCall(NWNX_Area, "SetShadowOpacity"); } int NWNX_Area_GetDayNightCycle(object area) { - string sFunc = "GetDayNightCycle"; - - NWNX_PushArgumentObject(area); - NWNX_CallFunction(NWNX_Area, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(area); + NWNXCall(NWNX_Area, "GetDayNightCycle"); + return NWNXPopInt(); } void NWNX_Area_SetDayNightCycle(object area, int type) { - string sFunc = "SetDayNightCycle"; - - NWNX_PushArgumentInt(type); - NWNX_PushArgumentObject(area); - NWNX_CallFunction(NWNX_Area, sFunc); + NWNXPushInt(type); + NWNXPushObject(area); + NWNXCall(NWNX_Area, "SetDayNightCycle"); } int NWNX_Area_GetSunMoonColors(object area, int type) { - string sFunc = "GetSunMoonColors"; - - NWNX_PushArgumentInt(type); - NWNX_PushArgumentObject(area); - NWNX_CallFunction(NWNX_Area, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushInt(type); + NWNXPushObject(area); + NWNXCall(NWNX_Area, "GetSunMoonColors"); + return NWNXPopInt(); } void NWNX_Area_SetSunMoonColors(object area, int type, int color) { - string sFunc = "SetSunMoonColors"; - - NWNX_PushArgumentInt(color); - NWNX_PushArgumentInt(type); - NWNX_PushArgumentObject(area); - NWNX_CallFunction(NWNX_Area, sFunc); + NWNXPushInt(color); + NWNXPushInt(type); + NWNXPushObject(area); + NWNXCall(NWNX_Area, "SetSunMoonColors"); } object NWNX_Area_CreateTransition(object area, object target, float x, float y, float z, float size = 2.0f, string tag="") { - string sFunc = "CreateTransition"; - - NWNX_PushArgumentString(tag); - NWNX_PushArgumentFloat(size); - NWNX_PushArgumentFloat(z); - NWNX_PushArgumentFloat(y); - NWNX_PushArgumentFloat(x); - NWNX_PushArgumentObject(target); - NWNX_PushArgumentObject(area); - NWNX_CallFunction(NWNX_Area, sFunc); - - return NWNX_GetReturnValueObject(); + NWNXPushString(tag); + NWNXPushFloat(size); + NWNXPushFloat(z); + NWNXPushFloat(y); + NWNXPushFloat(x); + NWNXPushObject(target); + NWNXPushObject(area); + NWNXCall(NWNX_Area, "CreateTransition"); + return NWNXPopObject(); } int NWNX_Area_GetTileAnimationLoop(object oArea, float fTileX, float fTileY, int nAnimLoop) { - string sFunc = "GetTileAnimationLoop"; + NWNXPushInt(nAnimLoop); + NWNXPushFloat(fTileY); + NWNXPushFloat(fTileX); + NWNXPushObject(oArea); - NWNX_PushArgumentInt(nAnimLoop); - NWNX_PushArgumentFloat(fTileY); - NWNX_PushArgumentFloat(fTileX); - NWNX_PushArgumentObject(oArea); - - NWNX_CallFunction(NWNX_Area, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXCall(NWNX_Area, "GetTileAnimationLoop"); + return NWNXPopInt(); } void NWNX_Area_SetTileAnimationLoop(object oArea, float fTileX, float fTileY, int nAnimLoop, int bEnabled) { - string sFunc = "SetTileAnimationLoop"; - - NWNX_PushArgumentInt(bEnabled); - NWNX_PushArgumentInt(nAnimLoop); - NWNX_PushArgumentFloat(fTileY); - NWNX_PushArgumentFloat(fTileX); - NWNX_PushArgumentObject(oArea); - - NWNX_CallFunction(NWNX_Area, sFunc); + NWNXPushInt(bEnabled); + NWNXPushInt(nAnimLoop); + NWNXPushFloat(fTileY); + NWNXPushFloat(fTileX); + NWNXPushObject(oArea); + NWNXCall(NWNX_Area, "SetTileAnimationLoop"); } string NWNX_Area_GetTileModelResRef(object oArea, float fTileX, float fTileY) { - string sFunc = "GetTileModelResRef"; - NWNX_PushArgumentFloat(fTileY); - NWNX_PushArgumentFloat(fTileX); - NWNX_PushArgumentObject(oArea); - - NWNX_CallFunction(NWNX_Area, sFunc); - - return NWNX_GetReturnValueString(); + NWNXPushFloat(fTileY); + NWNXPushFloat(fTileX); + NWNXPushObject(oArea); + NWNXCall(NWNX_Area, "GetTileModelResRef"); + return NWNXPopString(); } int NWNX_Area_TestDirectLine(object oArea, float fStartX, float fStartY, float fEndX, float fEndY, float fPerSpace, float fHeight, int bIgnoreDoors=FALSE) { - string sFunc = "TestDirectLine"; - - NWNX_PushArgumentInt(bIgnoreDoors); - NWNX_PushArgumentFloat(fHeight); - NWNX_PushArgumentFloat(fPerSpace); - NWNX_PushArgumentFloat(fEndY); - NWNX_PushArgumentFloat(fEndX); - NWNX_PushArgumentFloat(fStartY); - NWNX_PushArgumentFloat(fStartX); - NWNX_PushArgumentObject(oArea); - - NWNX_CallFunction(NWNX_Area, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushInt(bIgnoreDoors); + NWNXPushFloat(fHeight); + NWNXPushFloat(fPerSpace); + NWNXPushFloat(fEndY); + NWNXPushFloat(fEndX); + NWNXPushFloat(fStartY); + NWNXPushFloat(fStartX); + NWNXPushObject(oArea); + NWNXCall(NWNX_Area, "TestDirectLine"); + return NWNXPopInt(); } int NWNX_Area_GetMusicIsPlaying(object oArea, int bBattleMusic = FALSE) { - string sFunc = "GetMusicIsPlaying"; - - NWNX_PushArgumentInt(bBattleMusic); - NWNX_PushArgumentObject(oArea); - NWNX_CallFunction(NWNX_Area, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushInt(bBattleMusic); + NWNXPushObject(oArea); + NWNXCall(NWNX_Area, "GetMusicIsPlaying"); + return NWNXPopInt(); } object NWNX_Area_CreateGenericTrigger(object oArea, float fX, float fY, float fZ, string sTag = "", float fSize = 1.0f) { - string sFunc = "CreateGenericTrigger"; - - NWNX_PushArgumentFloat(fSize); - NWNX_PushArgumentString(sTag); - NWNX_PushArgumentFloat(fZ); - NWNX_PushArgumentFloat(fY); - NWNX_PushArgumentFloat(fX); - NWNX_PushArgumentObject(oArea); - NWNX_CallFunction(NWNX_Area, sFunc); - - return NWNX_GetReturnValueObject(); + NWNXPushFloat(fSize); + NWNXPushString(sTag); + NWNXPushFloat(fZ); + NWNXPushFloat(fY); + NWNXPushFloat(fX); + NWNXPushObject(oArea); + NWNXCall(NWNX_Area, "CreateGenericTrigger"); + return NWNXPopObject(); } void NWNX_Area_AddObjectToExclusionList(object oObject) { - string sFunc = "AddObjectToExclusionList"; - - NWNX_PushArgumentObject(oObject); - NWNX_CallFunction(NWNX_Area, sFunc); + NWNXPushObject(oObject); + NWNXCall(NWNX_Area, "AddObjectToExclusionList"); } void NWNX_Area_RemoveObjectFromExclusionList(object oObject) { - string sFunc = "RemoveObjectFromExclusionList"; - - NWNX_PushArgumentObject(oObject); - NWNX_CallFunction(NWNX_Area, sFunc); + NWNXPushObject(oObject); + NWNXCall(NWNX_Area, "RemoveObjectFromExclusionList"); } int NWNX_Area_ExportGIT(object oArea, string sFileName = "", int bExportVarTable = TRUE, int bExportUUID = TRUE, int nObjectFilter = 0, string sAlias = "NWNX") { - string sFunc = "ExportGIT"; - - NWNX_PushArgumentString(sAlias); - NWNX_PushArgumentInt(nObjectFilter); - NWNX_PushArgumentInt(bExportUUID); - NWNX_PushArgumentInt(bExportVarTable); - NWNX_PushArgumentString(sFileName); - NWNX_PushArgumentObject(oArea); - NWNX_CallFunction(NWNX_Area, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushString(sAlias); + NWNXPushInt(nObjectFilter); + NWNXPushInt(bExportUUID); + NWNXPushInt(bExportVarTable); + NWNXPushString(sFileName); + NWNXPushObject(oArea); + NWNXCall(NWNX_Area, "ExportGIT"); + return NWNXPopInt(); } struct NWNX_Area_TileInfo NWNX_Area_GetTileInfo(object oArea, float fTileX, float fTileY) { - string sFunc = "GetTileInfo"; - - NWNX_PushArgumentFloat(fTileY); - NWNX_PushArgumentFloat(fTileX); - NWNX_PushArgumentObject(oArea); - NWNX_CallFunction(NWNX_Area, sFunc); - + NWNXPushFloat(fTileY); + NWNXPushFloat(fTileX); + NWNXPushObject(oArea); + NWNXCall(NWNX_Area, "GetTileInfo"); struct NWNX_Area_TileInfo str; - - str.nGridY = NWNX_GetReturnValueInt(); - str.nGridX = NWNX_GetReturnValueInt(); - str.nOrientation = NWNX_GetReturnValueInt(); - str.nHeight = NWNX_GetReturnValueInt(); - str.nID = NWNX_GetReturnValueInt(); - + str.nGridY = NWNXPopInt(); + str.nGridX = NWNXPopInt(); + str.nOrientation = NWNXPopInt(); + str.nHeight = NWNXPopInt(); + str.nID = NWNXPopInt(); return str; } int NWNX_Area_ExportARE(object oArea, string sFileName, string sNewName = "", string sNewTag = "", string sAlias = "NWNX") { - string sFunc = "ExportARE"; - - NWNX_PushArgumentString(sAlias); - NWNX_PushArgumentString(sNewTag); - NWNX_PushArgumentString(sNewName); - NWNX_PushArgumentString(sFileName); - NWNX_PushArgumentObject(oArea); - NWNX_CallFunction(NWNX_Area, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushString(sAlias); + NWNXPushString(sNewTag); + NWNXPushString(sNewName); + NWNXPushString(sFileName); + NWNXPushObject(oArea); + NWNXCall(NWNX_Area, "ExportARE"); + return NWNXPopInt(); } int NWNX_Area_GetAmbientSoundDay(object oArea) { - string sFunc = "GetAmbientSoundDay"; - - NWNX_PushArgumentObject(oArea); - NWNX_CallFunction(NWNX_Area, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(oArea); + NWNXCall(NWNX_Area, "GetAmbientSoundDay"); + return NWNXPopInt(); } int NWNX_Area_GetAmbientSoundNight(object oArea) { - string sFunc = "GetAmbientSoundNight"; - - NWNX_PushArgumentObject(oArea); - NWNX_CallFunction(NWNX_Area, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(oArea); + NWNXCall(NWNX_Area, "GetAmbientSoundNight"); + return NWNXPopInt(); } int NWNX_Area_GetAmbientSoundDayVolume(object oArea) { - string sFunc = "GetAmbientSoundDayVolume"; - - NWNX_PushArgumentObject(oArea); - NWNX_CallFunction(NWNX_Area, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(oArea); + NWNXCall(NWNX_Area, "GetAmbientSoundDayVolume"); + return NWNXPopInt(); } int NWNX_Area_GetAmbientSoundNightVolume(object oArea) { - string sFunc = "GetAmbientSoundNightVolume"; - - NWNX_PushArgumentObject(oArea); - NWNX_CallFunction(NWNX_Area, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(oArea); + NWNXCall(NWNX_Area, "GetAmbientSoundNightVolume"); + return NWNXPopInt(); } object NWNX_Area_CreateSoundObject(object oArea, vector vPosition, string sResRef) { - string sFunc = "CreateSoundObject"; - - NWNX_PushArgumentString(sResRef); - NWNX_PushArgumentFloat(vPosition.z); - NWNX_PushArgumentFloat(vPosition.y); - NWNX_PushArgumentFloat(vPosition.x); - NWNX_PushArgumentObject(oArea); - - NWNX_CallFunction(NWNX_Area, sFunc); - - return NWNX_GetReturnValueObject(); + NWNXPushString(sResRef); + NWNXPushVector(vPosition); + NWNXPushObject(oArea); + NWNXCall(NWNX_Area, "CreateSoundObject"); + return NWNXPopObject(); } void NWNX_Area_RotateArea(object oArea, int nRotation) { - string sFunc = "RotateArea"; - - NWNX_PushArgumentInt(nRotation); - NWNX_PushArgumentObject(oArea); - - NWNX_CallFunction(NWNX_Area, sFunc); + NWNXPushInt(nRotation); + NWNXPushObject(oArea); + NWNXCall(NWNX_Area, "RotateArea"); } struct NWNX_Area_TileInfo NWNX_Area_GetTileInfoByTileIndex(object oArea, int nIndex) { - string sFunc = "GetTileInfoByTileIndex"; - - NWNX_PushArgumentInt(nIndex); - NWNX_PushArgumentObject(oArea); - NWNX_CallFunction(NWNX_Area, sFunc); - + NWNXPushInt(nIndex); + NWNXPushObject(oArea); + NWNXCall(NWNX_Area, "GetTileInfoByTileIndex"); struct NWNX_Area_TileInfo str; - - str.nGridY = NWNX_GetReturnValueInt(); - str.nGridX = NWNX_GetReturnValueInt(); - str.nOrientation = NWNX_GetReturnValueInt(); - str.nHeight = NWNX_GetReturnValueInt(); - str.nID = NWNX_GetReturnValueInt(); - + str.nGridY = NWNXPopInt(); + str.nGridX = NWNXPopInt(); + str.nOrientation = NWNXPopInt(); + str.nHeight = NWNXPopInt(); + str.nID = NWNXPopInt(); return str; } int NWNX_Area_GetPathExists(object oArea, vector vStartPosition, vector vEndPosition, int nMaxDepth) { - string sFunc = "GetPathExists"; - - NWNX_PushArgumentInt(nMaxDepth); - NWNX_PushArgumentFloat(vEndPosition.y); - NWNX_PushArgumentFloat(vEndPosition.x); - NWNX_PushArgumentFloat(vStartPosition.y); - NWNX_PushArgumentFloat(vStartPosition.x); - NWNX_PushArgumentObject(oArea); - NWNX_CallFunction(NWNX_Area, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushInt(nMaxDepth); + NWNXPushVector(vEndPosition); + NWNXPushVector(vStartPosition); + NWNXPushObject(oArea); + NWNXCall(NWNX_Area, "GetPathExists"); + return NWNXPopInt(); } int NWNX_Area_GetAreaFlags(object oArea) { - string sFunc = "GetAreaFlags"; - - NWNX_PushArgumentObject(oArea); - NWNX_CallFunction(NWNX_Area, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(oArea); + NWNXCall(NWNX_Area, "GetAreaFlags"); + return NWNXPopInt(); } void NWNX_Area_SetAreaFlags(object oArea, int nFlags) { - string sFunc = "SetAreaFlags"; - - NWNX_PushArgumentInt(nFlags); - NWNX_PushArgumentObject(oArea); - NWNX_CallFunction(NWNX_Area, sFunc); + NWNXPushInt(nFlags); + NWNXPushObject(oArea); + NWNXCall(NWNX_Area, "SetAreaFlags"); } struct NWNX_Area_AreaWind NWNX_Area_GetAreaWind(object oArea) { - string sFunc = "GetAreaWind"; struct NWNX_Area_AreaWind data; - - NWNX_PushArgumentObject(oArea); - NWNX_CallFunction(NWNX_Area, sFunc); - - data.fPitch = NWNX_GetReturnValueFloat(); - data.fYaw = NWNX_GetReturnValueFloat(); - data.fMagnitude = NWNX_GetReturnValueFloat(); - data.vDirection.x = NWNX_GetReturnValueFloat(); - data.vDirection.y = NWNX_GetReturnValueFloat(); - data.vDirection.z = NWNX_GetReturnValueFloat(); - + NWNXPushObject(oArea); + NWNXCall(NWNX_Area, "GetAreaWind"); + data.fPitch = NWNXPopFloat(); + data.fYaw = NWNXPopFloat(); + data.fMagnitude = NWNXPopFloat(); + data.vDirection = NWNXPopVector(); return data; } void NWNX_Area_SetDefaultObjectUiDiscoveryMask(object oArea, int nObjectTypes, int nMask, int bForceUpdate = FALSE) { - string sFunc = "SetDefaultObjectUiDiscoveryMask"; - - NWNX_PushArgumentInt(bForceUpdate); - NWNX_PushArgumentInt(nMask); - NWNX_PushArgumentInt(nObjectTypes); - NWNX_PushArgumentObject(oArea); - NWNX_CallFunction(NWNX_Area, sFunc); + NWNXPushInt(bForceUpdate); + NWNXPushInt(nMask); + NWNXPushInt(nObjectTypes); + NWNXPushObject(oArea); + NWNXCall(NWNX_Area, "SetDefaultObjectUiDiscoveryMask"); } diff --git a/_module/nss/nwnx_chat.nss b/_module/nss/nwnx_chat.nss index ffa12df1..538fb2b8 100644 --- a/_module/nss/nwnx_chat.nss +++ b/_module/nss/nwnx_chat.nss @@ -2,7 +2,6 @@ /// @brief Functions related to chat. /// @{ /// @file nwnx_chat.nss -#include "nwnx" const string NWNX_Chat = "NWNX_Chat"; ///< @private @@ -80,79 +79,61 @@ float NWNX_Chat_GetChatHearingDistance(object listener = OBJECT_INVALID, int cha int NWNX_Chat_SendMessage(int channel, string message, object sender = OBJECT_SELF, object target = OBJECT_INVALID) { - string sFunc = "SendMessage"; - - NWNX_PushArgumentObject(target); - NWNX_PushArgumentObject(sender); - NWNX_PushArgumentString(message); - NWNX_PushArgumentInt(channel); - NWNX_CallFunction(NWNX_Chat, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushObject(target); + NWNXPushObject(sender); + NWNXPushString(message); + NWNXPushInt(channel); + NWNXCall(NWNX_Chat, "SendMessage"); + return NWNXPopInt(); } void NWNX_Chat_RegisterChatScript(string script) { - string sFunc = "RegisterChatScript"; - - NWNX_PushArgumentString(script); - NWNX_CallFunction(NWNX_Chat, sFunc); + NWNXPushString(script); + NWNXCall(NWNX_Chat, "RegisterChatScript"); } void NWNX_Chat_SkipMessage() { - string sFunc = "SkipMessage"; - - NWNX_CallFunction(NWNX_Chat, sFunc); + NWNXCall(NWNX_Chat, "SkipMessage"); } int NWNX_Chat_GetChannel() { - string sFunc = "GetChannel"; - - NWNX_CallFunction(NWNX_Chat, sFunc); - return NWNX_GetReturnValueInt(); + NWNXCall(NWNX_Chat, "GetChannel"); + return NWNXPopInt(); } string NWNX_Chat_GetMessage() { - string sFunc = "GetMessage"; - - NWNX_CallFunction(NWNX_Chat, sFunc); - return NWNX_GetReturnValueString(); + NWNXCall(NWNX_Chat, "GetMessage"); + return NWNXPopString(); } object NWNX_Chat_GetSender() { - string sFunc = "GetSender"; - - NWNX_CallFunction(NWNX_Chat, sFunc); - return NWNX_GetReturnValueObject(); + NWNXCall(NWNX_Chat, "GetSender"); + return NWNXPopObject(); } object NWNX_Chat_GetTarget() { - string sFunc = "GetTarget"; - - NWNX_CallFunction(NWNX_Chat, sFunc); - return NWNX_GetReturnValueObject(); + NWNXCall(NWNX_Chat, "GetTarget"); + return NWNXPopObject(); } void NWNX_Chat_SetChatHearingDistance(float distance, object listener = OBJECT_INVALID, int channel = NWNX_CHAT_CHANNEL_PLAYER_TALK) { - string sFunc = "SetChatHearingDistance"; - - NWNX_PushArgumentInt(channel); - NWNX_PushArgumentObject(listener); - NWNX_PushArgumentFloat(distance); - NWNX_CallFunction(NWNX_Chat, sFunc); + NWNXPushInt(channel); + NWNXPushObject(listener); + NWNXPushFloat(distance); + NWNXCall(NWNX_Chat, "SetChatHearingDistance"); } float NWNX_Chat_GetChatHearingDistance(object listener = OBJECT_INVALID, int channel = NWNX_CHAT_CHANNEL_PLAYER_TALK) { - string sFunc = "GetChatHearingDistance"; - - NWNX_PushArgumentInt(channel); - NWNX_PushArgumentObject(listener); - NWNX_CallFunction(NWNX_Chat, sFunc); - return NWNX_GetReturnValueFloat(); + NWNXPushInt(channel); + NWNXPushObject(listener); + NWNXCall(NWNX_Chat, "GetChatHearingDistance"); + return NWNXPopFloat(); } diff --git a/_module/nss/nwnx_core.nss b/_module/nss/nwnx_core.nss new file mode 100644 index 00000000..74b02377 --- /dev/null +++ b/_module/nss/nwnx_core.nss @@ -0,0 +1,21 @@ +/// @addtogroup nwnx NWNX +/// @brief Core NWNX Functions. +/// @{ +/// @file nwnx_core.nss + +const string NWNX_Core = "NWNX_Core"; ///< @private + +/// @brief Determines if the given plugin exists and is enabled. +/// @param sPlugin The name of the plugin to check. This is the case sensitive plugin name as used by NWNXCall +/// @note Example usage: NWNX_PluginExists("NWNX_Creature"); +/// @return TRUE if the plugin exists and is enabled, otherwise FALSE. +int NWNX_Core_PluginExists(string sPlugin); + +/// @} + +int NWNX_Core_PluginExists(string sPlugin) +{ + NWNXPushString(sPlugin); + NWNXCall(NWNX_Core, "PluginExists"); + return NWNXPopInt(); +} diff --git a/_module/nss/nwnx_creature.nss b/_module/nss/nwnx_creature.nss index 275638f4..e921e191 100644 --- a/_module/nss/nwnx_creature.nss +++ b/_module/nss/nwnx_creature.nss @@ -2,7 +2,6 @@ /// @brief Functions exposing additional creature properties. /// @{ /// @file nwnx_creature.nss -#include "nwnx" const string NWNX_Creature = "NWNX_Creature"; ///< @private @@ -1007,660 +1006,511 @@ void NWNX_Creature_SetAbilityIncreaseByLevel(object oCreature, int nLevel, int n /// @return The maximum attack range for oCreature to oTarget float NWNX_Creature_GetMaxAttackRange(object oCreature, object oTarget); +/// @brief Returns the creature's multiclass limit. +/// @note Only works on player characters. +/// @param oCreature The creature object. Has to be a player character. +/// @return The PCs multiclass limit. Returns 0 if no limit is set. +int NWNX_Creature_GetMulticlassLimit(object oCreature); + +/// @brief Sets the creature's multiclass limit. +/// @note Only works on player characters and only for future level ups. +/// Classes already taken will continue to be available on level up. +/// The limit must be lower than the server limit set in ruleset.2da MULTICLASS_LIMIT. +/// Setting a value of 0 will remove the limit. +/// @param oCreature The creature object. Has to be a player character. +/// @param nLimit The multiclass limit. +/// @param bPersist Whether the limit should persist to the .bic file. +/// @note Persistence is enabled after a server reset by the first use of this function. +void NWNX_Creature_SetMulticlassLimit(object oCreature, int nLimit, int bPersist = FALSE); + /// @} void NWNX_Creature_AddFeat(object creature, int feat) { - string sFunc = "AddFeat"; - NWNX_PushArgumentInt(feat); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(feat); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "AddFeat"); } void NWNX_Creature_AddFeatByLevel(object creature, int feat, int level) { - string sFunc = "AddFeatByLevel"; - - NWNX_PushArgumentInt(level); - NWNX_PushArgumentInt(feat); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(level); + NWNXPushInt(feat); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "AddFeatByLevel"); } void NWNX_Creature_RemoveFeat(object creature, int feat) { - string sFunc = "RemoveFeat"; - NWNX_PushArgumentInt(feat); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(feat); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "RemoveFeat"); } void NWNX_Creature_RemoveFeatByLevel(object creature, int feat, int level) { - string sFunc = "RemoveFeatByLevel"; - - NWNX_PushArgumentInt(level); - NWNX_PushArgumentInt(feat); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(level); + NWNXPushInt(feat); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "RemoveFeatByLevel"); } int NWNX_Creature_GetKnowsFeat(object creature, int feat) { - string sFunc = "GetKnowsFeat"; - - NWNX_PushArgumentInt(feat); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushInt(feat); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "GetKnowsFeat"); + return NWNXPopInt(); } int NWNX_Creature_GetFeatCountByLevel(object creature, int level) { - string sFunc = "GetFeatCountByLevel"; - - NWNX_PushArgumentInt(level); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushInt(level); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "GetFeatCountByLevel"); + return NWNXPopInt(); } int NWNX_Creature_GetFeatByLevel(object creature, int level, int index) { - string sFunc = "GetFeatByLevel"; - - NWNX_PushArgumentInt(index); - NWNX_PushArgumentInt(level); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushInt(index); + NWNXPushInt(level); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "GetFeatByLevel"); + return NWNXPopInt(); } int NWNX_Creature_GetFeatCount(object creature) { - string sFunc = "GetFeatCount"; - - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "GetFeatCount"); + return NWNXPopInt(); } int NWNX_Creature_GetFeatGrantLevel(object creature, int feat) { - string sFunc = "GetFeatGrantLevel"; - - NWNX_PushArgumentInt(feat); - NWNX_PushArgumentObject(creature); - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushInt(feat); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "GetFeatGrantLevel"); + return NWNXPopInt(); } int NWNX_Creature_GetFeatByIndex(object creature, int index) { - string sFunc = "GetFeatByIndex"; - - NWNX_PushArgumentInt(index); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushInt(index); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "GetFeatByIndex"); + return NWNXPopInt(); } int NWNX_Creature_GetMeetsFeatRequirements(object creature, int feat) { - string sFunc = "GetMeetsFeatRequirements"; - - NWNX_PushArgumentInt(feat); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushInt(feat); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "GetMeetsFeatRequirements"); + return NWNXPopInt(); } struct NWNX_Creature_SpecialAbility NWNX_Creature_GetSpecialAbility(object creature, int index) { - string sFunc = "GetSpecialAbility"; - struct NWNX_Creature_SpecialAbility ability; - - NWNX_PushArgumentInt(index); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); - - ability.level = NWNX_GetReturnValueInt(); - ability.ready = NWNX_GetReturnValueInt(); - ability.id = NWNX_GetReturnValueInt(); - + NWNXPushInt(index); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "GetSpecialAbility"); + ability.level = NWNXPopInt(); + ability.ready = NWNXPopInt(); + ability.id = NWNXPopInt(); return ability; } int NWNX_Creature_GetSpecialAbilityCount(object creature) { - string sFunc = "GetSpecialAbilityCount"; - - NWNX_PushArgumentObject(creature); - NWNX_CallFunction(NWNX_Creature, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "GetSpecialAbilityCount"); + return NWNXPopInt(); } void NWNX_Creature_AddSpecialAbility(object creature, struct NWNX_Creature_SpecialAbility ability) { - string sFunc = "AddSpecialAbility"; - - NWNX_PushArgumentInt(ability.id); - NWNX_PushArgumentInt(ability.ready); - NWNX_PushArgumentInt(ability.level); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(ability.id); + NWNXPushInt(ability.ready); + NWNXPushInt(ability.level); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "AddSpecialAbility"); } void NWNX_Creature_RemoveSpecialAbility(object creature, int index) { - string sFunc = "RemoveSpecialAbility"; - - NWNX_PushArgumentInt(index); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(index); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "RemoveSpecialAbility"); } void NWNX_Creature_SetSpecialAbility(object creature, int index, struct NWNX_Creature_SpecialAbility ability) { - string sFunc = "SetSpecialAbility"; - - NWNX_PushArgumentInt(ability.id); - NWNX_PushArgumentInt(ability.ready); - NWNX_PushArgumentInt(ability.level); - NWNX_PushArgumentInt(index); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(ability.id); + NWNXPushInt(ability.ready); + NWNXPushInt(ability.level); + NWNXPushInt(index); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "SetSpecialAbility"); } int NWNX_Creature_GetClassByLevel(object creature, int level) { - string sFunc = "GetClassByLevel"; - - NWNX_PushArgumentInt(level); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushInt(level); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "GetClassByLevel"); + return NWNXPopInt(); } void NWNX_Creature_SetBaseAC(object creature, int ac) { - string sFunc = "SetBaseAC"; - - NWNX_PushArgumentInt(ac); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(ac); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "SetBaseAC"); } int NWNX_Creature_GetBaseAC(object creature) { - string sFunc = "GetBaseAC"; - - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "GetBaseAC"); + return NWNXPopInt(); } void NWNX_Creature_SetRawAbilityScore(object creature, int ability, int value) { - string sFunc = "SetRawAbilityScore"; - - NWNX_PushArgumentInt(value); - NWNX_PushArgumentInt(ability); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(value); + NWNXPushInt(ability); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "SetRawAbilityScore"); } int NWNX_Creature_GetRawAbilityScore(object creature, int ability) { - string sFunc = "GetRawAbilityScore"; - - NWNX_PushArgumentInt(ability); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushInt(ability); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "GetRawAbilityScore"); + return NWNXPopInt(); } void NWNX_Creature_ModifyRawAbilityScore(object creature, int ability, int modifier) { - string sFunc = "ModifyRawAbilityScore"; - - NWNX_PushArgumentInt(modifier); - NWNX_PushArgumentInt(ability); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(modifier); + NWNXPushInt(ability); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "ModifyRawAbilityScore"); } int NWNX_Creature_GetPrePolymorphAbilityScore(object creature, int ability) { - string sFunc = "GetPrePolymorphAbilityScore"; - - NWNX_PushArgumentInt(ability); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushInt(ability); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "GetPrePolymorphAbilityScore"); + return NWNXPopInt(); } int NWNX_Creature_GetRemainingSpellSlots(object creature, int class, int level) { - string sFunc = "GetRemainingSpellSlots"; - - NWNX_PushArgumentInt(level); - NWNX_PushArgumentInt(class); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushInt(level); + NWNXPushInt(class); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "GetRemainingSpellSlots"); + return NWNXPopInt(); } void NWNX_Creature_SetRemainingSpellSlots(object creature, int class, int level, int slots) { - string sFunc = "SetRemainingSpellSlots"; - - NWNX_PushArgumentInt(slots); - NWNX_PushArgumentInt(level); - NWNX_PushArgumentInt(class); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(slots); + NWNXPushInt(level); + NWNXPushInt(class); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "SetRemainingSpellSlots"); } void NWNX_Creature_RemoveKnownSpell(object creature, int class, int level, int spellId) { - string sFunc = "RemoveKnownSpell"; + NWNXPushInt(spellId); + NWNXPushInt(level); + NWNXPushInt(class); + NWNXPushObject(creature); - NWNX_PushArgumentInt(spellId); - NWNX_PushArgumentInt(level); - NWNX_PushArgumentInt(class); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXCall(NWNX_Creature, "RemoveKnownSpell"); } void NWNX_Creature_AddKnownSpell(object creature, int class, int level, int spellId) { - string sFunc = "AddKnownSpell"; - - NWNX_PushArgumentInt(spellId); - NWNX_PushArgumentInt(level); - NWNX_PushArgumentInt(class); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(spellId); + NWNXPushInt(level); + NWNXPushInt(class); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "AddKnownSpell"); } int NWNX_Creature_GetMaxSpellSlots(object creature, int class, int level) { - string sFunc = "GetMaxSpellSlots"; - - NWNX_PushArgumentInt(level); - NWNX_PushArgumentInt(class); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushInt(level); + NWNXPushInt(class); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "GetMaxSpellSlots"); + return NWNXPopInt(); } int NWNX_Creature_GetMaxHitPointsByLevel(object creature, int level) { - string sFunc = "GetMaxHitPointsByLevel"; - - NWNX_PushArgumentInt(level); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushInt(level); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "GetMaxHitPointsByLevel"); + return NWNXPopInt(); } void NWNX_Creature_SetMaxHitPointsByLevel(object creature, int level, int value) { - string sFunc = "SetMaxHitPointsByLevel"; - - NWNX_PushArgumentInt(value); - NWNX_PushArgumentInt(level); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(value); + NWNXPushInt(level); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "SetMaxHitPointsByLevel"); } void NWNX_Creature_SetMovementRate(object creature, int rate) { - string sFunc = "SetMovementRate"; - - NWNX_PushArgumentInt(rate); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(rate); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "SetMovementRate"); } float NWNX_Creature_GetMovementRateFactor(object creature) { - string sFunc = "GetMovementRateFactor"; - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueFloat(); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "GetMovementRateFactor"); + return NWNXPopFloat(); } void NWNX_Creature_SetMovementRateFactor(object creature, float factor) { - string sFunc = "SetMovementRateFactor"; - - NWNX_PushArgumentFloat(factor); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushFloat(factor); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "SetMovementRateFactor"); } float NWNX_Creature_GetMovementRateFactorCap(object creature) { - string sFunc = "GetMovementRateFactorCap"; - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueFloat(); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "GetMovementRateFactorCap"); + return NWNXPopFloat(); } void NWNX_Creature_SetMovementRateFactorCap(object creature, float cap) { - string sFunc = "SetMovementRateFactorCap"; - - NWNX_PushArgumentFloat(cap); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushFloat(cap); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "SetMovementRateFactorCap"); } void NWNX_Creature_SetAlignmentGoodEvil(object creature, int value) { - string sFunc = "SetAlignmentGoodEvil"; - - NWNX_PushArgumentInt(value); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(value); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "SetAlignmentGoodEvil"); } void NWNX_Creature_SetAlignmentLawChaos(object creature, int value) { - string sFunc = "SetAlignmentLawChaos"; - - NWNX_PushArgumentInt(value); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(value); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "SetAlignmentLawChaos"); } void NWNX_Creature_SetSkillRank(object creature, int skill, int rank) { - string sFunc = "SetSkillRank"; - NWNX_PushArgumentInt(rank); - NWNX_PushArgumentInt(skill); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(rank); + NWNXPushInt(skill); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "SetSkillRank"); } int NWNX_Creature_GetSkillRankByLevel(object creature, int skill, int level) { - string sFunc = "GetSkillRankByLevel"; - - NWNX_PushArgumentInt(level); - NWNX_PushArgumentInt(skill); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushInt(level); + NWNXPushInt(skill); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "GetSkillRankByLevel"); + return NWNXPopInt(); } void NWNX_Creature_SetSkillRankByLevel(object creature, int skill, int rank, int level) { - string sFunc = "SetSkillRankByLevel"; - - NWNX_PushArgumentInt(level); - NWNX_PushArgumentInt(rank); - NWNX_PushArgumentInt(skill); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(level); + NWNXPushInt(rank); + NWNXPushInt(skill); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "SetSkillRankByLevel"); } void NWNX_Creature_SetClassByPosition(object creature, int position, int classID, int bUpdateLevels = TRUE) { - string sFunc = "SetClassByPosition"; - NWNX_PushArgumentInt(bUpdateLevels); - NWNX_PushArgumentInt(classID); - NWNX_PushArgumentInt(position); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(bUpdateLevels); + NWNXPushInt(classID); + NWNXPushInt(position); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "SetClassByPosition"); } void NWNX_Creature_SetLevelByPosition(object creature, int position, int level) { - string sFunc = "SetLevelByPosition"; - NWNX_PushArgumentInt(level); - NWNX_PushArgumentInt(position); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(level); + NWNXPushInt(position); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "SetLevelByPosition"); } void NWNX_Creature_SetBaseAttackBonus(object creature, int bab) { - string sFunc = "SetBaseAttackBonus"; - NWNX_PushArgumentInt(bab); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(bab); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "SetBaseAttackBonus"); } int NWNX_Creature_GetAttacksPerRound(object creature, int bBaseAPR = FALSE) { - string sFunc = "GetAttacksPerRound"; - NWNX_PushArgumentInt(bBaseAPR); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushInt(bBaseAPR); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "GetAttacksPerRound"); + return NWNXPopInt(); } void NWNX_Creature_RestoreFeats(object creature) { - string sFunc = "RestoreFeats"; - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "RestoreFeats"); } void NWNX_Creature_RestoreSpecialAbilities(object creature) { - string sFunc = "RestoreSpecialAbilities"; - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "RestoreSpecialAbilities"); } void NWNX_Creature_RestoreItems(object creature) { - string sFunc = "RestoreItems"; - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "RestoreItems"); } void NWNX_Creature_SetSize(object creature, int size) { - string sFunc = "SetSize"; - NWNX_PushArgumentInt(size); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(size); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "SetSize"); } int NWNX_Creature_GetSkillPointsRemaining(object creature) { - string sFunc = "GetSkillPointsRemaining"; - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "GetSkillPointsRemaining"); + return NWNXPopInt(); } - void NWNX_Creature_SetSkillPointsRemaining(object creature, int skillpoints) { - string sFunc = "SetSkillPointsRemaining"; - NWNX_PushArgumentInt(skillpoints); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(skillpoints); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "SetSkillPointsRemaining"); } int NWNX_Creature_GetSkillPointsRemainingByLevel(object creature, int level) { - string sFunc = "GetSkillPointsRemainingByLevel"; - - NWNX_PushArgumentInt(level); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushInt(level); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "GetSkillPointsRemainingByLevel"); + return NWNXPopInt(); } void NWNX_Creature_SetSkillPointsRemainingByLevel(object creature, int level, int value) { - string sFunc = "SetSkillPointsRemainingByLevel"; - - NWNX_PushArgumentInt(value); - NWNX_PushArgumentInt(level); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(value); + NWNXPushInt(level); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "SetSkillPointsRemainingByLevel"); } void NWNX_Creature_SetRacialType(object creature, int racialtype) { - string sFunc = "SetRacialType"; - NWNX_PushArgumentInt(racialtype); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(racialtype); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "SetRacialType"); } int NWNX_Creature_GetMovementType(object creature) { - string sFunc = "GetMovementType"; - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "GetMovementType"); + return NWNXPopInt(); } void NWNX_Creature_SetWalkRateCap(object creature, float fWalkRate = 2000.0f) { - string sFunc = "SetWalkRateCap"; - NWNX_PushArgumentFloat(fWalkRate); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushFloat(fWalkRate); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "SetWalkRateCap"); } void NWNX_Creature_SetGold(object creature, int gold) { - string sFunc = "SetGold"; - NWNX_PushArgumentInt(gold); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(gold); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "SetGold"); } void NWNX_Creature_SetCorpseDecayTime(object creature, int nDecayTime) { - string sFunc = "SetCorpseDecayTime"; - NWNX_PushArgumentInt(nDecayTime); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(nDecayTime); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "SetCorpseDecayTime"); } - int NWNX_Creature_GetBaseSavingThrow(object creature, int which) { - string sFunc = "GetBaseSavingThrow"; - NWNX_PushArgumentInt(which); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushInt(which); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "GetBaseSavingThrow"); + return NWNXPopInt(); } void NWNX_Creature_SetBaseSavingThrow(object creature, int which, int value) { - string sFunc = "SetBaseSavingThrow"; - NWNX_PushArgumentInt(value); - NWNX_PushArgumentInt(which); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(value); + NWNXPushInt(which); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "SetBaseSavingThrow"); } void NWNX_Creature_LevelUp(object creature, int class, int count = 1, int package = PACKAGE_INVALID) { - string sFunc = "LevelUp"; - NWNX_PushArgumentInt(package); - NWNX_PushArgumentInt(count); - NWNX_PushArgumentInt(class); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(package); + NWNXPushInt(count); + NWNXPushInt(class); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "LevelUp"); } void NWNX_Creature_LevelDown(object creature, int count=1) { - string sFunc = "LevelDown"; - NWNX_PushArgumentInt(count); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(count); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "LevelDown"); } void NWNX_Creature_SetChallengeRating(object creature, float fCR) { - string sFunc = "SetChallengeRating"; - NWNX_PushArgumentFloat(fCR); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushFloat(fCR); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "SetChallengeRating"); } int NWNX_Creature_GetAttackBonus(object creature, int isMelee = -1, int isTouchAttack = FALSE, int isOffhand = FALSE, int includeBaseAttackBonus = TRUE) { - string sFunc = "GetAttackBonus"; - if (isMelee == -1) { object oWeapon = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, creature); @@ -1674,940 +1524,727 @@ int NWNX_Creature_GetAttackBonus(object creature, int isMelee = -1, int isTouchA isMelee = TRUE; } } - - NWNX_PushArgumentInt(includeBaseAttackBonus); - NWNX_PushArgumentInt(isOffhand); - NWNX_PushArgumentInt(isTouchAttack); - NWNX_PushArgumentInt(isMelee); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushInt(includeBaseAttackBonus); + NWNXPushInt(isOffhand); + NWNXPushInt(isTouchAttack); + NWNXPushInt(isMelee); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "GetAttackBonus"); + return NWNXPopInt(); } int NWNX_Creature_GetHighestLevelOfFeat(object creature, int feat) { - string sFunc = "GetHighestLevelOfFeat"; - - NWNX_PushArgumentInt(feat); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushInt(feat); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "GetHighestLevelOfFeat"); + return NWNXPopInt(); } int NWNX_Creature_GetFeatRemainingUses(object creature, int feat) { - string sFunc = "GetFeatRemainingUses"; - - NWNX_PushArgumentInt(feat); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushInt(feat); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "GetFeatRemainingUses"); + return NWNXPopInt(); } int NWNX_Creature_GetFeatTotalUses(object creature, int feat) { - string sFunc = "GetFeatTotalUses"; - - NWNX_PushArgumentInt(feat); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushInt(feat); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "GetFeatTotalUses"); + return NWNXPopInt(); } void NWNX_Creature_SetFeatRemainingUses(object creature, int feat, int uses) { - string sFunc = "SetFeatRemainingUses"; - - NWNX_PushArgumentInt(uses); - NWNX_PushArgumentInt(feat); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(uses); + NWNXPushInt(feat); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "SetFeatRemainingUses"); } int NWNX_Creature_GetTotalEffectBonus(object creature, int bonusType=NWNX_CREATURE_BONUS_TYPE_ATTACK, object target=OBJECT_INVALID, int isElemental=0, int isForceMax=0, int savetype=-1, int saveSpecificType=-1, int skill=-1, int abilityScore=-1, int isOffhand=FALSE) { - string sFunc = "GetTotalEffectBonus"; - - NWNX_PushArgumentInt(isOffhand); - NWNX_PushArgumentInt(abilityScore); - NWNX_PushArgumentInt(skill); - NWNX_PushArgumentInt(saveSpecificType); - NWNX_PushArgumentInt(savetype); - NWNX_PushArgumentInt(isForceMax); - NWNX_PushArgumentInt(isElemental); - NWNX_PushArgumentObject(target); - NWNX_PushArgumentInt(bonusType); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushInt(isOffhand); + NWNXPushInt(abilityScore); + NWNXPushInt(skill); + NWNXPushInt(saveSpecificType); + NWNXPushInt(savetype); + NWNXPushInt(isForceMax); + NWNXPushInt(isElemental); + NWNXPushObject(target); + NWNXPushInt(bonusType); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "GetTotalEffectBonus"); + return NWNXPopInt(); } void NWNX_Creature_SetOriginalName(object creature, string name, int isLastName) { - string sFunc = "SetOriginalName"; - - NWNX_PushArgumentInt(isLastName); - NWNX_PushArgumentString(name); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(isLastName); + NWNXPushString(name); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "SetOriginalName"); } string NWNX_Creature_GetOriginalName(object creature, int isLastName) { - string sFunc = "GetOriginalName"; - - NWNX_PushArgumentInt(isLastName); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueString(); + NWNXPushInt(isLastName); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "GetOriginalName"); + return NWNXPopString(); } void NWNX_Creature_SetSpellResistance(object creature, int sr) { - string sFunc = "SetSpellResistance"; - - NWNX_PushArgumentInt(sr); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(sr); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "SetSpellResistance"); } void NWNX_Creature_SetAnimalCompanionCreatureType(object creature, int type) { - string sFunc = "SetAnimalCompanionCreatureType"; - - NWNX_PushArgumentInt(type); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(type); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "SetAnimalCompanionCreatureType"); } void NWNX_Creature_SetFamiliarCreatureType(object creature, int type) { - string sFunc = "SetFamiliarCreatureType"; - - NWNX_PushArgumentInt(type); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(type); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "SetFamiliarCreatureType"); } void NWNX_Creature_SetAnimalCompanionName(object creature, string name) { - string sFunc = "SetAnimalCompanionName"; - - NWNX_PushArgumentString(name); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushString(name); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "SetAnimalCompanionName"); } void NWNX_Creature_SetFamiliarName(object creature, string name) { - string sFunc = "SetFamiliarName"; - - NWNX_PushArgumentString(name); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushString(name); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "SetFamiliarName"); } int NWNX_Creature_GetDisarmable(object creature) { - string sFunc = "GetDisarmable"; - - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "GetDisarmable"); + return NWNXPopInt(); } void NWNX_Creature_SetDisarmable(object creature, int disarmable) { - string sFunc = "SetDisarmable"; - - NWNX_PushArgumentInt(disarmable); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(disarmable); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "SetDisarmable"); } void NWNX_Creature_SetDomain(object creature, int class, int index, int domain) { - string sFunc = "SetDomain"; - - NWNX_PushArgumentInt(domain); - NWNX_PushArgumentInt(index); - NWNX_PushArgumentInt(class); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(domain); + NWNXPushInt(index); + NWNXPushInt(class); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "SetDomain"); } void NWNX_Creature_SetSpecialization(object creature, int class, int school) { - string sFunc = "SetSpecialization"; - - NWNX_PushArgumentInt(school); - NWNX_PushArgumentInt(class); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(school); + NWNXPushInt(class); + NWNXPushObject(creature); + NWNXCall(NWNX_Creature, "SetSpecialization"); } void NWNX_Creature_SetFaction(object oCreature, int nFactionId) { - string sFunc = "SetFaction"; - NWNX_PushArgumentInt(nFactionId); - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(nFactionId); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "SetFaction"); } int NWNX_Creature_GetFaction(object oCreature) { - string sFunc = "GetFaction"; - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "GetFaction"); + return NWNXPopInt(); } int NWNX_Creature_GetFlatFooted(object oCreature) { - string sFunc = "GetFlatFooted"; - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "GetFlatFooted"); + return NWNXPopInt(); } string NWNX_Creature_SerializeQuickbar(object oCreature) { - string sFunc = "SerializeQuickbar"; - - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); - - return NWNX_GetReturnValueString(); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "SerializeQuickbar"); + return NWNXPopString(); } int NWNX_Creature_DeserializeQuickbar(object oCreature, string sSerializedQuickbar) { - string sFunc = "DeserializeQuickbar"; - - NWNX_PushArgumentString(sSerializedQuickbar); - NWNX_PushArgumentObject(oCreature); - - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushString(sSerializedQuickbar); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "DeserializeQuickbar"); + return NWNXPopInt(); } void NWNX_Creature_SetCasterLevelModifier(object oCreature, int nClass, int nModifier, int bPersist = FALSE) { - string sFunc = "SetCasterLevelModifier"; - - NWNX_PushArgumentInt(bPersist); - NWNX_PushArgumentInt(nModifier); - NWNX_PushArgumentInt(nClass); - NWNX_PushArgumentObject(oCreature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(bPersist); + NWNXPushInt(nModifier); + NWNXPushInt(nClass); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "SetCasterLevelModifier"); } int NWNX_Creature_GetCasterLevelModifier(object oCreature, int nClass) { - string sFunc = "GetCasterLevelModifier"; - - NWNX_PushArgumentInt(nClass); - NWNX_PushArgumentObject(oCreature); - - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushInt(nClass); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "GetCasterLevelModifier"); + return NWNXPopInt(); } void NWNX_Creature_SetCasterLevelOverride(object oCreature, int nClass, int nCasterLevel, int bPersist = FALSE) { - string sFunc = "SetCasterLevelOverride"; - - NWNX_PushArgumentInt(bPersist); - NWNX_PushArgumentInt(nCasterLevel); - NWNX_PushArgumentInt(nClass); - NWNX_PushArgumentObject(oCreature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(bPersist); + NWNXPushInt(nCasterLevel); + NWNXPushInt(nClass); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "SetCasterLevelOverride"); } int NWNX_Creature_GetCasterLevelOverride(object oCreature, int nClass) { - string sFunc = "GetCasterLevelOverride"; - - NWNX_PushArgumentInt(nClass); - NWNX_PushArgumentObject(oCreature); - - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushInt(nClass); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "GetCasterLevelOverride"); + return NWNXPopInt(); } void NWNX_Creature_JumpToLimbo(object oCreature) { - string sFunc = "JumpToLimbo"; - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "JumpToLimbo"); } void NWNX_Creature_SetCriticalMultiplierModifier(object oCreature, int nModifier, int nHand = 0, int bPersist = FALSE, int nBaseItem = -1) { - string sFunc = "SetCriticalMultiplierModifier"; - - NWNX_PushArgumentInt(nBaseItem); - NWNX_PushArgumentInt(bPersist); - NWNX_PushArgumentInt(nHand); - NWNX_PushArgumentInt(nModifier); - NWNX_PushArgumentObject(oCreature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(nBaseItem); + NWNXPushInt(bPersist); + NWNXPushInt(nHand); + NWNXPushInt(nModifier); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "SetCriticalMultiplierModifier"); } int NWNX_Creature_GetCriticalMultiplierModifier(object oCreature, int nHand = 0, int nBaseItem = -1) { - string sFunc = "GetCriticalMultiplierModifier"; - - NWNX_PushArgumentInt(nBaseItem); - NWNX_PushArgumentInt(nHand); - NWNX_PushArgumentObject(oCreature); - - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushInt(nBaseItem); + NWNXPushInt(nHand); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "GetCriticalMultiplierModifier"); + return NWNXPopInt(); } void NWNX_Creature_SetCriticalMultiplierOverride(object oCreature, int nOverride, int nHand = 0, int bPersist = FALSE, int nBaseItem = -1) { - string sFunc = "SetCriticalMultiplierOverride"; - - NWNX_PushArgumentInt(nBaseItem); - NWNX_PushArgumentInt(bPersist); - NWNX_PushArgumentInt(nHand); - NWNX_PushArgumentInt(nOverride); - NWNX_PushArgumentObject(oCreature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(nBaseItem); + NWNXPushInt(bPersist); + NWNXPushInt(nHand); + NWNXPushInt(nOverride); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "SetCriticalMultiplierOverride"); } int NWNX_Creature_GetCriticalMultiplierOverride(object oCreature, int nHand = 0, int nBaseItem = -1) { - string sFunc = "GetCriticalMultiplierOverride"; - - NWNX_PushArgumentInt(nBaseItem); - NWNX_PushArgumentInt(nHand); - NWNX_PushArgumentObject(oCreature); - - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushInt(nBaseItem); + NWNXPushInt(nHand); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "GetCriticalMultiplierOverride"); + return NWNXPopInt(); } void NWNX_Creature_SetCriticalRangeModifier(object oCreature, int nModifier, int nHand = 0, int bPersist = FALSE, int nBaseItem = -1) { - string sFunc = "SetCriticalRangeModifier"; - - NWNX_PushArgumentInt(nBaseItem); - NWNX_PushArgumentInt(bPersist); - NWNX_PushArgumentInt(nHand); - NWNX_PushArgumentInt(nModifier); - NWNX_PushArgumentObject(oCreature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(nBaseItem); + NWNXPushInt(bPersist); + NWNXPushInt(nHand); + NWNXPushInt(nModifier); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "SetCriticalRangeModifier"); } int NWNX_Creature_GetCriticalRangeModifier(object oCreature, int nHand = 0, int nBaseItem = -1) { - string sFunc = "GetCriticalRangeModifier"; + NWNXPushInt(nBaseItem); + NWNXPushInt(nHand); + NWNXPushObject(oCreature); - NWNX_PushArgumentInt(nBaseItem); - NWNX_PushArgumentInt(nHand); - NWNX_PushArgumentObject(oCreature); - - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueInt(); + NWNXCall(NWNX_Creature, "GetCriticalRangeModifier"); + return NWNXPopInt(); } void NWNX_Creature_SetCriticalRangeOverride(object oCreature, int nOverride, int nHand = 0, int bPersist = FALSE, int nBaseItem = -1) { - string sFunc = "SetCriticalRangeOverride"; - - NWNX_PushArgumentInt(nBaseItem); - NWNX_PushArgumentInt(bPersist); - NWNX_PushArgumentInt(nHand); - NWNX_PushArgumentInt(nOverride); - NWNX_PushArgumentObject(oCreature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(nBaseItem); + NWNXPushInt(bPersist); + NWNXPushInt(nHand); + NWNXPushInt(nOverride); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "SetCriticalRangeOverride"); } int NWNX_Creature_GetCriticalRangeOverride(object oCreature, int nHand = 0, int nBaseItem = -1) { - string sFunc = "GetCriticalRangeOverride"; + NWNXPushInt(nBaseItem); + NWNXPushInt(nHand); + NWNXPushObject(oCreature); - NWNX_PushArgumentInt(nBaseItem); - NWNX_PushArgumentInt(nHand); - NWNX_PushArgumentObject(oCreature); - - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueInt(); + NWNXCall(NWNX_Creature, "GetCriticalRangeOverride"); + return NWNXPopInt(); } void NWNX_Creature_AddAssociate(object oCreature, object oAssociate, int nAssociateType) { - string sFunc = "AddAssociate"; + NWNXPushInt(nAssociateType); + NWNXPushObject(oAssociate); + NWNXPushObject(oCreature); - NWNX_PushArgumentInt(nAssociateType); - NWNX_PushArgumentObject(oAssociate); - NWNX_PushArgumentObject(oCreature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXCall(NWNX_Creature, "AddAssociate"); } void NWNX_Creature_OverrideDamageLevel(object oCreature, int nDamageLevel) { - string sFunc = "OverrideDamageLevel"; - - NWNX_PushArgumentInt(nDamageLevel); - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(nDamageLevel); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "OverrideDamageLevel"); } void NWNX_Creature_SetEncounter(object oCreature, object oEncounter) { - string sFunc = "SetEncounter"; - - NWNX_PushArgumentObject(oEncounter); - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushObject(oEncounter); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "SetEncounter"); } object NWNX_Creature_GetEncounter(object oCreature) { - string sFunc = "GetEncounter"; - - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); - - return NWNX_GetReturnValueObject(); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "GetEncounter"); + return NWNXPopObject(); } int NWNX_Creature_GetIsBartering(object oCreature) { - string sFunc = "GetIsBartering"; - - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "GetIsBartering"); + return NWNXPopInt(); } void NWNX_Creature_SetLastItemCasterLevel(object oCreature, int nCasterLvl) { - string sFunc = "SetLastItemCasterLevel"; - NWNX_PushArgumentInt(nCasterLvl); - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(nCasterLvl); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "SetLastItemCasterLevel"); } int NWNX_Creature_GetLastItemCasterLevel(object oCreature) { - string sFunc = "GetLastItemCasterLevel"; - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "GetLastItemCasterLevel"); + return NWNXPopInt(); } int NWNX_Creature_GetArmorClassVersus(object oAttacked, object oVersus, int nTouch=FALSE) { - string sFunc = "GetArmorClassVersus"; - NWNX_PushArgumentInt(nTouch); - NWNX_PushArgumentObject(oVersus); - NWNX_PushArgumentObject(oAttacked); - NWNX_CallFunction(NWNX_Creature, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushInt(nTouch); + NWNXPushObject(oVersus); + NWNXPushObject(oAttacked); + NWNXCall(NWNX_Creature, "GetArmorClassVersus"); + return NWNXPopInt(); } int NWNX_Creature_GetWalkAnimation(object oCreature) { - string sFunc = "GetWalkAnimation"; - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "GetWalkAnimation"); + return NWNXPopInt(); } void NWNX_Creature_SetWalkAnimation(object oCreature, int nAnimation) { - string sFunc = "SetWalkAnimation"; - NWNX_PushArgumentInt(nAnimation); - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(nAnimation); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "SetWalkAnimation"); } void NWNX_Creature_SetAttackRollOverride(object oCreature, int nRoll, int nModifier) { - string sFunc = "SetAttackRollOverride"; - NWNX_PushArgumentInt(nModifier); - NWNX_PushArgumentInt(nRoll); - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(nModifier); + NWNXPushInt(nRoll); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "SetAttackRollOverride"); } void NWNX_Creature_SetParryAllAttacks(object oCreature, int bParry) { - string sFunc = "SetParryAllAttacks"; - NWNX_PushArgumentInt(bParry); - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(bParry); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "SetParryAllAttacks"); } int NWNX_Creature_GetNoPermanentDeath(object oCreature) { - string sFunc = "GetNoPermanentDeath"; - - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "GetNoPermanentDeath"); + return NWNXPopInt(); } void NWNX_Creature_SetNoPermanentDeath(object oCreature, int bNoPermanentDeath) { - string sFunc = "SetNoPermanentDeath"; - - NWNX_PushArgumentInt(bNoPermanentDeath); - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(bNoPermanentDeath); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "SetNoPermanentDeath"); } vector NWNX_Creature_ComputeSafeLocation(object oCreature, vector vPosition, float fRadius = 20.0f, int bWalkStraightLineRequired = TRUE) { - string sFunc = "ComputeSafeLocation"; - - NWNX_PushArgumentInt(bWalkStraightLineRequired); - NWNX_PushArgumentFloat(fRadius); - NWNX_PushArgumentFloat(vPosition.x); - NWNX_PushArgumentFloat(vPosition.y); - NWNX_PushArgumentFloat(vPosition.z); - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); - - vector v; - v.z = NWNX_GetReturnValueFloat(); - v.y = NWNX_GetReturnValueFloat(); - v.x = NWNX_GetReturnValueFloat(); - - return v; + NWNXPushInt(bWalkStraightLineRequired); + NWNXPushFloat(fRadius); + NWNXPushVector(vPosition); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "ComputeSafeLocation"); + return NWNXPopVector(); } void NWNX_Creature_DoPerceptionUpdateOnCreature(object oCreature, object oTargetCreature) { - string sFunc = "DoPerceptionUpdateOnCreature"; - - NWNX_PushArgumentObject(oTargetCreature); - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushObject(oTargetCreature); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "DoPerceptionUpdateOnCreature"); } float NWNX_Creature_GetPersonalSpace(object oCreature) { - string sFunc = "GetPersonalSpace"; - - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); - - return NWNX_GetReturnValueFloat(); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "GetPersonalSpace"); + return NWNXPopFloat(); } void NWNX_Creature_SetPersonalSpace(object oCreature, float fPerspace) { - string sFunc = "SetPersonalSpace"; - - NWNX_PushArgumentFloat(fPerspace); - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushFloat(fPerspace); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "SetPersonalSpace"); } float NWNX_Creature_GetCreaturePersonalSpace(object oCreature) { - string sFunc = "GetCreaturePersonalSpace"; - - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); - - return NWNX_GetReturnValueFloat(); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "GetCreaturePersonalSpace"); + return NWNXPopFloat(); } void NWNX_Creature_SetCreaturePersonalSpace(object oCreature, float fCrePerspace) { - string sFunc = "SetCreaturePersonalSpace"; - - NWNX_PushArgumentFloat(fCrePerspace); - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushFloat(fCrePerspace); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "SetCreaturePersonalSpace"); } float NWNX_Creature_GetHeight(object oCreature) { - string sFunc = "GetHeight"; - - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); - - return NWNX_GetReturnValueFloat(); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "GetHeight"); + return NWNXPopFloat(); } void NWNX_Creature_SetHeight(object oCreature, float fHeight) { - string sFunc = "SetHeight"; - - NWNX_PushArgumentFloat(fHeight); - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushFloat(fHeight); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "SetHeight"); } float NWNX_Creature_GetHitDistance(object oCreature) { - string sFunc = "GetHitDistance"; - - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); - - return NWNX_GetReturnValueFloat(); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "GetHitDistance"); + return NWNXPopFloat(); } void NWNX_Creature_SetHitDistance(object oCreature, float fHitDist) { - string sFunc = "SetHitDistance"; - - NWNX_PushArgumentFloat(fHitDist); - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushFloat(fHitDist); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "SetHitDistance"); } float NWNX_Creature_GetPreferredAttackDistance(object oCreature) { - string sFunc = "GetPreferredAttackDistance"; - - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); - - return NWNX_GetReturnValueFloat(); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "GetPreferredAttackDistance"); + return NWNXPopFloat(); } void NWNX_Creature_SetPreferredAttackDistance(object oCreature, float fPrefAtckDist) { - string sFunc = "SetPreferredAttackDistance"; - - NWNX_PushArgumentFloat(fPrefAtckDist); - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushFloat(fPrefAtckDist); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "SetPreferredAttackDistance"); } int NWNX_Creature_GetArmorCheckPenalty(object oCreature) { - string sFunc = "GetArmorCheckPenalty"; - - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "GetArmorCheckPenalty"); + return NWNXPopInt(); } int NWNX_Creature_GetShieldCheckPenalty(object oCreature) { - string sFunc = "GetShieldCheckPenalty"; - - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "GetShieldCheckPenalty"); + return NWNXPopInt(); } void NWNX_Creature_SetBypassEffectImmunity(object oCreature, int nImmunityType, int nChance = 100, int bPersist = FALSE) { - string sFunc = "SetBypassEffectImmunity"; - - NWNX_PushArgumentInt(bPersist); - NWNX_PushArgumentInt(nChance); - NWNX_PushArgumentInt(nImmunityType); - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(bPersist); + NWNXPushInt(nChance); + NWNXPushInt(nImmunityType); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "SetBypassEffectImmunity"); } int NWNX_Creature_GetBypassEffectImmunity(object oCreature, int nImmunityType) { - string sFunc = "GetBypassEffectImmunity"; - - NWNX_PushArgumentInt(nImmunityType); - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushInt(nImmunityType); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "GetBypassEffectImmunity"); + return NWNXPopInt(); } void NWNX_Creature_SetLastKiller(object oCreature, object oKiller) { - string sFunc = "SetLastKiller"; - - NWNX_PushArgumentObject(oKiller); - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushObject(oKiller); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "SetLastKiller"); } void NWNX_Creature_DoItemCastSpell(object oCreature, object oTarget, location locTarget, int nSpellID, int nCasterLevel, float fProjectileTime, int nProjectilePathType = PROJECTILE_PATH_TYPE_DEFAULT, int nProjectileSpellID = -1, object oItem = OBJECT_INVALID, string sImpactScript = "") { - string sFunc = "DoItemCastSpell"; - - object oArea = GetAreaFromLocation(locTarget); - vector vPosition = GetPositionFromLocation(locTarget); - - NWNX_PushArgumentString(sImpactScript); - NWNX_PushArgumentObject(oItem); - NWNX_PushArgumentInt(nProjectileSpellID); - NWNX_PushArgumentInt(nProjectilePathType); - NWNX_PushArgumentFloat(fProjectileTime); - NWNX_PushArgumentInt(nCasterLevel); - NWNX_PushArgumentInt(nSpellID); - NWNX_PushArgumentFloat(vPosition.z); - NWNX_PushArgumentFloat(vPosition.y); - NWNX_PushArgumentFloat(vPosition.x); - NWNX_PushArgumentObject(oArea); - NWNX_PushArgumentObject(oTarget); - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushString(sImpactScript); + NWNXPushObject(oItem); + NWNXPushInt(nProjectileSpellID); + NWNXPushInt(nProjectilePathType); + NWNXPushFloat(fProjectileTime); + NWNXPushInt(nCasterLevel); + NWNXPushInt(nSpellID); + NWNXPushLocation(locTarget); + NWNXPushObject(oTarget); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "DoItemCastSpell"); } int NWNX_Creature_RunEquip(object oCreature, object oItem, int nInventorySlot) { - string sFunc = "RunEquip"; - - NWNX_PushArgumentInt(nInventorySlot); - NWNX_PushArgumentObject(oItem); - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushInt(nInventorySlot); + NWNXPushObject(oItem); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "RunEquip"); + return NWNXPopInt(); } int NWNX_Creature_RunUnequip(object oCreature, object oItem) { - string sFunc = "RunUnequip"; - - NWNX_PushArgumentObject(oItem); - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(oItem); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "RunUnequip"); + return NWNXPopInt(); } void NWNX_Creature_OverrideRangedProjectileVFX(object oCreature, int nProjectileVFX, int bPersist = FALSE) { - string sFunc = "OverrideRangedProjectileVFX"; - - NWNX_PushArgumentInt(bPersist); - NWNX_PushArgumentInt(nProjectileVFX); - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(bPersist); + NWNXPushInt(nProjectileVFX); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "OverrideRangedProjectileVFX"); } void NWNX_Creature_SetInitiativeModifier(object oCreature, int nMod, int bPersist = FALSE) { - string sFunc = "SetInitiativeModifier"; - - NWNX_PushArgumentInt(bPersist); - NWNX_PushArgumentInt(nMod); - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(bPersist); + NWNXPushInt(nMod); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "SetInitiativeModifier"); } int NWNX_Creature_GetInitiativeModifier(object oCreature) { - string sFunc = "GetInitiativeModifier"; - - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "GetInitiativeModifier"); + return NWNXPopInt(); } object NWNX_Creature_GetBodyBag(object oCreature) { - string sFunc = "GetBodyBag"; - - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueObject(); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "GetBodyBag"); + return NWNXPopObject(); } int NWNX_Creature_AddCastSpellActions(object oCreature, object oTarget, vector vTargetLocation, int nSpellID, int nMultiClass, int nMetaMagic = METAMAGIC_NONE, int nDomainLevel = 0, int nProjectilePathType = PROJECTILE_PATH_TYPE_DEFAULT, int bInstant = FALSE, int bClearActions = FALSE, int bAddToFront = FALSE) { - string sFunc = "AddCastSpellActions"; - - NWNX_PushArgumentInt(bAddToFront); - NWNX_PushArgumentInt(bClearActions); - NWNX_PushArgumentInt(bInstant); - NWNX_PushArgumentInt(nProjectilePathType); - NWNX_PushArgumentInt(nDomainLevel); - NWNX_PushArgumentInt(nMetaMagic); - NWNX_PushArgumentInt(nMultiClass); - NWNX_PushArgumentInt(nSpellID); - NWNX_PushArgumentFloat(vTargetLocation.z); - NWNX_PushArgumentFloat(vTargetLocation.y); - NWNX_PushArgumentFloat(vTargetLocation.x); - NWNX_PushArgumentObject(oTarget); - NWNX_PushArgumentObject(oCreature); - - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushInt(bAddToFront); + NWNXPushInt(bClearActions); + NWNXPushInt(bInstant); + NWNXPushInt(nProjectilePathType); + NWNXPushInt(nDomainLevel); + NWNXPushInt(nMetaMagic); + NWNXPushInt(nMultiClass); + NWNXPushInt(nSpellID); + NWNXPushVector(vTargetLocation); + NWNXPushObject(oTarget); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "AddCastSpellActions"); + return NWNXPopInt(); } int NWNX_Creature_GetIsFlanking(object oCreature, object oTargetCreature) { - string sFunc = "GetIsFlanking"; - - NWNX_PushArgumentObject(oTargetCreature); - NWNX_PushArgumentObject(oCreature); - - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushObject(oTargetCreature); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "GetIsFlanking"); + return NWNXPopInt(); } void NWNX_Creature_DecrementRemainingSpellSlots(object oCreature, int nClass, int nSpellLevel) { - string sFunc = "DecrementRemainingSpellSlots"; - - NWNX_PushArgumentInt(nSpellLevel); - NWNX_PushArgumentInt(nClass); - NWNX_PushArgumentObject(oCreature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(nSpellLevel); + NWNXPushInt(nClass); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "DecrementRemainingSpellSlots"); } void NWNX_Creature_IncrementRemainingSpellSlots(object oCreature, int nClass, int nSpellLevel) { - string sFunc = "IncrementRemainingSpellSlots"; - - NWNX_PushArgumentInt(nSpellLevel); - NWNX_PushArgumentInt(nClass); - NWNX_PushArgumentObject(oCreature); - - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(nSpellLevel); + NWNXPushInt(nClass); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "IncrementRemainingSpellSlots"); } int NWNX_Creature_GetMaximumBonusAttacks(object oCreature) { - string sFunc = "GetMaximumBonusAttacks"; - - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "GetMaximumBonusAttacks"); + return NWNXPopInt(); } void NWNX_Creature_SetMaximumBonusAttacks(object oCreature, int nMaxBonusAttacks, int bPersist = FALSE) { - string sFunc = "SetMaximumBonusAttacks"; - - NWNX_PushArgumentInt(bPersist); - NWNX_PushArgumentInt(nMaxBonusAttacks); - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(bPersist); + NWNXPushInt(nMaxBonusAttacks); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "SetMaximumBonusAttacks"); } void NWNX_Creature_DoCleaveAttack(object oCreature) { - string sFunc = "DoCleaveAttack"; - - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "DoCleaveAttack"); } object NWNX_Creature_GetLockOrientationToObject(object oCreature) { - string sFunc = "GetLockOrientationToObject"; - - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); - - return NWNX_GetReturnValueObject(); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "GetLockOrientationToObject"); + return NWNXPopObject(); } void NWNX_Creature_SetLockOrientationToObject(object oCreature, object oTarget) { - string sFunc = "SetLockOrientationToObject"; - - NWNX_PushArgumentObject(oTarget); - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushObject(oTarget); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "SetLockOrientationToObject"); } void NWNX_Creature_BroadcastAttackOfOpportunity(object oCreature, object oSingleCreature = OBJECT_INVALID, int bMovement = FALSE) { - string sFunc = "BroadcastAttackOfOpportunity"; - - NWNX_PushArgumentInt(bMovement); - NWNX_PushArgumentObject(oSingleCreature); - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(bMovement); + NWNXPushObject(oSingleCreature); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "BroadcastAttackOfOpportunity"); } int NWNX_Creature_GetMaxSellToStorePriceOverride(object oCreature, object oStore) { - string sFunc = "GetMaxSellToStorePriceOverride"; + NWNXPushObject(oStore); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "GetMaxSellToStorePriceOverride"); - NWNX_PushArgumentObject(oStore); - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); - - return NWNX_GetReturnValueInt(); + return NWNXPopInt(); } void NWNX_Creature_SetMaxSellToStorePriceOverride(object oCreature, object oStore, int nMaxSellToPrice) { - string sFunc = "SetMaxSellToStorePriceOverride"; - - NWNX_PushArgumentInt(nMaxSellToPrice); - NWNX_PushArgumentObject(oStore); - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(nMaxSellToPrice); + NWNXPushObject(oStore); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "SetMaxSellToStorePriceOverride"); } int NWNX_Creature_GetAbilityIncreaseByLevel(object oCreature, int nLevel) { - string sFunc = "GetAbilityIncreaseByLevel"; - - NWNX_PushArgumentInt(nLevel); - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushInt(nLevel); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "GetAbilityIncreaseByLevel"); + return NWNXPopInt(); } void NWNX_Creature_SetAbilityIncreaseByLevel(object oCreature, int nLevel, int nAbility) { - string sFunc = "SetAbilityIncreaseByLevel"; - - NWNX_PushArgumentInt(nAbility); - NWNX_PushArgumentInt(nLevel); - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); + NWNXPushInt(nAbility); + NWNXPushInt(nLevel); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "SetAbilityIncreaseByLevel"); } float NWNX_Creature_GetMaxAttackRange(object oCreature, object oTarget) { - string sFunc = "GetMaxAttackRange"; - - NWNX_PushArgumentObject(oTarget); - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Creature, sFunc); - - return NWNX_GetReturnValueFloat(); + NWNXPushObject(oTarget); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "GetMaxAttackRange"); + return NWNXPopFloat(); +} + +int NWNX_Creature_GetMulticlassLimit(object oCreature) +{ + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "GetMulticlassLimit"); + return NWNXPopInt(); +} + + +void NWNX_Creature_SetMulticlassLimit(object oCreature, int nLimit, int bPersist = FALSE) +{ + NWNXPushInt(bPersist); + NWNXPushInt(nLimit); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Creature, "SetMulticlassLimit"); } diff --git a/_module/nss/nwnx_damage.nss b/_module/nss/nwnx_damage.nss index 352d810c..1f4d13ce 100644 --- a/_module/nss/nwnx_damage.nss +++ b/_module/nss/nwnx_damage.nss @@ -2,7 +2,6 @@ /// @brief Run a script before damage and attack events allowing for modification. Includes function to arbitrarily apply damage. /// @{ /// @file nwnx_damage.nss -#include "nwnx" const string NWNX_Damage = "NWNX_Damage"; ///< @private @@ -174,245 +173,223 @@ void NWNX_Damage_DealDamage(struct NWNX_Damage_DamageData data, object oTarget, void NWNX_Damage_SetDamageEventScript(string sScript, object oOwner=OBJECT_INVALID) { - string sFunc = "SetEventScript"; - - NWNX_PushArgumentObject(oOwner); - NWNX_PushArgumentString(sScript); - NWNX_PushArgumentString("DAMAGE"); - - NWNX_CallFunction(NWNX_Damage, sFunc); + NWNXPushObject(oOwner); + NWNXPushString(sScript); + NWNXPushString("DAMAGE"); + NWNXCall(NWNX_Damage, "SetEventScript"); } struct NWNX_Damage_DamageEventData NWNX_Damage_GetDamageEventData() { - string sFunc = "GetDamageEventData"; struct NWNX_Damage_DamageEventData data; - - NWNX_CallFunction(NWNX_Damage, sFunc); - - data.oDamager = NWNX_GetReturnValueObject(); - data.iBludgeoning = NWNX_GetReturnValueInt(); - data.iPierce = NWNX_GetReturnValueInt(); - data.iSlash = NWNX_GetReturnValueInt(); - data.iMagical = NWNX_GetReturnValueInt(); - data.iAcid = NWNX_GetReturnValueInt(); - data.iCold = NWNX_GetReturnValueInt(); - data.iDivine = NWNX_GetReturnValueInt(); - data.iElectrical = NWNX_GetReturnValueInt(); - data.iFire = NWNX_GetReturnValueInt(); - data.iNegative = NWNX_GetReturnValueInt(); - data.iPositive = NWNX_GetReturnValueInt(); - data.iSonic = NWNX_GetReturnValueInt(); - data.iBase = NWNX_GetReturnValueInt(); - data.iCustom1 = NWNX_GetReturnValueInt(); - data.iCustom2 = NWNX_GetReturnValueInt(); - data.iCustom3 = NWNX_GetReturnValueInt(); - data.iCustom4 = NWNX_GetReturnValueInt(); - data.iCustom5 = NWNX_GetReturnValueInt(); - data.iCustom6 = NWNX_GetReturnValueInt(); - data.iCustom7 = NWNX_GetReturnValueInt(); - data.iCustom8 = NWNX_GetReturnValueInt(); - data.iCustom9 = NWNX_GetReturnValueInt(); - data.iCustom10 = NWNX_GetReturnValueInt(); - data.iCustom11 = NWNX_GetReturnValueInt(); - data.iCustom12 = NWNX_GetReturnValueInt(); - data.iCustom13 = NWNX_GetReturnValueInt(); - data.iCustom14 = NWNX_GetReturnValueInt(); - data.iCustom15 = NWNX_GetReturnValueInt(); - data.iCustom16 = NWNX_GetReturnValueInt(); - data.iCustom17 = NWNX_GetReturnValueInt(); - data.iCustom18 = NWNX_GetReturnValueInt(); - data.iCustom19 = NWNX_GetReturnValueInt(); - data.iSpellId = NWNX_GetReturnValueInt(); - + NWNXCall(NWNX_Damage, "GetDamageEventData"); + data.oDamager = NWNXPopObject(); + data.iBludgeoning = NWNXPopInt(); + data.iPierce = NWNXPopInt(); + data.iSlash = NWNXPopInt(); + data.iMagical = NWNXPopInt(); + data.iAcid = NWNXPopInt(); + data.iCold = NWNXPopInt(); + data.iDivine = NWNXPopInt(); + data.iElectrical = NWNXPopInt(); + data.iFire = NWNXPopInt(); + data.iNegative = NWNXPopInt(); + data.iPositive = NWNXPopInt(); + data.iSonic = NWNXPopInt(); + data.iBase = NWNXPopInt(); + data.iCustom1 = NWNXPopInt(); + data.iCustom2 = NWNXPopInt(); + data.iCustom3 = NWNXPopInt(); + data.iCustom4 = NWNXPopInt(); + data.iCustom5 = NWNXPopInt(); + data.iCustom6 = NWNXPopInt(); + data.iCustom7 = NWNXPopInt(); + data.iCustom8 = NWNXPopInt(); + data.iCustom9 = NWNXPopInt(); + data.iCustom10 = NWNXPopInt(); + data.iCustom11 = NWNXPopInt(); + data.iCustom12 = NWNXPopInt(); + data.iCustom13 = NWNXPopInt(); + data.iCustom14 = NWNXPopInt(); + data.iCustom15 = NWNXPopInt(); + data.iCustom16 = NWNXPopInt(); + data.iCustom17 = NWNXPopInt(); + data.iCustom18 = NWNXPopInt(); + data.iCustom19 = NWNXPopInt(); + data.iSpellId = NWNXPopInt(); return data; } void NWNX_Damage_SetDamageEventData(struct NWNX_Damage_DamageEventData data) { - string sFunc = "SetDamageEventData"; + NWNXPushInt(data.iCustom19); + NWNXPushInt(data.iCustom18); + NWNXPushInt(data.iCustom17); + NWNXPushInt(data.iCustom16); + NWNXPushInt(data.iCustom15); + NWNXPushInt(data.iCustom14); + NWNXPushInt(data.iCustom13); + NWNXPushInt(data.iCustom12); + NWNXPushInt(data.iCustom11); + NWNXPushInt(data.iCustom10); + NWNXPushInt(data.iCustom9); + NWNXPushInt(data.iCustom8); + NWNXPushInt(data.iCustom7); + NWNXPushInt(data.iCustom6); + NWNXPushInt(data.iCustom5); + NWNXPushInt(data.iCustom4); + NWNXPushInt(data.iCustom3); + NWNXPushInt(data.iCustom2); + NWNXPushInt(data.iCustom1); + NWNXPushInt(data.iBase); + NWNXPushInt(data.iSonic); + NWNXPushInt(data.iPositive); + NWNXPushInt(data.iNegative); + NWNXPushInt(data.iFire); + NWNXPushInt(data.iElectrical); + NWNXPushInt(data.iDivine); + NWNXPushInt(data.iCold); + NWNXPushInt(data.iAcid); + NWNXPushInt(data.iMagical); + NWNXPushInt(data.iSlash); + NWNXPushInt(data.iPierce); + NWNXPushInt(data.iBludgeoning); - NWNX_PushArgumentInt(data.iCustom19); - NWNX_PushArgumentInt(data.iCustom18); - NWNX_PushArgumentInt(data.iCustom17); - NWNX_PushArgumentInt(data.iCustom16); - NWNX_PushArgumentInt(data.iCustom15); - NWNX_PushArgumentInt(data.iCustom14); - NWNX_PushArgumentInt(data.iCustom13); - NWNX_PushArgumentInt(data.iCustom12); - NWNX_PushArgumentInt(data.iCustom11); - NWNX_PushArgumentInt(data.iCustom10); - NWNX_PushArgumentInt(data.iCustom9); - NWNX_PushArgumentInt(data.iCustom8); - NWNX_PushArgumentInt(data.iCustom7); - NWNX_PushArgumentInt(data.iCustom6); - NWNX_PushArgumentInt(data.iCustom5); - NWNX_PushArgumentInt(data.iCustom4); - NWNX_PushArgumentInt(data.iCustom3); - NWNX_PushArgumentInt(data.iCustom2); - NWNX_PushArgumentInt(data.iCustom1); - NWNX_PushArgumentInt(data.iBase); - NWNX_PushArgumentInt(data.iSonic); - NWNX_PushArgumentInt(data.iPositive); - NWNX_PushArgumentInt(data.iNegative); - NWNX_PushArgumentInt(data.iFire); - NWNX_PushArgumentInt(data.iElectrical); - NWNX_PushArgumentInt(data.iDivine); - NWNX_PushArgumentInt(data.iCold); - NWNX_PushArgumentInt(data.iAcid); - NWNX_PushArgumentInt(data.iMagical); - NWNX_PushArgumentInt(data.iSlash); - NWNX_PushArgumentInt(data.iPierce); - NWNX_PushArgumentInt(data.iBludgeoning); - - NWNX_CallFunction(NWNX_Damage, sFunc); + NWNXCall(NWNX_Damage, "SetDamageEventData"); } void NWNX_Damage_SetAttackEventScript(string sScript, object oOwner=OBJECT_INVALID) { - string sFunc = "SetEventScript"; - - NWNX_PushArgumentObject(oOwner); - NWNX_PushArgumentString(sScript); - NWNX_PushArgumentString("ATTACK"); - - NWNX_CallFunction(NWNX_Damage, sFunc); + NWNXPushObject(oOwner); + NWNXPushString(sScript); + NWNXPushString("ATTACK"); + NWNXCall(NWNX_Damage, "SetEventScript"); } struct NWNX_Damage_AttackEventData NWNX_Damage_GetAttackEventData() { - string sFunc = "GetAttackEventData"; struct NWNX_Damage_AttackEventData data; - - NWNX_CallFunction(NWNX_Damage, sFunc); - - data.oTarget = NWNX_GetReturnValueObject(); - data.iBludgeoning = NWNX_GetReturnValueInt(); - data.iPierce = NWNX_GetReturnValueInt(); - data.iSlash = NWNX_GetReturnValueInt(); - data.iMagical = NWNX_GetReturnValueInt(); - data.iAcid = NWNX_GetReturnValueInt(); - data.iCold = NWNX_GetReturnValueInt(); - data.iDivine = NWNX_GetReturnValueInt(); - data.iElectrical = NWNX_GetReturnValueInt(); - data.iFire = NWNX_GetReturnValueInt(); - data.iNegative = NWNX_GetReturnValueInt(); - data.iPositive = NWNX_GetReturnValueInt(); - data.iSonic = NWNX_GetReturnValueInt(); - data.iBase = NWNX_GetReturnValueInt(); - data.iCustom1 = NWNX_GetReturnValueInt(); - data.iCustom2 = NWNX_GetReturnValueInt(); - data.iCustom3 = NWNX_GetReturnValueInt(); - data.iCustom4 = NWNX_GetReturnValueInt(); - data.iCustom5 = NWNX_GetReturnValueInt(); - data.iCustom6 = NWNX_GetReturnValueInt(); - data.iCustom7 = NWNX_GetReturnValueInt(); - data.iCustom8 = NWNX_GetReturnValueInt(); - data.iCustom9 = NWNX_GetReturnValueInt(); - data.iCustom10 = NWNX_GetReturnValueInt(); - data.iCustom11 = NWNX_GetReturnValueInt(); - data.iCustom12 = NWNX_GetReturnValueInt(); - data.iCustom13 = NWNX_GetReturnValueInt(); - data.iCustom14 = NWNX_GetReturnValueInt(); - data.iCustom15 = NWNX_GetReturnValueInt(); - data.iCustom16 = NWNX_GetReturnValueInt(); - data.iCustom17 = NWNX_GetReturnValueInt(); - data.iCustom18 = NWNX_GetReturnValueInt(); - data.iCustom19 = NWNX_GetReturnValueInt(); - data.iAttackNumber = NWNX_GetReturnValueInt(); - data.iAttackResult = NWNX_GetReturnValueInt(); - data.iWeaponAttackType = NWNX_GetReturnValueInt(); - data.iSneakAttack = NWNX_GetReturnValueInt(); - data.bKillingBlow = NWNX_GetReturnValueInt(); - data.iAttackType = NWNX_GetReturnValueInt(); - data.iToHitRoll = NWNX_GetReturnValueInt(); - data.iToHitModifier = NWNX_GetReturnValueInt(); - + NWNXCall(NWNX_Damage, "GetAttackEventData"); + data.oTarget = NWNXPopObject(); + data.iBludgeoning = NWNXPopInt(); + data.iPierce = NWNXPopInt(); + data.iSlash = NWNXPopInt(); + data.iMagical = NWNXPopInt(); + data.iAcid = NWNXPopInt(); + data.iCold = NWNXPopInt(); + data.iDivine = NWNXPopInt(); + data.iElectrical = NWNXPopInt(); + data.iFire = NWNXPopInt(); + data.iNegative = NWNXPopInt(); + data.iPositive = NWNXPopInt(); + data.iSonic = NWNXPopInt(); + data.iBase = NWNXPopInt(); + data.iCustom1 = NWNXPopInt(); + data.iCustom2 = NWNXPopInt(); + data.iCustom3 = NWNXPopInt(); + data.iCustom4 = NWNXPopInt(); + data.iCustom5 = NWNXPopInt(); + data.iCustom6 = NWNXPopInt(); + data.iCustom7 = NWNXPopInt(); + data.iCustom8 = NWNXPopInt(); + data.iCustom9 = NWNXPopInt(); + data.iCustom10 = NWNXPopInt(); + data.iCustom11 = NWNXPopInt(); + data.iCustom12 = NWNXPopInt(); + data.iCustom13 = NWNXPopInt(); + data.iCustom14 = NWNXPopInt(); + data.iCustom15 = NWNXPopInt(); + data.iCustom16 = NWNXPopInt(); + data.iCustom17 = NWNXPopInt(); + data.iCustom18 = NWNXPopInt(); + data.iCustom19 = NWNXPopInt(); + data.iAttackNumber = NWNXPopInt(); + data.iAttackResult = NWNXPopInt(); + data.iWeaponAttackType = NWNXPopInt(); + data.iSneakAttack = NWNXPopInt(); + data.bKillingBlow = NWNXPopInt(); + data.iAttackType = NWNXPopInt(); + data.iToHitRoll = NWNXPopInt(); + data.iToHitModifier = NWNXPopInt(); return data; } void NWNX_Damage_SetAttackEventData(struct NWNX_Damage_AttackEventData data) { - string sFunc = "SetAttackEventData"; - - NWNX_PushArgumentInt(data.iSneakAttack); - NWNX_PushArgumentInt(data.iAttackResult); - NWNX_PushArgumentInt(data.iCustom19); - NWNX_PushArgumentInt(data.iCustom18); - NWNX_PushArgumentInt(data.iCustom17); - NWNX_PushArgumentInt(data.iCustom16); - NWNX_PushArgumentInt(data.iCustom15); - NWNX_PushArgumentInt(data.iCustom14); - NWNX_PushArgumentInt(data.iCustom13); - NWNX_PushArgumentInt(data.iCustom12); - NWNX_PushArgumentInt(data.iCustom11); - NWNX_PushArgumentInt(data.iCustom10); - NWNX_PushArgumentInt(data.iCustom9); - NWNX_PushArgumentInt(data.iCustom8); - NWNX_PushArgumentInt(data.iCustom7); - NWNX_PushArgumentInt(data.iCustom6); - NWNX_PushArgumentInt(data.iCustom5); - NWNX_PushArgumentInt(data.iCustom4); - NWNX_PushArgumentInt(data.iCustom3); - NWNX_PushArgumentInt(data.iCustom2); - NWNX_PushArgumentInt(data.iCustom1); - NWNX_PushArgumentInt(data.iBase); - NWNX_PushArgumentInt(data.iSonic); - NWNX_PushArgumentInt(data.iPositive); - NWNX_PushArgumentInt(data.iNegative); - NWNX_PushArgumentInt(data.iFire); - NWNX_PushArgumentInt(data.iElectrical); - NWNX_PushArgumentInt(data.iDivine); - NWNX_PushArgumentInt(data.iCold); - NWNX_PushArgumentInt(data.iAcid); - NWNX_PushArgumentInt(data.iMagical); - NWNX_PushArgumentInt(data.iSlash); - NWNX_PushArgumentInt(data.iPierce); - NWNX_PushArgumentInt(data.iBludgeoning); - - NWNX_CallFunction(NWNX_Damage, sFunc); + NWNXPushInt(data.iSneakAttack); + NWNXPushInt(data.iAttackResult); + NWNXPushInt(data.iCustom19); + NWNXPushInt(data.iCustom18); + NWNXPushInt(data.iCustom17); + NWNXPushInt(data.iCustom16); + NWNXPushInt(data.iCustom15); + NWNXPushInt(data.iCustom14); + NWNXPushInt(data.iCustom13); + NWNXPushInt(data.iCustom12); + NWNXPushInt(data.iCustom11); + NWNXPushInt(data.iCustom10); + NWNXPushInt(data.iCustom9); + NWNXPushInt(data.iCustom8); + NWNXPushInt(data.iCustom7); + NWNXPushInt(data.iCustom6); + NWNXPushInt(data.iCustom5); + NWNXPushInt(data.iCustom4); + NWNXPushInt(data.iCustom3); + NWNXPushInt(data.iCustom2); + NWNXPushInt(data.iCustom1); + NWNXPushInt(data.iBase); + NWNXPushInt(data.iSonic); + NWNXPushInt(data.iPositive); + NWNXPushInt(data.iNegative); + NWNXPushInt(data.iFire); + NWNXPushInt(data.iElectrical); + NWNXPushInt(data.iDivine); + NWNXPushInt(data.iCold); + NWNXPushInt(data.iAcid); + NWNXPushInt(data.iMagical); + NWNXPushInt(data.iSlash); + NWNXPushInt(data.iPierce); + NWNXPushInt(data.iBludgeoning); + NWNXCall(NWNX_Damage, "SetAttackEventData"); } void NWNX_Damage_DealDamage(struct NWNX_Damage_DamageData data, object oTarget, object oSource, int iRanged = FALSE) { - string sFunc = "DealDamage"; - - NWNX_PushArgumentInt(iRanged); - NWNX_PushArgumentInt(data.iPower); - NWNX_PushArgumentInt(data.iCustom19); - NWNX_PushArgumentInt(data.iCustom18); - NWNX_PushArgumentInt(data.iCustom17); - NWNX_PushArgumentInt(data.iCustom16); - NWNX_PushArgumentInt(data.iCustom15); - NWNX_PushArgumentInt(data.iCustom14); - NWNX_PushArgumentInt(data.iCustom13); - NWNX_PushArgumentInt(data.iCustom12); - NWNX_PushArgumentInt(data.iCustom11); - NWNX_PushArgumentInt(data.iCustom10); - NWNX_PushArgumentInt(data.iCustom9); - NWNX_PushArgumentInt(data.iCustom8); - NWNX_PushArgumentInt(data.iCustom7); - NWNX_PushArgumentInt(data.iCustom6); - NWNX_PushArgumentInt(data.iCustom5); - NWNX_PushArgumentInt(data.iCustom4); - NWNX_PushArgumentInt(data.iCustom3); - NWNX_PushArgumentInt(data.iCustom2); - NWNX_PushArgumentInt(data.iCustom1); - NWNX_PushArgumentInt(0);// Padding for Base Damage - NWNX_PushArgumentInt(data.iSonic); - NWNX_PushArgumentInt(data.iPositive); - NWNX_PushArgumentInt(data.iNegative); - NWNX_PushArgumentInt(data.iFire); - NWNX_PushArgumentInt(data.iElectrical); - NWNX_PushArgumentInt(data.iDivine); - NWNX_PushArgumentInt(data.iCold); - NWNX_PushArgumentInt(data.iAcid); - NWNX_PushArgumentInt(data.iMagical); - NWNX_PushArgumentInt(data.iSlash); - NWNX_PushArgumentInt(data.iPierce); - NWNX_PushArgumentInt(data.iBludgeoning); - NWNX_PushArgumentObject(oTarget); - NWNX_PushArgumentObject(oSource); - - NWNX_CallFunction(NWNX_Damage, sFunc); + NWNXPushInt(iRanged); + NWNXPushInt(data.iPower); + NWNXPushInt(data.iCustom19); + NWNXPushInt(data.iCustom18); + NWNXPushInt(data.iCustom17); + NWNXPushInt(data.iCustom16); + NWNXPushInt(data.iCustom15); + NWNXPushInt(data.iCustom14); + NWNXPushInt(data.iCustom13); + NWNXPushInt(data.iCustom12); + NWNXPushInt(data.iCustom11); + NWNXPushInt(data.iCustom10); + NWNXPushInt(data.iCustom9); + NWNXPushInt(data.iCustom8); + NWNXPushInt(data.iCustom7); + NWNXPushInt(data.iCustom6); + NWNXPushInt(data.iCustom5); + NWNXPushInt(data.iCustom4); + NWNXPushInt(data.iCustom3); + NWNXPushInt(data.iCustom2); + NWNXPushInt(data.iCustom1); + NWNXPushInt(0);// Padding for Base Damage + NWNXPushInt(data.iSonic); + NWNXPushInt(data.iPositive); + NWNXPushInt(data.iNegative); + NWNXPushInt(data.iFire); + NWNXPushInt(data.iElectrical); + NWNXPushInt(data.iDivine); + NWNXPushInt(data.iCold); + NWNXPushInt(data.iAcid); + NWNXPushInt(data.iMagical); + NWNXPushInt(data.iSlash); + NWNXPushInt(data.iPierce); + NWNXPushInt(data.iBludgeoning); + NWNXPushObject(oTarget); + NWNXPushObject(oSource); + NWNXCall(NWNX_Damage, "DealDamage"); } diff --git a/_module/nss/nwnx_dialog.nss b/_module/nss/nwnx_dialog.nss index 83c5efb6..f270c5cc 100644 --- a/_module/nss/nwnx_dialog.nss +++ b/_module/nss/nwnx_dialog.nss @@ -3,8 +3,6 @@ /// @{ /// @file nwnx_dialog.nss -#include "nwnx" - const string NWNX_Dialog = "NWNX_Dialog"; ///< @private /// @name Dialog Node Types @@ -80,60 +78,46 @@ void NWNX_Dialog_End(object oObject); int NWNX_Dialog_GetCurrentNodeType() { - string sFunc = "GetCurrentNodeType"; - - NWNX_CallFunction(NWNX_Dialog, sFunc); - return NWNX_GetReturnValueInt(); + NWNXCall(NWNX_Dialog, "GetCurrentNodeType"); + return NWNXPopInt(); } int NWNX_Dialog_GetCurrentScriptType() { - string sFunc = "GetCurrentScriptType"; - - NWNX_CallFunction(NWNX_Dialog, sFunc); - return NWNX_GetReturnValueInt(); + NWNXCall(NWNX_Dialog, "GetCurrentScriptType"); + return NWNXPopInt(); } int NWNX_Dialog_GetCurrentNodeID() { - string sFunc = "GetCurrentNodeID"; - - NWNX_CallFunction(NWNX_Dialog, sFunc); - return NWNX_GetReturnValueInt(); + NWNXCall(NWNX_Dialog, "GetCurrentNodeID"); + return NWNXPopInt(); } int NWNX_Dialog_GetCurrentNodeIndex() { - string sFunc = "GetCurrentNodeIndex"; - - NWNX_CallFunction(NWNX_Dialog, sFunc); - return NWNX_GetReturnValueInt(); + NWNXCall(NWNX_Dialog, "GetCurrentNodeIndex"); + return NWNXPopInt(); } string NWNX_Dialog_GetCurrentNodeText(int language=NWNX_DIALOG_LANGUAGE_ENGLISH, int gender=GENDER_MALE) { - string sFunc = "GetCurrentNodeText"; - - NWNX_PushArgumentInt(gender); - NWNX_PushArgumentInt(language); - NWNX_CallFunction(NWNX_Dialog, sFunc); - return NWNX_GetReturnValueString(); + NWNXPushInt(gender); + NWNXPushInt(language); + NWNXCall(NWNX_Dialog, "GetCurrentNodeText"); + return NWNXPopString(); } void NWNX_Dialog_SetCurrentNodeText(string text, int language=NWNX_DIALOG_LANGUAGE_ENGLISH, int gender=GENDER_MALE) { - string sFunc = "SetCurrentNodeText"; - - NWNX_PushArgumentInt(gender); - NWNX_PushArgumentInt(language); - NWNX_PushArgumentString(text); - NWNX_CallFunction(NWNX_Dialog, sFunc); + NWNXPushInt(gender); + NWNXPushInt(language); + NWNXPushString(text); + NWNXCall(NWNX_Dialog, "SetCurrentNodeText"); } void NWNX_Dialog_End(object oObject) { - string sFunc = "End"; - - NWNX_PushArgumentObject(oObject); - NWNX_CallFunction(NWNX_Dialog, sFunc); + NWNXPushObject(oObject); + NWNXCall(NWNX_Dialog, "End"); } diff --git a/_module/nss/nwnx_effect.nss b/_module/nss/nwnx_effect.nss index ffb619ba..1107db35 100644 --- a/_module/nss/nwnx_effect.nss +++ b/_module/nss/nwnx_effect.nss @@ -2,7 +2,6 @@ /// @brief Utility functions to manipulate the builtin effect type. /// @{ /// @file nwnx_effect.nss -#include "nwnx" const string NWNX_Effect = "NWNX_Effect"; ///< @private @@ -143,52 +142,46 @@ effect NWNX_Effect_GetAppliedEffect(object oObject, int nNth); /// @} -struct NWNX_EffectUnpacked __NWNX_Effect_ResolveUnpack(string sFunc, int bLink=TRUE) +struct NWNX_EffectUnpacked __NWNX_Effect_ResolveUnpack(int bLink=TRUE) { struct NWNX_EffectUnpacked n; - n.sItemProp = NWNX_GetReturnValueString(); + n.sItemProp = NWNXPopString(); - n.sTag = NWNX_GetReturnValueString(); + n.sTag = NWNXPopString(); - float fZ = NWNX_GetReturnValueFloat(); - float fY = NWNX_GetReturnValueFloat(); - float fX = NWNX_GetReturnValueFloat(); - n.vParam1 = Vector(fX, fY, fZ); - fZ = NWNX_GetReturnValueFloat(); - fY = NWNX_GetReturnValueFloat(); - fX = NWNX_GetReturnValueFloat(); - n.vParam0 = Vector(fX, fY, fZ); - n.oParam3 = NWNX_GetReturnValueObject(); - n.oParam2 = NWNX_GetReturnValueObject(); - n.oParam1 = NWNX_GetReturnValueObject(); - n.oParam0 = NWNX_GetReturnValueObject(); - n.sParam5 = NWNX_GetReturnValueString(); - n.sParam4 = NWNX_GetReturnValueString(); - n.sParam3 = NWNX_GetReturnValueString(); - n.sParam2 = NWNX_GetReturnValueString(); - n.sParam1 = NWNX_GetReturnValueString(); - n.sParam0 = NWNX_GetReturnValueString(); - n.fParam3 = NWNX_GetReturnValueFloat(); - n.fParam2 = NWNX_GetReturnValueFloat(); - n.fParam1 = NWNX_GetReturnValueFloat(); - n.fParam0 = NWNX_GetReturnValueFloat(); - n.nParam7 = NWNX_GetReturnValueInt(); - n.nParam6 = NWNX_GetReturnValueInt(); - n.nParam5 = NWNX_GetReturnValueInt(); - n.nParam4 = NWNX_GetReturnValueInt(); - n.nParam3 = NWNX_GetReturnValueInt(); - n.nParam2 = NWNX_GetReturnValueInt(); - n.nParam1 = NWNX_GetReturnValueInt(); - n.nParam0 = NWNX_GetReturnValueInt(); - n.nNumIntegers = NWNX_GetReturnValueInt(); + n.vParam1 = NWNXPopVector(); + n.vParam0 = NWNXPopVector(); + n.oParam3 = NWNXPopObject(); + n.oParam2 = NWNXPopObject(); + n.oParam1 = NWNXPopObject(); + n.oParam0 = NWNXPopObject(); + n.sParam5 = NWNXPopString(); + n.sParam4 = NWNXPopString(); + n.sParam3 = NWNXPopString(); + n.sParam2 = NWNXPopString(); + n.sParam1 = NWNXPopString(); + n.sParam0 = NWNXPopString(); + n.fParam3 = NWNXPopFloat(); + n.fParam2 = NWNXPopFloat(); + n.fParam1 = NWNXPopFloat(); + n.fParam0 = NWNXPopFloat(); + n.nParam7 = NWNXPopInt(); + n.nParam6 = NWNXPopInt(); + n.nParam5 = NWNXPopInt(); + n.nParam4 = NWNXPopInt(); + n.nParam3 = NWNXPopInt(); + n.nParam2 = NWNXPopInt(); + n.nParam1 = NWNXPopInt(); + n.nParam0 = NWNXPopInt(); + n.nNumIntegers = NWNXPopInt(); if(bLink) { - n.bLinkRightValid = NWNX_GetReturnValueInt(); - n.eLinkRight = NWNX_GetReturnValueEffect(); - n.bLinkLeftValid = NWNX_GetReturnValueInt(); - n.eLinkLeft = NWNX_GetReturnValueEffect(); + n.bLinkRightValid = NWNXPopInt(); + n.eLinkRight = NWNXPopEffect(); + n.bLinkLeftValid = NWNXPopInt(); + n.eLinkLeft = NWNXPopEffect(); } else { @@ -196,207 +189,166 @@ struct NWNX_EffectUnpacked __NWNX_Effect_ResolveUnpack(string sFunc, int bLink=T n.bLinkLeftValid = FALSE; } - n.nCasterLevel = NWNX_GetReturnValueInt(); - n.bShowIcon = NWNX_GetReturnValueInt(); - n.bExpose = NWNX_GetReturnValueInt(); - n.nSpellId = NWNX_GetReturnValueInt(); - n.oCreator = NWNX_GetReturnValueObject(); + n.nCasterLevel = NWNXPopInt(); + n.bShowIcon = NWNXPopInt(); + n.bExpose = NWNXPopInt(); + n.nSpellId = NWNXPopInt(); + n.oCreator = NWNXPopObject(); - n.nExpiryTimeOfDay = NWNX_GetReturnValueInt(); - n.nExpiryCalendarDay = NWNX_GetReturnValueInt(); - n.fDuration = NWNX_GetReturnValueFloat(); + n.nExpiryTimeOfDay = NWNXPopInt(); + n.nExpiryCalendarDay = NWNXPopInt(); + n.fDuration = NWNXPopFloat(); - n.nSubType = NWNX_GetReturnValueInt(); - n.nType = NWNX_GetReturnValueInt(); - n.sID = NWNX_GetReturnValueString(); + n.nSubType = NWNXPopInt(); + n.nType = NWNXPopInt(); + n.sID = NWNXPopString(); return n; } -void __NWNX_Effect_ResolvePack(string sFunc, struct NWNX_EffectUnpacked e, int bReplace=FALSE) +void __NWNX_Effect_ResolvePack(struct NWNX_EffectUnpacked e, int bReplace=FALSE) { if(!bReplace) - NWNX_PushArgumentInt(e.nType); + NWNXPushInt(e.nType); - NWNX_PushArgumentInt(e.nSubType); + NWNXPushInt(e.nSubType); - NWNX_PushArgumentFloat(e.fDuration); - NWNX_PushArgumentInt(e.nExpiryCalendarDay); - NWNX_PushArgumentInt(e.nExpiryTimeOfDay); + NWNXPushFloat(e.fDuration); + NWNXPushInt(e.nExpiryCalendarDay); + NWNXPushInt(e.nExpiryTimeOfDay); - NWNX_PushArgumentObject(e.oCreator); - NWNX_PushArgumentInt(e.nSpellId); - NWNX_PushArgumentInt(e.bExpose); - NWNX_PushArgumentInt(e.bShowIcon); - NWNX_PushArgumentInt(e.nCasterLevel); + NWNXPushObject(e.oCreator); + NWNXPushInt(e.nSpellId); + NWNXPushInt(e.bExpose); + NWNXPushInt(e.bShowIcon); + NWNXPushInt(e.nCasterLevel); if(!bReplace) { - NWNX_PushArgumentEffect(e.eLinkLeft); - NWNX_PushArgumentInt(e.bLinkLeftValid); - NWNX_PushArgumentEffect(e.eLinkRight); - NWNX_PushArgumentInt(e.bLinkRightValid); + NWNXPushEffect(e.eLinkLeft); + NWNXPushInt(e.bLinkLeftValid); + NWNXPushEffect(e.eLinkRight); + NWNXPushInt(e.bLinkRightValid); } - NWNX_PushArgumentInt(e.nNumIntegers); - NWNX_PushArgumentInt(e.nParam0); - NWNX_PushArgumentInt(e.nParam1); - NWNX_PushArgumentInt(e.nParam2); - NWNX_PushArgumentInt(e.nParam3); - NWNX_PushArgumentInt(e.nParam4); - NWNX_PushArgumentInt(e.nParam5); - NWNX_PushArgumentInt(e.nParam6); - NWNX_PushArgumentInt(e.nParam7); - NWNX_PushArgumentFloat(e.fParam0); - NWNX_PushArgumentFloat(e.fParam1); - NWNX_PushArgumentFloat(e.fParam2); - NWNX_PushArgumentFloat(e.fParam3); - NWNX_PushArgumentString(e.sParam0); - NWNX_PushArgumentString(e.sParam1); - NWNX_PushArgumentString(e.sParam2); - NWNX_PushArgumentString(e.sParam3); - NWNX_PushArgumentString(e.sParam4); - NWNX_PushArgumentString(e.sParam5); - NWNX_PushArgumentObject(e.oParam0); - NWNX_PushArgumentObject(e.oParam1); - NWNX_PushArgumentObject(e.oParam2); - NWNX_PushArgumentObject(e.oParam3); + NWNXPushInt(e.nNumIntegers); + NWNXPushInt(e.nParam0); + NWNXPushInt(e.nParam1); + NWNXPushInt(e.nParam2); + NWNXPushInt(e.nParam3); + NWNXPushInt(e.nParam4); + NWNXPushInt(e.nParam5); + NWNXPushInt(e.nParam6); + NWNXPushInt(e.nParam7); + NWNXPushFloat(e.fParam0); + NWNXPushFloat(e.fParam1); + NWNXPushFloat(e.fParam2); + NWNXPushFloat(e.fParam3); + NWNXPushString(e.sParam0); + NWNXPushString(e.sParam1); + NWNXPushString(e.sParam2); + NWNXPushString(e.sParam3); + NWNXPushString(e.sParam4); + NWNXPushString(e.sParam5); + NWNXPushObject(e.oParam0); + NWNXPushObject(e.oParam1); + NWNXPushObject(e.oParam2); + NWNXPushObject(e.oParam3); - NWNX_PushArgumentFloat(e.vParam0.x); - NWNX_PushArgumentFloat(e.vParam0.y); - NWNX_PushArgumentFloat(e.vParam0.z); + NWNXPushVector(e.vParam0); + NWNXPushVector(e.vParam1); - NWNX_PushArgumentFloat(e.vParam1.x); - NWNX_PushArgumentFloat(e.vParam1.y); - NWNX_PushArgumentFloat(e.vParam1.z); + NWNXPushString(e.sTag); - NWNX_PushArgumentString(e.sTag); - - NWNX_PushArgumentString(e.sItemProp); + NWNXPushString(e.sItemProp); } struct NWNX_EffectUnpacked NWNX_Effect_UnpackEffect(effect e) { - string sFunc = "UnpackEffect"; - - NWNX_PushArgumentEffect(e); - NWNX_CallFunction(NWNX_Effect, sFunc); - - return __NWNX_Effect_ResolveUnpack(sFunc); + NWNXPushEffect(e); + NWNXCall(NWNX_Effect, "UnpackEffect"); + return __NWNX_Effect_ResolveUnpack(); } effect NWNX_Effect_PackEffect(struct NWNX_EffectUnpacked e) { - string sFunc = "PackEffect"; - - __NWNX_Effect_ResolvePack(sFunc, e); - - NWNX_CallFunction(NWNX_Effect, sFunc); - return NWNX_GetReturnValueEffect(); + __NWNX_Effect_ResolvePack(e); + NWNXCall(NWNX_Effect, "PackEffect"); + return NWNXPopEffect(); } int NWNX_Effect_ReplaceEffect(object obj, effect eOld, effect eNew) { - string sFunc = "ReplaceEffect"; - - NWNX_PushArgumentEffect(eNew); - NWNX_PushArgumentEffect(eOld); - NWNX_PushArgumentObject(obj); - - NWNX_CallFunction(NWNX_Effect, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushEffect(eNew); + NWNXPushEffect(eOld); + NWNXPushObject(obj); + NWNXCall(NWNX_Effect, "ReplaceEffect"); + return NWNXPopInt(); } int NWNX_Effect_GetTrueEffectCount(object oObject) { - string sFunc = "GetTrueEffectCount"; - NWNX_PushArgumentObject(oObject); - NWNX_CallFunction(NWNX_Effect, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(oObject); + NWNXCall(NWNX_Effect, "GetTrueEffectCount"); + return NWNXPopInt(); } struct NWNX_EffectUnpacked NWNX_Effect_GetTrueEffect(object oObject, int nIndex) { - string sFunc = "GetTrueEffect"; - NWNX_PushArgumentInt(nIndex); - NWNX_PushArgumentObject(oObject); - NWNX_CallFunction(NWNX_Effect, sFunc); - - return __NWNX_Effect_ResolveUnpack(sFunc, FALSE); + NWNXPushInt(nIndex); + NWNXPushObject(oObject); + NWNXCall(NWNX_Effect, "GetTrueEffect"); + return __NWNX_Effect_ResolveUnpack(FALSE); } void NWNX_Effect_ReplaceEffectByIndex(object oObject, int nIndex, struct NWNX_EffectUnpacked e) { - string sFunc = "ReplaceEffectByIndex"; - - __NWNX_Effect_ResolvePack(sFunc, e, TRUE); - - NWNX_PushArgumentInt(nIndex); - NWNX_PushArgumentObject(oObject); - NWNX_CallFunction(NWNX_Effect, sFunc); + __NWNX_Effect_ResolvePack(e, TRUE); + NWNXPushInt(nIndex); + NWNXPushObject(oObject); + NWNXCall(NWNX_Effect, "ReplaceEffectByIndex"); } int NWNX_Effect_RemoveEffectById(object oObject, string sID) { - string sFunc = "RemoveEffectById"; - NWNX_PushArgumentString(sID); - NWNX_PushArgumentObject(oObject); - NWNX_CallFunction(NWNX_Effect, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushString(sID); + NWNXPushObject(oObject); + NWNXCall(NWNX_Effect, "RemoveEffectById"); + return NWNXPopInt(); } void NWNX_Effect_Apply(effect eEffect, object oObject) { - string sFunc = "Apply"; - NWNX_PushArgumentObject(oObject); - NWNX_PushArgumentEffect(eEffect); - NWNX_CallFunction(NWNX_Effect, sFunc); + NWNXPushObject(oObject); + NWNXPushEffect(eEffect); + NWNXCall(NWNX_Effect, "Apply"); } effect NWNX_Effect_SetEffectCreator(effect eEffect, object oObject) { - string sFunc = "SetEffectCreator"; - - NWNX_PushArgumentObject(oObject); - NWNX_PushArgumentEffect(eEffect); - - NWNX_CallFunction(NWNX_Effect, sFunc); - - return NWNX_GetReturnValueEffect(); + NWNXPushObject(oObject); + NWNXPushEffect(eEffect); + NWNXCall(NWNX_Effect, "SetEffectCreator"); + return NWNXPopEffect(); } int NWNX_Effect_GetIsEffectValid(effect eEffect) { - string sFunc = "GetIsEffectValid"; - - NWNX_PushArgumentEffect(eEffect); - - NWNX_CallFunction(NWNX_Effect, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushEffect(eEffect); + NWNXCall(NWNX_Effect, "GetIsEffectValid"); + return NWNXPopInt(); } int NWNX_Effect_GetAppliedEffectCount(object oObject) { - string sFunc = "GetAppliedEffectCount"; - - NWNX_PushArgumentObject(oObject); - - NWNX_CallFunction(NWNX_Effect, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(oObject); + NWNXCall(NWNX_Effect, "GetAppliedEffectCount"); + return NWNXPopInt(); } effect NWNX_Effect_GetAppliedEffect(object oObject, int nNth) { - string sFunc = "GetAppliedEffect"; - - NWNX_PushArgumentInt(nNth); - NWNX_PushArgumentObject(oObject); - - NWNX_CallFunction(NWNX_Effect, sFunc); - - return NWNX_GetReturnValueEffect(); + NWNXPushInt(nNth); + NWNXPushObject(oObject); + NWNXCall(NWNX_Effect, "GetAppliedEffect"); + return NWNXPopEffect(); } diff --git a/_module/nss/nwnx_elc.nss b/_module/nss/nwnx_elc.nss index 362bac2e..57bb7fbf 100644 --- a/_module/nss/nwnx_elc.nss +++ b/_module/nss/nwnx_elc.nss @@ -2,7 +2,6 @@ /// @brief Replacement for ValidateCharacter: ELC & ILR /// @{ /// @file nwnx_elc.nss -#include "nwnx" const string NWNX_ELC = "NWNX_ELC"; ///< @private @@ -147,95 +146,71 @@ int NWNX_ELC_GetValidationFailureSpellID(); void NWNX_ELC_SetELCScript(string sScript) { - string sFunc = "SetELCScript"; - - NWNX_PushArgumentString(sScript); - NWNX_CallFunction(NWNX_ELC, sFunc); + NWNXPushString(sScript); + NWNXCall(NWNX_ELC, "SetELCScript"); } void NWNX_ELC_EnableCustomELCCheck(int bEnabled) { - string sFunc = "EnableCustomELCCheck"; - - NWNX_PushArgumentInt(bEnabled); - NWNX_CallFunction(NWNX_ELC, sFunc); + NWNXPushInt(bEnabled); + NWNXCall(NWNX_ELC, "EnableCustomELCCheck"); } void NWNX_ELC_SkipValidationFailure() { - string sFunc = "SkipValidationFailure"; - - NWNX_CallFunction(NWNX_ELC, sFunc); + NWNXCall(NWNX_ELC, "SkipValidationFailure"); } int NWNX_ELC_GetValidationFailureType() { - string sFunc = "GetValidationFailureType"; - - NWNX_CallFunction(NWNX_ELC, sFunc); - return NWNX_GetReturnValueInt(); + NWNXCall(NWNX_ELC, "GetValidationFailureType"); + return NWNXPopInt(); } int NWNX_ELC_GetValidationFailureSubType() { - string sFunc = "GetValidationFailureSubType"; - - NWNX_CallFunction(NWNX_ELC, sFunc); - return NWNX_GetReturnValueInt(); + NWNXCall(NWNX_ELC, "GetValidationFailureSubType"); + return NWNXPopInt(); } int NWNX_ELC_GetValidationFailureMessageStrRef() { - string sFunc = "GetValidationFailureMessageStrRef"; - - NWNX_CallFunction(NWNX_ELC, sFunc); - return NWNX_GetReturnValueInt(); + NWNXCall(NWNX_ELC, "GetValidationFailureMessageStrRef"); + return NWNXPopInt(); } void NWNX_ELC_SetValidationFailureMessageStrRef(int nStrRef) { - string sFunc = "SetValidationFailureMessageStrRef"; - - NWNX_PushArgumentInt(nStrRef); - NWNX_CallFunction(NWNX_ELC, sFunc); + NWNXPushInt(nStrRef); + NWNXCall(NWNX_ELC, "SetValidationFailureMessageStrRef"); } object NWNX_ELC_GetValidationFailureItem() { - string sFunc = "GetValidationFailureItem"; - - NWNX_CallFunction(NWNX_ELC, sFunc); - return NWNX_GetReturnValueObject(); + NWNXCall(NWNX_ELC, "GetValidationFailureItem"); + return NWNXPopObject(); } int NWNX_ELC_GetValidationFailureLevel() { - string sFunc = "GetValidationFailureLevel"; - - NWNX_CallFunction(NWNX_ELC, sFunc); - return NWNX_GetReturnValueInt(); + NWNXCall(NWNX_ELC, "GetValidationFailureLevel"); + return NWNXPopInt(); } int NWNX_ELC_GetValidationFailureSkillID() { - string sFunc = "GetValidationFailureSkillID"; - - NWNX_CallFunction(NWNX_ELC, sFunc); - return NWNX_GetReturnValueInt(); + NWNXCall(NWNX_ELC, "GetValidationFailureSkillID"); + return NWNXPopInt(); } int NWNX_ELC_GetValidationFailureFeatID() { - string sFunc = "GetValidationFailureFeatID"; - - NWNX_CallFunction(NWNX_ELC, sFunc); - return NWNX_GetReturnValueInt(); + NWNXCall(NWNX_ELC, "GetValidationFailureFeatID"); + return NWNXPopInt(); } int NWNX_ELC_GetValidationFailureSpellID() { - string sFunc = "GetValidationFailureSpellID"; - - NWNX_CallFunction(NWNX_ELC, sFunc); - return NWNX_GetReturnValueInt(); + NWNXCall(NWNX_ELC, "GetValidationFailureSpellID"); + return NWNXPopInt(); } diff --git a/_module/nss/nwnx_encounter.nss b/_module/nss/nwnx_encounter.nss index c067de31..8aadcabe 100644 --- a/_module/nss/nwnx_encounter.nss +++ b/_module/nss/nwnx_encounter.nss @@ -2,7 +2,6 @@ /// @brief Functions exposing additional encounter properties. /// @{ /// @file nwnx_encounter.nss -#include "nwnx" const string NWNX_Encounter = "NWNX_Encounter"; ///< @private @@ -122,205 +121,146 @@ void NWNX_Encounter_SetGeometry(object oTrigger, string sGeometry); void NWNX_Encounter_Destroy(object encounter) { - string sFunc = "Destroy"; - - NWNX_PushArgumentObject(encounter); - NWNX_CallFunction(NWNX_Encounter, sFunc); + NWNXPushObject(encounter); + NWNXCall(NWNX_Encounter, "Destroy"); } int NWNX_Encounter_GetNumberOfCreaturesInEncounterList(object encounter) { - string sFunc = "GetNumberOfCreaturesInEncounterList"; - - NWNX_PushArgumentObject(encounter); - NWNX_CallFunction(NWNX_Encounter, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(encounter); + NWNXCall(NWNX_Encounter, "GetNumberOfCreaturesInEncounterList"); + return NWNXPopInt(); } struct NWNX_Encounter_CreatureListEntry NWNX_Encounter_GetEncounterCreatureByIndex(object encounter, int index) { - string sFunc = "GetEncounterCreatureByIndex"; struct NWNX_Encounter_CreatureListEntry creatureEntry; - - NWNX_PushArgumentInt(index); - NWNX_PushArgumentObject(encounter); - - NWNX_CallFunction(NWNX_Encounter, sFunc); - - creatureEntry.alreadyUsed = NWNX_GetReturnValueInt(); - creatureEntry.unique = NWNX_GetReturnValueInt(); - creatureEntry.challengeRating = NWNX_GetReturnValueFloat(); - creatureEntry.resref = NWNX_GetReturnValueString(); - + NWNXPushInt(index); + NWNXPushObject(encounter); + NWNXCall(NWNX_Encounter, "GetEncounterCreatureByIndex"); + creatureEntry.alreadyUsed = NWNXPopInt(); + creatureEntry.unique = NWNXPopInt(); + creatureEntry.challengeRating = NWNXPopFloat(); + creatureEntry.resref = NWNXPopString(); return creatureEntry; } void NWNX_Encounter_SetEncounterCreatureByIndex(object encounter, int index, struct NWNX_Encounter_CreatureListEntry creatureEntry) { - string sFunc = "SetEncounterCreatureByIndex"; - - NWNX_PushArgumentInt(creatureEntry.alreadyUsed); - NWNX_PushArgumentInt(creatureEntry.unique); - NWNX_PushArgumentFloat(creatureEntry.challengeRating); - NWNX_PushArgumentString(creatureEntry.resref); - NWNX_PushArgumentInt(index); - NWNX_PushArgumentObject(encounter); - - NWNX_CallFunction(NWNX_Encounter, sFunc); + NWNXPushInt(creatureEntry.alreadyUsed); + NWNXPushInt(creatureEntry.unique); + NWNXPushFloat(creatureEntry.challengeRating); + NWNXPushString(creatureEntry.resref); + NWNXPushInt(index); + NWNXPushObject(encounter); + NWNXCall(NWNX_Encounter, "SetEncounterCreatureByIndex"); } int NWNX_Encounter_GetFactionId(object encounter) { - string sFunc = "GetFactionId"; - - NWNX_PushArgumentObject(encounter); - NWNX_CallFunction(NWNX_Encounter, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(encounter); + NWNXCall(NWNX_Encounter, "GetFactionId"); + return NWNXPopInt(); } void NWNX_Encounter_SetFactionId(object encounter, int factionId) { - string sFunc = "SetFactionId"; - - NWNX_PushArgumentInt(factionId); - NWNX_PushArgumentObject(encounter); - - NWNX_CallFunction(NWNX_Encounter, sFunc); + NWNXPushInt(factionId); + NWNXPushObject(encounter); + NWNXCall(NWNX_Encounter, "SetFactionId"); } int NWNX_Encounter_GetPlayerTriggeredOnly(object encounter) { - string sFunc = "GetPlayerTriggeredOnly"; - - NWNX_PushArgumentObject(encounter); - NWNX_CallFunction(NWNX_Encounter, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(encounter); + NWNXCall(NWNX_Encounter, "GetPlayerTriggeredOnly"); + return NWNXPopInt(); } void NWNX_Encounter_SetPlayerTriggeredOnly(object encounter, int playerTriggeredOnly) { - string sFunc = "SetPlayerTriggeredOnly"; - NWNX_PushArgumentInt(playerTriggeredOnly); - NWNX_PushArgumentObject(encounter); - - NWNX_CallFunction(NWNX_Encounter, sFunc); + NWNXPushInt(playerTriggeredOnly); + NWNXPushObject(encounter); + NWNXCall(NWNX_Encounter, "SetPlayerTriggeredOnly"); } int NWNX_Encounter_GetCanReset(object encounter) { - string sFunc = "GetCanReset"; - - NWNX_PushArgumentObject(encounter); - NWNX_CallFunction(NWNX_Encounter, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(encounter); + NWNXCall(NWNX_Encounter, "GetCanReset"); + return NWNXPopInt(); } void NWNX_Encounter_SetCanReset(object encounter, int reset) { - string sFunc = "SetCanReset"; - - NWNX_PushArgumentInt(reset); - NWNX_PushArgumentObject(encounter); - - NWNX_CallFunction(NWNX_Encounter, sFunc); + NWNXPushInt(reset); + NWNXPushObject(encounter); + NWNXCall(NWNX_Encounter, "SetCanReset"); } int NWNX_Encounter_GetResetTime(object encounter) { - string sFunc = "GetResetTime"; - - NWNX_PushArgumentObject(encounter); - NWNX_CallFunction(NWNX_Encounter, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(encounter); + NWNXCall(NWNX_Encounter, "GetResetTime"); + return NWNXPopInt(); } void NWNX_Encounter_SetResetTime(object encounter, int resetTime) { - string sFunc = "SetResetTime"; - - NWNX_PushArgumentInt(resetTime); - NWNX_PushArgumentObject(encounter); - - NWNX_CallFunction(NWNX_Encounter, sFunc); + NWNXPushInt(resetTime); + NWNXPushObject(encounter); + NWNXCall(NWNX_Encounter, "SetResetTime"); } int NWNX_Encounter_GetNumberOfSpawnPoints(object encounter) { - string sFunc = "GetNumberOfSpawnPoints"; - - NWNX_PushArgumentObject(encounter); - NWNX_CallFunction(NWNX_Encounter, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(encounter); + NWNXCall(NWNX_Encounter, "GetNumberOfSpawnPoints"); + return NWNXPopInt(); } location NWNX_Encounter_GetSpawnPointByIndex(object encounter, int index) { - string sFunc = "GetSpawnPointByIndex"; - - NWNX_PushArgumentInt(index); - NWNX_PushArgumentObject(encounter); - NWNX_CallFunction(NWNX_Encounter, sFunc); - - float o = NWNX_GetReturnValueFloat(); - float z = NWNX_GetReturnValueFloat(); - float y = NWNX_GetReturnValueFloat(); - float x = NWNX_GetReturnValueFloat(); - - return Location(GetArea(encounter), Vector(x, y, z), o); + NWNXPushInt(index); + NWNXPushObject(encounter); + NWNXCall(NWNX_Encounter, "GetSpawnPointByIndex"); + float fOrientation = NWNXPopFloat(); + vector vPosition = NWNXPopVector(); + return Location(GetArea(encounter), vPosition, fOrientation); } int NWNX_Encounter_GetMinNumSpawned(object encounter) { - string sFunc = "GetMinNumSpawned"; - - NWNX_PushArgumentObject(encounter); - NWNX_CallFunction(NWNX_Encounter, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(encounter); + NWNXCall(NWNX_Encounter, "GetMinNumSpawned"); + return NWNXPopInt(); } int NWNX_Encounter_GetMaxNumSpawned(object encounter) { - string sFunc = "GetMaxNumSpawned"; - - NWNX_PushArgumentObject(encounter); - NWNX_CallFunction(NWNX_Encounter, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(encounter); + NWNXCall(NWNX_Encounter, "GetMaxNumSpawned"); + return NWNXPopInt(); } int NWNX_Encounter_GetCurrentNumSpawned(object encounter) { - string sFunc = "GetCurrentNumSpawned"; - - NWNX_PushArgumentObject(encounter); - NWNX_CallFunction(NWNX_Encounter, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(encounter); + NWNXCall(NWNX_Encounter, "GetCurrentNumSpawned"); + return NWNXPopInt(); } string NWNX_Encounter_GetGeometry(object oEncounter) { - string sFunc = "GetGeometry"; - - NWNX_PushArgumentObject(oEncounter); - NWNX_CallFunction(NWNX_Encounter, sFunc); - - return NWNX_GetReturnValueString(); + NWNXPushObject(oEncounter); + NWNXCall(NWNX_Encounter, "GetGeometry"); + return NWNXPopString(); } void NWNX_Encounter_SetGeometry(object oEncounter, string sGeometry) { - string sFunc = "SetGeometry"; - - NWNX_PushArgumentString(sGeometry); - NWNX_PushArgumentObject(oEncounter); - NWNX_CallFunction(NWNX_Encounter, sFunc); + NWNXPushString(sGeometry); + NWNXPushObject(oEncounter); + NWNXCall(NWNX_Encounter, "SetGeometry"); } diff --git a/_module/nss/nwnx_events.nss b/_module/nss/nwnx_events.nss index cd6ce5c8..41c0f476 100644 --- a/_module/nss/nwnx_events.nss +++ b/_module/nss/nwnx_events.nss @@ -2,7 +2,6 @@ /// @brief Provides an interface for plugins to create event-based systems, and exposes some events through that interface. /// @{ /// @file nwnx_events.nss -#include "nwnx" const string NWNX_Events = "NWNX_Events"; ///< @private @@ -562,6 +561,11 @@ _______________________________________ `OBJECT_SELF` = The player disconnecting from the server + Event Data Tag | Type | Notes + ----------------------|--------|------- + PLAYER_NAME | string | Player name of the disconnecting client + CDKEY | string | Public cdkey of the disconnecting client + @note This event also runs when a player connects to the server but cancels out of character select. OBJECT_SELF will be OBJECT_INVALID in this case. @@ -1650,6 +1654,18 @@ _______________________________________ NWNX_Events_AddIDToWhitelist("NWNX_ON_BROADCAST_SAFE_PROJECTILE_SPELL", SPELL_*); \endcode `TARGET_OBJECT_ID` will be `OBJECT_INVALID` if the projectile is cast at a location +_______________________________________ + ## SetExperience Events + - NWNX_ON_SET_EXPERIENCE_BEFORE + - NWNX_ON_SET_EXPERIENCE_AFTER + + `OBJECT_SELF` = The player the xp is being set on + + Event Data Tag | Type | Notes + ----------------------|--------|------- + XP | int | The xp value to be set. | + + @note To set a different xp value in the BEFORE event: Skip the event and call NWNX_Events_SetEventResult() with the new value. _______________________________________ ## Broadcast Attack of Opportunity Events - NWNX_ON_BROADCAST_ATTACK_OF_OPPORTUNITY_BEFORE @@ -2282,6 +2298,7 @@ string NWNX_Events_GetEventData(string tag); /// - Broadcast Safe Projectile event /// - Attack of Opportunity events /// - Creature Jump events +/// - SetExperience Events void NWNX_Events_SkipEvent(); /// Set the return value of the event. @@ -2355,163 +2372,127 @@ int NWNX_Events_GetNumSubscribers(string sEvent); void NWNX_Events_SubscribeEvent(string evt, string script) { - string sFunc = "SubscribeEvent"; - - NWNX_PushArgumentString(script); - NWNX_PushArgumentString(evt); - NWNX_CallFunction(NWNX_Events, sFunc); + NWNXPushString(script); + NWNXPushString(evt); + NWNXCall(NWNX_Events, "SubscribeEvent"); } void NWNX_Events_UnsubscribeEvent(string evt, string script) { - string sFunc = "UnsubscribeEvent"; - - NWNX_PushArgumentString(script); - NWNX_PushArgumentString(evt); - NWNX_CallFunction(NWNX_Events, sFunc); + NWNXPushString(script); + NWNXPushString(evt); + NWNXCall(NWNX_Events, "UnsubscribeEvent"); } void NWNX_Events_UnsubscribeAllStartingWith(string prefix) { - string sFunc = "UnsubscribeAllStartingWith"; - - NWNX_PushArgumentString(prefix); - NWNX_CallFunction(NWNX_Events, sFunc); + NWNXPushString(prefix); + NWNXCall(NWNX_Events, "UnsubscribeAllStartingWith"); } void NWNX_Events_SubscribeEventScriptChunk(string sEvent, string sScriptChunk, int bWrapIntoMain = TRUE) { - string sFunc = "SubscribeEventScriptChunk"; - - NWNX_PushArgumentInt(bWrapIntoMain); - NWNX_PushArgumentString(sScriptChunk); - NWNX_PushArgumentString(sEvent); - NWNX_CallFunction(NWNX_Events, sFunc); + NWNXPushInt(bWrapIntoMain); + NWNXPushString(sScriptChunk); + NWNXPushString(sEvent); + NWNXCall(NWNX_Events, "SubscribeEventScriptChunk"); } void NWNX_Events_UnsubscribeEventScriptChunk(string sEvent, string sScriptChunk, int bWrapIntoMain = TRUE) { - string sFunc = "UnsubscribeEventScriptChunk"; - - NWNX_PushArgumentInt(bWrapIntoMain); - NWNX_PushArgumentString(sScriptChunk); - NWNX_PushArgumentString(sEvent); - NWNX_CallFunction(NWNX_Events, sFunc); + NWNXPushInt(bWrapIntoMain); + NWNXPushString(sScriptChunk); + NWNXPushString(sEvent); + NWNXCall(NWNX_Events, "UnsubscribeEventScriptChunk"); } void NWNX_Events_PushEventData(string tag, string data) { - string sFunc = "PushEventData"; - - NWNX_PushArgumentString(data); - NWNX_PushArgumentString(tag); - NWNX_CallFunction(NWNX_Events, sFunc); + NWNXPushString(data); + NWNXPushString(tag); + NWNXCall(NWNX_Events, "PushEventData"); } int NWNX_Events_SignalEvent(string evt, object target) { - string sFunc = "SignalEvent"; - - NWNX_PushArgumentObject(target); - NWNX_PushArgumentString(evt); - NWNX_CallFunction(NWNX_Events, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushObject(target); + NWNXPushString(evt); + NWNXCall(NWNX_Events, "SignalEvent"); + return NWNXPopInt(); } string NWNX_Events_GetEventData(string tag) { - string sFunc = "GetEventData"; - - NWNX_PushArgumentString(tag); - NWNX_CallFunction(NWNX_Events, sFunc); - return NWNX_GetReturnValueString(); + NWNXPushString(tag); + NWNXCall(NWNX_Events, "GetEventData"); + return NWNXPopString(); } void NWNX_Events_SkipEvent() { - string sFunc = "SkipEvent"; - - NWNX_CallFunction(NWNX_Events, sFunc); + NWNXCall(NWNX_Events, "SkipEvent"); } void NWNX_Events_SetEventResult(string data) { - string sFunc = "SetEventResult"; - - NWNX_PushArgumentString(data); - NWNX_CallFunction(NWNX_Events, sFunc); + NWNXPushString(data); + NWNXCall(NWNX_Events, "SetEventResult"); } string NWNX_Events_GetCurrentEvent() { - string sFunc = "GetCurrentEvent"; - - NWNX_CallFunction(NWNX_Events, sFunc); - return NWNX_GetReturnValueString(); + NWNXCall(NWNX_Events, "GetCurrentEvent"); + return NWNXPopString(); } void NWNX_Events_ToggleDispatchListMode(string sEvent, string sScriptOrChunk, int bEnable) { - string sFunc = "ToggleDispatchListMode"; - - NWNX_PushArgumentInt(bEnable); - NWNX_PushArgumentString(sScriptOrChunk); - NWNX_PushArgumentString(sEvent); - NWNX_CallFunction(NWNX_Events, sFunc); + NWNXPushInt(bEnable); + NWNXPushString(sScriptOrChunk); + NWNXPushString(sEvent); + NWNXCall(NWNX_Events, "ToggleDispatchListMode"); } void NWNX_Events_AddObjectToDispatchList(string sEvent, string sScriptOrChunk, object oObject) { - string sFunc = "AddObjectToDispatchList"; - - NWNX_PushArgumentObject(oObject); - NWNX_PushArgumentString(sScriptOrChunk); - NWNX_PushArgumentString(sEvent); - NWNX_CallFunction(NWNX_Events, sFunc); + NWNXPushObject(oObject); + NWNXPushString(sScriptOrChunk); + NWNXPushString(sEvent); + NWNXCall(NWNX_Events, "AddObjectToDispatchList"); } void NWNX_Events_RemoveObjectFromDispatchList(string sEvent, string sScriptOrChunk, object oObject) { - string sFunc = "RemoveObjectFromDispatchList"; - - NWNX_PushArgumentObject(oObject); - NWNX_PushArgumentString(sScriptOrChunk); - NWNX_PushArgumentString(sEvent); - NWNX_CallFunction(NWNX_Events, sFunc); + NWNXPushObject(oObject); + NWNXPushString(sScriptOrChunk); + NWNXPushString(sEvent); + NWNXCall(NWNX_Events, "RemoveObjectFromDispatchList"); } void NWNX_Events_ToggleIDWhitelist(string sEvent, int bEnable) { - string sFunc = "ToggleIDWhitelist"; - - NWNX_PushArgumentInt(bEnable); - NWNX_PushArgumentString(sEvent); - NWNX_CallFunction(NWNX_Events, sFunc); + NWNXPushInt(bEnable); + NWNXPushString(sEvent); + NWNXCall(NWNX_Events, "ToggleIDWhitelist"); } void NWNX_Events_AddIDToWhitelist(string sEvent, int nID) { - string sFunc = "AddIDToWhitelist"; - - NWNX_PushArgumentInt(nID); - NWNX_PushArgumentString(sEvent); - NWNX_CallFunction(NWNX_Events, sFunc); + NWNXPushInt(nID); + NWNXPushString(sEvent); + NWNXCall(NWNX_Events, "AddIDToWhitelist"); } void NWNX_Events_RemoveIDFromWhitelist(string sEvent, int nID) { - string sFunc = "RemoveIDFromWhitelist"; - - NWNX_PushArgumentInt(nID); - NWNX_PushArgumentString(sEvent); - NWNX_CallFunction(NWNX_Events, sFunc); + NWNXPushInt(nID); + NWNXPushString(sEvent); + NWNXCall(NWNX_Events, "RemoveIDFromWhitelist"); } int NWNX_Events_GetNumSubscribers(string sEvent) { - string sFunc = "GetNumSubscribers"; - - NWNX_PushArgumentString(sEvent); - NWNX_CallFunction(NWNX_Events, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushString(sEvent); + NWNXCall(NWNX_Events, "GetNumSubscribers"); + return NWNXPopInt(); } diff --git a/_module/nss/nwnx_feat.nss b/_module/nss/nwnx_feat.nss index 19746a6d..8b9468ea 100644 --- a/_module/nss/nwnx_feat.nss +++ b/_module/nss/nwnx_feat.nss @@ -2,7 +2,6 @@ /// @brief Define feat bonuses/penalties /// @{ /// @file nwnx_feat.nss -#include "nwnx" const string NWNX_Feat = "NWNX_Feat"; ///< @private @@ -53,14 +52,11 @@ void NWNX_Feat_SetFeatModifier(int iFeat, int iMod, int iParam1 = 0xDEADBEEF, in void NWNX_Feat_SetFeatModifier(int iFeat, int iMod, int iParam1 = 0xDEADBEEF, int iParam2 = 0xDEADBEEF, int iParam3 = 0xDEADBEEF, int iParam4 = 0xDEADBEEF) { - string sFunc = "SetFeatModifier"; - - NWNX_PushArgumentInt(iParam4); - NWNX_PushArgumentInt(iParam3); - NWNX_PushArgumentInt(iParam2); - NWNX_PushArgumentInt(iParam1); - NWNX_PushArgumentInt(iMod); - NWNX_PushArgumentInt(iFeat); - - NWNX_CallFunction(NWNX_Feat, sFunc); + NWNXPushInt(iParam4); + NWNXPushInt(iParam3); + NWNXPushInt(iParam2); + NWNXPushInt(iParam1); + NWNXPushInt(iMod); + NWNXPushInt(iFeat); + NWNXCall(NWNX_Feat, "SetFeatModifier"); } diff --git a/_module/nss/nwnx_feedback.nss b/_module/nss/nwnx_feedback.nss index 3e56e075..daf3280c 100644 --- a/_module/nss/nwnx_feedback.nss +++ b/_module/nss/nwnx_feedback.nss @@ -10,7 +10,6 @@ /// * -1 = Personal state is not set for Message /// @{ /// @file nwnx_feedback.nss -#include "nwnx" const string NWNX_Feedback = "NWNX_Feedback"; ///< @private @@ -402,95 +401,69 @@ void NWNX_Feedback_SetCombatLogMessageMode(int bWhitelist); int NWNX_Feedback_GetFeedbackMessageHidden(int nMessage, object oPC = OBJECT_INVALID) { - string sFunc = "GetMessageHidden"; - int nMessageType = 0; - - NWNX_PushArgumentInt(nMessage); - NWNX_PushArgumentInt(nMessageType); - NWNX_PushArgumentObject(oPC); - NWNX_CallFunction(NWNX_Feedback, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushInt(nMessage); + NWNXPushInt(0); + NWNXPushObject(oPC); + NWNXCall(NWNX_Feedback, "GetMessageHidden"); + return NWNXPopInt(); } void NWNX_Feedback_SetFeedbackMessageHidden(int nMessage, int isHidden, object oPC = OBJECT_INVALID) { - string sFunc = "SetMessageHidden"; - int nMessageType = 0; - - NWNX_PushArgumentInt(isHidden); - NWNX_PushArgumentInt(nMessage); - NWNX_PushArgumentInt(nMessageType); - NWNX_PushArgumentObject(oPC); - NWNX_CallFunction(NWNX_Feedback, sFunc); + NWNXPushInt(isHidden); + NWNXPushInt(nMessage); + NWNXPushInt(0); + NWNXPushObject(oPC); + NWNXCall(NWNX_Feedback, "SetMessageHidden"); } int NWNX_Feedback_GetCombatLogMessageHidden(int nMessage, object oPC = OBJECT_INVALID) { - string sFunc = "GetMessageHidden"; - int nMessageType = 1; + NWNXPushInt(nMessage); + NWNXPushInt(1); + NWNXPushObject(oPC); + NWNXCall(NWNX_Feedback, "GetMessageHidden"); - NWNX_PushArgumentInt(nMessage); - NWNX_PushArgumentInt(nMessageType); - NWNX_PushArgumentObject(oPC); - NWNX_CallFunction(NWNX_Feedback, sFunc); - - return NWNX_GetReturnValueInt(); + return NWNXPopInt(); } void NWNX_Feedback_SetCombatLogMessageHidden(int nMessage, int isHidden, object oPC = OBJECT_INVALID) { - string sFunc = "SetMessageHidden"; - int nMessageType = 1; - - NWNX_PushArgumentInt(isHidden); - NWNX_PushArgumentInt(nMessage); - NWNX_PushArgumentInt(nMessageType); - NWNX_PushArgumentObject(oPC); - NWNX_CallFunction(NWNX_Feedback, sFunc); + NWNXPushInt(isHidden); + NWNXPushInt(nMessage); + NWNXPushInt(1); + NWNXPushObject(oPC); + NWNXCall(NWNX_Feedback, "SetMessageHidden"); } int NWNX_Feedback_GetJournalUpdatedMessageHidden(object oPC = OBJECT_INVALID) { - string sFunc = "GetMessageHidden"; - int nMessageType = 2; - - NWNX_PushArgumentInt(0); - NWNX_PushArgumentInt(nMessageType); - NWNX_PushArgumentObject(oPC); - NWNX_CallFunction(NWNX_Feedback, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushInt(0); + NWNXPushInt(2); + NWNXPushObject(oPC); + NWNXCall(NWNX_Feedback, "GetMessageHidden"); + return NWNXPopInt(); } void NWNX_Feedback_SetJournalUpdatedMessageHidden(int isHidden, object oPC = OBJECT_INVALID) { - string sFunc = "SetMessageHidden"; - int nMessageType = 2; - - NWNX_PushArgumentInt(isHidden); - NWNX_PushArgumentInt(0); - NWNX_PushArgumentInt(nMessageType); - NWNX_PushArgumentObject(oPC); - NWNX_CallFunction(NWNX_Feedback, sFunc); + NWNXPushInt(isHidden); + NWNXPushInt(0); + NWNXPushInt(2); + NWNXPushObject(oPC); + NWNXCall(NWNX_Feedback, "SetMessageHidden"); } void NWNX_Feedback_SetFeedbackMessageMode(int bWhitelist) { - string sFunc = "SetFeedbackMode"; - int nMessageType = 0; - - NWNX_PushArgumentInt(bWhitelist); - NWNX_PushArgumentInt(nMessageType); - NWNX_CallFunction(NWNX_Feedback, sFunc); + NWNXPushInt(bWhitelist); + NWNXPushInt(0); + NWNXCall(NWNX_Feedback, "SetFeedbackMode"); } void NWNX_Feedback_SetCombatLogMessageMode(int bWhitelist) { - string sFunc = "SetFeedbackMode"; - int nMessageType = 1; - - NWNX_PushArgumentInt(bWhitelist); - NWNX_PushArgumentInt(nMessageType); - NWNX_CallFunction(NWNX_Feedback, sFunc); + NWNXPushInt(bWhitelist); + NWNXPushInt(1); + NWNXCall(NWNX_Feedback, "SetFeedbackMode"); } diff --git a/_module/nss/nwnx_httpclient.nss b/_module/nss/nwnx_httpclient.nss index ea10d20a..878dc3dd 100644 --- a/_module/nss/nwnx_httpclient.nss +++ b/_module/nss/nwnx_httpclient.nss @@ -2,7 +2,6 @@ /// @brief NWNX HTTPClient /// @{ /// @file nwnx_httpclient.nss -#include "nwnx" const string NWNX_HTTPClient = "NWNX_HTTPClient"; ///< @private @@ -70,44 +69,39 @@ struct NWNX_HTTPClient_Request NWNX_HTTPClient_GetRequest(int nRequestId); int NWNX_HTTPClient_SendRequest(struct NWNX_HTTPClient_Request s) { - string sFunc = "SendRequest"; - NWNX_PushArgumentString(s.sHeaders); - NWNX_PushArgumentInt(s.nPort); - NWNX_PushArgumentString(s.sAuthPassword); - NWNX_PushArgumentString(s.sAuthUserOrToken); - NWNX_PushArgumentInt(s.nAuthType); - NWNX_PushArgumentString(s.sData); - NWNX_PushArgumentInt(s.nContentType); - NWNX_PushArgumentString(s.sPath); - NWNX_PushArgumentString(s.sHost); - NWNX_PushArgumentInt(s.nRequestMethod); - NWNX_PushArgumentString(s.sTag); - NWNX_CallFunction(NWNX_HTTPClient, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushString(s.sHeaders); + NWNXPushInt(s.nPort); + NWNXPushString(s.sAuthPassword); + NWNXPushString(s.sAuthUserOrToken); + NWNXPushInt(s.nAuthType); + NWNXPushString(s.sData); + NWNXPushInt(s.nContentType); + NWNXPushString(s.sPath); + NWNXPushString(s.sHost); + NWNXPushInt(s.nRequestMethod); + NWNXPushString(s.sTag); + NWNXCall(NWNX_HTTPClient, "SendRequest"); + return NWNXPopInt(); } struct NWNX_HTTPClient_Request NWNX_HTTPClient_GetRequest(int nRequestId) { - - string sFunc = "GetRequest"; - - NWNX_PushArgumentInt(nRequestId); - NWNX_CallFunction(NWNX_HTTPClient, sFunc); + NWNXPushInt(nRequestId); + NWNXCall(NWNX_HTTPClient, "GetRequest"); struct NWNX_HTTPClient_Request s; - s.sTag = NWNX_GetReturnValueString(); - s.nRequestMethod = NWNX_GetReturnValueInt(); - s.sHost = NWNX_GetReturnValueString(); - s.sPath = NWNX_GetReturnValueString(); - s.nContentType = NWNX_GetReturnValueInt(); - s.sData = NWNX_GetReturnValueString(); - s.nAuthType = NWNX_GetReturnValueInt(); - s.sAuthUserOrToken = NWNX_GetReturnValueString(); - s.sAuthPassword = NWNX_GetReturnValueString(); - s.nPort = NWNX_GetReturnValueInt(); - s.sHeaders = NWNX_GetReturnValueString(); + s.sTag = NWNXPopString(); + s.nRequestMethod = NWNXPopInt(); + s.sHost = NWNXPopString(); + s.sPath = NWNXPopString(); + s.nContentType = NWNXPopInt(); + s.sData = NWNXPopString(); + s.nAuthType = NWNXPopInt(); + s.sAuthUserOrToken = NWNXPopString(); + s.sAuthPassword = NWNXPopString(); + s.nPort = NWNXPopInt(); + s.sHeaders = NWNXPopString(); return s; } diff --git a/_module/nss/nwnx_item.nss b/_module/nss/nwnx_item.nss index 01cd4ac0..c1d8779c 100644 --- a/_module/nss/nwnx_item.nss +++ b/_module/nss/nwnx_item.nss @@ -2,7 +2,6 @@ /// @brief Functions exposing additional item properties. /// @{ /// @file nwnx_item.nss -#include "nwnx" const string NWNX_Item = "NWNX_Item"; ///< @private @@ -134,169 +133,120 @@ int NWNX_Item_GetMinEquipLevelOverride(object oItem); void NWNX_Item_SetWeight(object oItem, int w) { - string sFunc = "SetWeight"; - - NWNX_PushArgumentInt(w); - NWNX_PushArgumentObject(oItem); - - NWNX_CallFunction(NWNX_Item, sFunc); + NWNXPushInt(w); + NWNXPushObject(oItem); + NWNXCall(NWNX_Item, "SetWeight"); } void NWNX_Item_SetBaseGoldPieceValue(object oItem, int g) { - string sFunc = "SetBaseGoldPieceValue"; - - NWNX_PushArgumentInt(g); - NWNX_PushArgumentObject(oItem); - - NWNX_CallFunction(NWNX_Item, sFunc); + NWNXPushInt(g); + NWNXPushObject(oItem); + NWNXCall(NWNX_Item, "SetBaseGoldPieceValue"); } void NWNX_Item_SetAddGoldPieceValue(object oItem, int g) { - string sFunc = "SetAddGoldPieceValue"; - - NWNX_PushArgumentInt(g); - NWNX_PushArgumentObject(oItem); - - NWNX_CallFunction(NWNX_Item, sFunc); + NWNXPushInt(g); + NWNXPushObject(oItem); + NWNXCall(NWNX_Item, "SetAddGoldPieceValue"); } int NWNX_Item_GetBaseGoldPieceValue(object oItem) { - string sFunc = "GetBaseGoldPieceValue"; - - NWNX_PushArgumentObject(oItem); - - NWNX_CallFunction(NWNX_Item, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushObject(oItem); + NWNXCall(NWNX_Item, "GetBaseGoldPieceValue"); + return NWNXPopInt(); } int NWNX_Item_GetAddGoldPieceValue(object oItem) { - string sFunc = "GetAddGoldPieceValue"; - - NWNX_PushArgumentObject(oItem); - - NWNX_CallFunction(NWNX_Item, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushObject(oItem); + NWNXCall(NWNX_Item, "GetAddGoldPieceValue"); + return NWNXPopInt(); } void NWNX_Item_SetBaseItemType(object oItem, int nBaseItem) { - string sFunc = "SetBaseItemType"; - - NWNX_PushArgumentInt(nBaseItem); - NWNX_PushArgumentObject(oItem); - - NWNX_CallFunction(NWNX_Item, sFunc); + NWNXPushInt(nBaseItem); + NWNXPushObject(oItem); + NWNXCall(NWNX_Item, "SetBaseItemType"); } void NWNX_Item_SetItemAppearance(object oItem, int nType, int nIndex, int nValue, int bUpdateCreatureAppearance = FALSE) { - string sFunc = "SetItemAppearance"; - - NWNX_PushArgumentInt(bUpdateCreatureAppearance); - NWNX_PushArgumentInt(nValue); - NWNX_PushArgumentInt(nIndex); - NWNX_PushArgumentInt(nType); - NWNX_PushArgumentObject(oItem); - - NWNX_CallFunction(NWNX_Item, sFunc); - + NWNXPushInt(bUpdateCreatureAppearance); + NWNXPushInt(nValue); + NWNXPushInt(nIndex); + NWNXPushInt(nType); + NWNXPushObject(oItem); + NWNXCall(NWNX_Item, "SetItemAppearance"); } string NWNX_Item_GetEntireItemAppearance(object oItem) { - string sFunc = "GetEntireItemAppearance"; - - NWNX_PushArgumentObject(oItem); - - NWNX_CallFunction(NWNX_Item, sFunc); - return NWNX_GetReturnValueString(); + NWNXPushObject(oItem); + NWNXCall(NWNX_Item, "GetEntireItemAppearance"); + return NWNXPopString(); } void NWNX_Item_RestoreItemAppearance(object oItem, string sApp) { - string sFunc = "RestoreItemAppearance"; - - NWNX_PushArgumentString(sApp); - NWNX_PushArgumentObject(oItem); - - NWNX_CallFunction(NWNX_Item, sFunc); + NWNXPushString(sApp); + NWNXPushObject(oItem); + NWNXCall(NWNX_Item, "RestoreItemAppearance"); } int NWNX_Item_GetBaseArmorClass(object oItem) { - string sFunc = "GetBaseArmorClass"; - - NWNX_PushArgumentObject(oItem); - - NWNX_CallFunction(NWNX_Item, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushObject(oItem); + NWNXCall(NWNX_Item, "GetBaseArmorClass"); + return NWNXPopInt(); } int NWNX_Item_GetMinEquipLevel(object oItem) { - string sFunc = "GetMinEquipLevel"; - - NWNX_PushArgumentObject(oItem); - - NWNX_CallFunction(NWNX_Item, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushObject(oItem); + NWNXCall(NWNX_Item, "GetMinEquipLevel"); + return NWNXPopInt(); } int NWNX_Item_MoveTo(object oItem, object oTarget, int bHideAllFeedback = FALSE) { - string sFunc = "MoveTo"; - - NWNX_PushArgumentInt(bHideAllFeedback); - NWNX_PushArgumentObject(oTarget); - NWNX_PushArgumentObject(oItem); - - NWNX_CallFunction(NWNX_Item, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushInt(bHideAllFeedback); + NWNXPushObject(oTarget); + NWNXPushObject(oItem); + NWNXCall(NWNX_Item, "MoveTo"); + return NWNXPopInt(); } void NWNX_Item_SetMinEquipLevelModifier(object oItem, int nModifier, int bPersist = TRUE) { - string sFunc = "SetMinEquipLevelModifier"; - - NWNX_PushArgumentInt(bPersist); - NWNX_PushArgumentInt(nModifier); - NWNX_PushArgumentObject(oItem); - - NWNX_CallFunction(NWNX_Item, sFunc); + NWNXPushInt(bPersist); + NWNXPushInt(nModifier); + NWNXPushObject(oItem); + NWNXCall(NWNX_Item, "SetMinEquipLevelModifier"); } int NWNX_Item_GetMinEquipLevelModifier(object oItem) { - string sFunc = "GetMinEquipLevelModifier"; - - NWNX_PushArgumentObject(oItem); - - NWNX_CallFunction(NWNX_Item, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushObject(oItem); + NWNXCall(NWNX_Item, "GetMinEquipLevelModifier"); + return NWNXPopInt(); } void NWNX_Item_SetMinEquipLevelOverride(object oItem, int nOverride, int bPersist = TRUE) { - string sFunc = "SetMinEquipLevelOverride"; - NWNX_PushArgumentInt(bPersist); - NWNX_PushArgumentInt(nOverride); - NWNX_PushArgumentObject(oItem); - - NWNX_CallFunction(NWNX_Item, sFunc); + NWNXPushInt(bPersist); + NWNXPushInt(nOverride); + NWNXPushObject(oItem); + NWNXCall(NWNX_Item, "SetMinEquipLevelOverride"); } int NWNX_Item_GetMinEquipLevelOverride(object oItem) { - string sFunc = "GetMinEquipLevelOverride"; - - NWNX_PushArgumentObject(oItem); - - NWNX_CallFunction(NWNX_Item, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushObject(oItem); + NWNXCall(NWNX_Item, "GetMinEquipLevelOverride"); + return NWNXPopInt(); } diff --git a/_module/nss/nwnx_itemprop.nss b/_module/nss/nwnx_itemprop.nss index 2e84b3f0..d956add0 100644 --- a/_module/nss/nwnx_itemprop.nss +++ b/_module/nss/nwnx_itemprop.nss @@ -2,7 +2,6 @@ /// @brief Utility functions to manipulate the builtin itemproperty type. /// @{ /// @file nwnx_itemprop.nss -#include "nwnx" const string NWNX_ItemProperty = "NWNX_ItemProperty"; ///< @private @@ -44,70 +43,58 @@ struct NWNX_IPUnpacked NWNX_ItemProperty_GetActiveProperty(object oItem, int nIn struct NWNX_IPUnpacked NWNX_ItemProperty_UnpackIP(itemproperty ip) { - string sFunc = "UnpackIP"; - - NWNX_PushArgumentItemProperty(ip); - NWNX_CallFunction(NWNX_ItemProperty, sFunc); - + NWNXPushItemProperty(ip); + NWNXCall(NWNX_ItemProperty, "UnpackIP"); struct NWNX_IPUnpacked n; - - n.sID = NWNX_GetReturnValueString(); - n.nProperty = NWNX_GetReturnValueInt(); - n.nSubType = NWNX_GetReturnValueInt(); - n.nCostTable = NWNX_GetReturnValueInt(); - n.nCostTableValue = NWNX_GetReturnValueInt(); - n.nParam1 = NWNX_GetReturnValueInt(); - n.nParam1Value = NWNX_GetReturnValueInt(); - n.nUsesPerDay = NWNX_GetReturnValueInt(); - n.nChanceToAppear = NWNX_GetReturnValueInt(); - n.bUsable = NWNX_GetReturnValueInt(); - n.nSpellId = NWNX_GetReturnValueInt(); - n.oCreator = NWNX_GetReturnValueObject(); - n.sTag = NWNX_GetReturnValueString(); - + n.sID = NWNXPopString(); + n.nProperty = NWNXPopInt(); + n.nSubType = NWNXPopInt(); + n.nCostTable = NWNXPopInt(); + n.nCostTableValue = NWNXPopInt(); + n.nParam1 = NWNXPopInt(); + n.nParam1Value = NWNXPopInt(); + n.nUsesPerDay = NWNXPopInt(); + n.nChanceToAppear = NWNXPopInt(); + n.bUsable = NWNXPopInt(); + n.nSpellId = NWNXPopInt(); + n.oCreator = NWNXPopObject(); + n.sTag = NWNXPopString(); return n; } itemproperty NWNX_ItemProperty_PackIP(struct NWNX_IPUnpacked n) { - string sFunc = "PackIP"; - - NWNX_PushArgumentString(n.sTag); - NWNX_PushArgumentObject(n.oCreator); - NWNX_PushArgumentInt(n.nSpellId); - NWNX_PushArgumentInt(n.bUsable); - NWNX_PushArgumentInt(n.nChanceToAppear); - NWNX_PushArgumentInt(n.nUsesPerDay); - NWNX_PushArgumentInt(n.nParam1Value); - NWNX_PushArgumentInt(n.nParam1); - NWNX_PushArgumentInt(n.nCostTableValue); - NWNX_PushArgumentInt(n.nCostTable); - NWNX_PushArgumentInt(n.nSubType); - NWNX_PushArgumentInt(n.nProperty); - - NWNX_CallFunction(NWNX_ItemProperty, sFunc); - return NWNX_GetReturnValueItemProperty(); + NWNXPushString(n.sTag); + NWNXPushObject(n.oCreator); + NWNXPushInt(n.nSpellId); + NWNXPushInt(n.bUsable); + NWNXPushInt(n.nChanceToAppear); + NWNXPushInt(n.nUsesPerDay); + NWNXPushInt(n.nParam1Value); + NWNXPushInt(n.nParam1); + NWNXPushInt(n.nCostTableValue); + NWNXPushInt(n.nCostTable); + NWNXPushInt(n.nSubType); + NWNXPushInt(n.nProperty); + NWNXCall(NWNX_ItemProperty, "PackIP"); + return NWNXPopItemProperty(); } struct NWNX_IPUnpacked NWNX_ItemProperty_GetActiveProperty(object oItem, int nIndex) { - string sFunc = "GetActiveProperty"; - NWNX_PushArgumentInt(nIndex); - NWNX_PushArgumentObject(oItem); - NWNX_CallFunction(NWNX_ItemProperty, sFunc); - + NWNXPushInt(nIndex); + NWNXPushObject(oItem); + NWNXCall(NWNX_ItemProperty, "GetActiveProperty"); struct NWNX_IPUnpacked n; - - n.nProperty = NWNX_GetReturnValueInt(); - n.nSubType = NWNX_GetReturnValueInt(); - n.nCostTable = NWNX_GetReturnValueInt(); - n.nCostTableValue = NWNX_GetReturnValueInt(); - n.nParam1 = NWNX_GetReturnValueInt(); - n.nParam1Value = NWNX_GetReturnValueInt(); - n.nUsesPerDay = NWNX_GetReturnValueInt(); - n.nChanceToAppear = NWNX_GetReturnValueInt(); - n.bUsable = NWNX_GetReturnValueInt(); - n.sTag = NWNX_GetReturnValueString(); - + n.nProperty = NWNXPopInt(); + n.nSubType = NWNXPopInt(); + n.nCostTable = NWNXPopInt(); + n.nCostTableValue = NWNXPopInt(); + n.nParam1 = NWNXPopInt(); + n.nParam1Value = NWNXPopInt(); + n.nUsesPerDay = NWNXPopInt(); + n.nChanceToAppear = NWNXPopInt(); + n.bUsable = NWNXPopInt(); + n.sTag = NWNXPopString(); return n; } diff --git a/_module/nss/nwnx_lua.nss b/_module/nss/nwnx_lua.nss index 60a645ae..42bf158e 100644 --- a/_module/nss/nwnx_lua.nss +++ b/_module/nss/nwnx_lua.nss @@ -2,7 +2,6 @@ /// @brief Execute Lua code and generate events in NWScript /// @{ /// @file nwnx_lua.nss -#include "nwnx" const string NWNX_Lua = "NWNX_Lua"; ///< @private @@ -25,27 +24,21 @@ void NWNX_Lua_RunEvent(string sEvent, object oObject, string sExtra=""); void NWNX_Lua_EvalVoid(string sCode) { - string sFunc = "EvalVoid"; - - NWNX_PushArgumentString(sCode); - NWNX_CallFunction(NWNX_Lua, sFunc); + NWNXPushString(sCode); + NWNXCall(NWNX_Lua, "EvalVoid"); } string NWNX_Lua_Eval(string sCode) { - string sFunc = "Eval"; - - NWNX_PushArgumentString(sCode); - NWNX_CallFunction(NWNX_Lua, sFunc); - return NWNX_GetReturnValueString(); + NWNXPushString(sCode); + NWNXCall(NWNX_Lua, "Eval"); + return NWNXPopString(); } void NWNX_Lua_RunEvent(string sEvent, object oObject, string sExtra="") { - string sFunc = "RunEvent"; - - NWNX_PushArgumentString(sExtra); - NWNX_PushArgumentObject(oObject); - NWNX_PushArgumentString(sEvent); - NWNX_CallFunction(NWNX_Lua, sFunc); + NWNXPushString(sExtra); + NWNXPushObject(oObject); + NWNXPushString(sEvent); + NWNXCall(NWNX_Lua, "RunEvent"); } diff --git a/_module/nss/nwnx_nostack.nss b/_module/nss/nwnx_nostack.nss index 23a55e1b..159214f9 100644 --- a/_module/nss/nwnx_nostack.nss +++ b/_module/nss/nwnx_nostack.nss @@ -2,7 +2,6 @@ /// @brief Functions to allow more control over ability/skill/bonuses stacking. /// @{ /// @file nwnx_nostack.nss -#include "nwnx" const string NWNX_NoStack = "NWNX_NoStack"; ///< @private @@ -31,10 +30,7 @@ void NWNX_NoStack_SetSpellBonusType(int spell, int type); void NWNX_NoStack_SetSpellBonusType(int spell, int type) { - string sFunc = "SetSpellBonusType"; - - NWNX_PushArgumentInt(type); - NWNX_PushArgumentInt(spell); - - NWNX_CallFunction(NWNX_NoStack, sFunc); + NWNXPushInt(type); + NWNXPushInt(spell); + NWNXCall(NWNX_NoStack, "SetSpellBonusType"); } diff --git a/_module/nss/nwnx_nwsqliteext.nss b/_module/nss/nwnx_nwsqliteext.nss index b4b6b717..953a863a 100644 --- a/_module/nss/nwnx_nwsqliteext.nss +++ b/_module/nss/nwnx_nwsqliteext.nss @@ -2,7 +2,6 @@ /// @brief Various extensions for the game's built-in sqlite database. /// @{ /// @file nwnx_nwsqliteext.nss -#include "nwnx" const string NWNX_NWSQLiteExtensions = "NWNX_NWSQLiteExtensions"; ///< @private @@ -17,9 +16,9 @@ int NWNX_NWSQLiteExtensions_CreateVirtual2DATable(string s2DA, string sColumnTyp int NWNX_NWSQLiteExtensions_CreateVirtual2DATable(string s2DA, string sColumnTypeHints = "", string sTableName = "") { - NWNX_PushArgumentString(sTableName); - NWNX_PushArgumentString(sColumnTypeHints); - NWNX_PushArgumentString(s2DA); - NWNX_CallFunction(NWNX_NWSQLiteExtensions, "CreateVirtual2DATable"); - return NWNX_GetReturnValueInt(); + NWNXPushString(sTableName); + NWNXPushString(sColumnTypeHints); + NWNXPushString(s2DA); + NWNXCall(NWNX_NWSQLiteExtensions, "CreateVirtual2DATable"); + return NWNXPopInt(); } diff --git a/_module/nss/nwnx_object.nss b/_module/nss/nwnx_object.nss index acab7d82..9e51a5ea 100644 --- a/_module/nss/nwnx_object.nss +++ b/_module/nss/nwnx_object.nss @@ -2,7 +2,6 @@ /// @brief Functions exposing additional object properties. /// @{ /// @file nwnx_object.nss -#include "nwnx" const string NWNX_Object = "NWNX_Object"; ///< @private @@ -437,641 +436,475 @@ void NWNX_Object_SetLocalizedName(object oObject, string sName, int nLanguage, i int NWNX_Object_GetLocalVariableCount(object obj) { - string sFunc = "GetLocalVariableCount"; - - NWNX_PushArgumentObject(obj); - NWNX_CallFunction(NWNX_Object, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(obj); + NWNXCall(NWNX_Object, "GetLocalVariableCount"); + return NWNXPopInt(); } struct NWNX_Object_LocalVariable NWNX_Object_GetLocalVariable(object obj, int index) { - string sFunc = "GetLocalVariable"; - - NWNX_PushArgumentInt(index); - NWNX_PushArgumentObject(obj); - NWNX_CallFunction(NWNX_Object, sFunc); - + NWNXPushInt(index); + NWNXPushObject(obj); + NWNXCall(NWNX_Object, "GetLocalVariable"); struct NWNX_Object_LocalVariable var; - var.key = NWNX_GetReturnValueString(); - var.type = NWNX_GetReturnValueInt(); + var.key = NWNXPopString(); + var.type = NWNXPopInt(); return var; } void NWNX_Object_SetPosition(object oObject, vector vPosition, int bUpdateSubareas = TRUE) { - string sFunc = "SetPosition"; - - NWNX_PushArgumentInt(bUpdateSubareas); - NWNX_PushArgumentFloat(vPosition.x); - NWNX_PushArgumentFloat(vPosition.y); - NWNX_PushArgumentFloat(vPosition.z); - NWNX_PushArgumentObject(oObject); - - NWNX_CallFunction(NWNX_Object, sFunc); + NWNXPushInt(bUpdateSubareas); + NWNXPushVector(vPosition); + NWNXPushObject(oObject); + NWNXCall(NWNX_Object, "SetPosition"); } int NWNX_Object_GetCurrentHitPoints(object creature) { - string sFunc = "GetCurrentHitPoints"; - - NWNX_PushArgumentObject(creature); - NWNX_CallFunction(NWNX_Object, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(creature); + NWNXCall(NWNX_Object, "GetCurrentHitPoints"); + return NWNXPopInt(); } void NWNX_Object_SetCurrentHitPoints(object creature, int hp) { - string sFunc = "SetCurrentHitPoints"; - - NWNX_PushArgumentInt(hp); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Object, sFunc); + NWNXPushInt(hp); + NWNXPushObject(creature); + NWNXCall(NWNX_Object, "SetCurrentHitPoints"); } void NWNX_Object_SetMaxHitPoints(object creature, int hp) { - string sFunc = "SetMaxHitPoints"; - - NWNX_PushArgumentInt(hp); - NWNX_PushArgumentObject(creature); - - NWNX_CallFunction(NWNX_Object, sFunc); + NWNXPushInt(hp); + NWNXPushObject(creature); + NWNXCall(NWNX_Object, "SetMaxHitPoints"); } string NWNX_Object_Serialize(object obj) { - string sFunc = "Serialize"; - - NWNX_PushArgumentObject(obj); - - NWNX_CallFunction(NWNX_Object, sFunc); - return NWNX_GetReturnValueString(); + NWNXPushObject(obj); + NWNXCall(NWNX_Object, "Serialize"); + return NWNXPopString(); } object NWNX_Object_Deserialize(string serialized) { - string sFunc = "Deserialize"; - - NWNX_PushArgumentString(serialized); - - NWNX_CallFunction(NWNX_Object, sFunc); - return NWNX_GetReturnValueObject(); + NWNXPushString(serialized); + NWNXCall(NWNX_Object, "Deserialize"); + return NWNXPopObject(); } string NWNX_Object_GetDialogResref(object obj) { - string sFunc = "GetDialogResref"; - - NWNX_PushArgumentObject(obj); - - NWNX_CallFunction(NWNX_Object, sFunc); - return NWNX_GetReturnValueString(); + NWNXPushObject(obj); + NWNXCall(NWNX_Object, "GetDialogResref"); + return NWNXPopString(); } void NWNX_Object_SetDialogResref(object obj, string dialog) { - string sFunc = "SetDialogResref"; - - NWNX_PushArgumentString(dialog); - NWNX_PushArgumentObject(obj); - - NWNX_CallFunction(NWNX_Object, sFunc); + NWNXPushString(dialog); + NWNXPushObject(obj); + NWNXCall(NWNX_Object, "SetDialogResref"); } void NWNX_Object_SetAppearance(object oPlaceable, int nAppearance) { - string sFunc = "SetAppearance"; - - NWNX_PushArgumentInt(nAppearance); - NWNX_PushArgumentObject(oPlaceable); - - NWNX_CallFunction(NWNX_Object, sFunc); + NWNXPushInt(nAppearance); + NWNXPushObject(oPlaceable); + NWNXCall(NWNX_Object, "SetAppearance"); } int NWNX_Object_GetAppearance(object oPlaceable) { - string sFunc = "GetAppearance"; - - NWNX_PushArgumentObject(oPlaceable); - NWNX_CallFunction(NWNX_Object, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(oPlaceable); + NWNXCall(NWNX_Object, "GetAppearance"); + return NWNXPopInt(); } int NWNX_Object_GetHasVisualEffect(object obj, int nVFX) { - string sFunc = "GetHasVisualEffect"; - - NWNX_PushArgumentInt(nVFX); - NWNX_PushArgumentObject(obj); - - NWNX_CallFunction(NWNX_Object, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushInt(nVFX); + NWNXPushObject(obj); + NWNXCall(NWNX_Object, "GetHasVisualEffect"); + return NWNXPopInt(); } int NWNX_Object_GetDamageImmunity(object obj, int damageType) { - string sFunc = "GetDamageImmunity"; - - NWNX_PushArgumentInt(damageType); - NWNX_PushArgumentObject(obj); - - NWNX_CallFunction(NWNX_Object, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushInt(damageType); + NWNXPushObject(obj); + NWNXCall(NWNX_Object, "GetDamageImmunity"); + return NWNXPopInt(); } void NWNX_Object_AddToArea(object obj, object area, vector pos) { - string sFunc = "AddToArea"; - - NWNX_PushArgumentFloat(pos.z); - NWNX_PushArgumentFloat(pos.y); - NWNX_PushArgumentFloat(pos.x); - NWNX_PushArgumentObject(area); - NWNX_PushArgumentObject(obj); - NWNX_CallFunction(NWNX_Object, sFunc); + NWNXPushVector(pos); + NWNXPushObject(area); + NWNXPushObject(obj); + NWNXCall(NWNX_Object, "AddToArea"); } int NWNX_Object_GetPlaceableIsStatic(object obj) { - string sFunc = "GetPlaceableIsStatic"; - - NWNX_PushArgumentObject(obj); - - NWNX_CallFunction(NWNX_Object, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushObject(obj); + NWNXCall(NWNX_Object, "GetPlaceableIsStatic"); + return NWNXPopInt(); } void NWNX_Object_SetPlaceableIsStatic(object obj, int isStatic) { - string sFunc = "SetPlaceableIsStatic"; - - NWNX_PushArgumentInt(isStatic); - NWNX_PushArgumentObject(obj); - - NWNX_CallFunction(NWNX_Object, sFunc); + NWNXPushInt(isStatic); + NWNXPushObject(obj); + NWNXCall(NWNX_Object, "SetPlaceableIsStatic"); } int NWNX_Object_GetAutoRemoveKey(object obj) { - string sFunc = "GetAutoRemoveKey"; - - NWNX_PushArgumentObject(obj); - NWNX_CallFunction(NWNX_Object, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(obj); + NWNXCall(NWNX_Object, "GetAutoRemoveKey"); + return NWNXPopInt(); } void NWNX_Object_SetAutoRemoveKey(object obj, int bRemoveKey) { - string sFunc = "SetAutoRemoveKey"; - - NWNX_PushArgumentInt(bRemoveKey); - NWNX_PushArgumentObject(obj); - - NWNX_CallFunction(NWNX_Object, sFunc); + NWNXPushInt(bRemoveKey); + NWNXPushObject(obj); + NWNXCall(NWNX_Object, "SetAutoRemoveKey"); } string NWNX_Object_GetTriggerGeometry(object oTrigger) { - string sFunc = "GetTriggerGeometry"; - - NWNX_PushArgumentObject(oTrigger); - NWNX_CallFunction(NWNX_Object, sFunc); - - return NWNX_GetReturnValueString(); + NWNXPushObject(oTrigger); + NWNXCall(NWNX_Object, "GetTriggerGeometry"); + return NWNXPopString(); } void NWNX_Object_SetTriggerGeometry(object oTrigger, string sGeometry) { - string sFunc = "SetTriggerGeometry"; - - NWNX_PushArgumentString(sGeometry); - NWNX_PushArgumentObject(oTrigger); - NWNX_CallFunction(NWNX_Object, sFunc); + NWNXPushString(sGeometry); + NWNXPushObject(oTrigger); + NWNXCall(NWNX_Object, "SetTriggerGeometry"); } void NWNX_Object_Export(object oObject, string sFileName, string sAlias = "NWNX") { - string sFunc = "Export"; - - NWNX_PushArgumentString(sAlias); - NWNX_PushArgumentString(sFileName); - NWNX_PushArgumentObject(oObject); - NWNX_CallFunction(NWNX_Object, sFunc); + NWNXPushString(sAlias); + NWNXPushString(sFileName); + NWNXPushObject(oObject); + NWNXCall(NWNX_Object, "Export"); } int NWNX_Object_GetInt(object oObject, string sVarName) { - string sFunc = "GetInt"; - - NWNX_PushArgumentString(sVarName); - NWNX_PushArgumentObject(oObject); - NWNX_CallFunction(NWNX_Object, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushString(sVarName); + NWNXPushObject(oObject); + NWNXCall(NWNX_Object, "GetInt"); + return NWNXPopInt(); } void NWNX_Object_SetInt(object oObject, string sVarName, int nValue, int bPersist) { - string sFunc = "SetInt"; - - NWNX_PushArgumentInt(bPersist); - NWNX_PushArgumentInt(nValue); - NWNX_PushArgumentString(sVarName); - NWNX_PushArgumentObject(oObject); - NWNX_CallFunction(NWNX_Object, sFunc); + NWNXPushInt(bPersist); + NWNXPushInt(nValue); + NWNXPushString(sVarName); + NWNXPushObject(oObject); + NWNXCall(NWNX_Object, "SetInt"); } void NWNX_Object_DeleteInt(object oObject, string sVarName) { - string sFunc = "DeleteInt"; - - NWNX_PushArgumentString(sVarName); - NWNX_PushArgumentObject(oObject); - NWNX_CallFunction(NWNX_Object, sFunc); + NWNXPushString(sVarName); + NWNXPushObject(oObject); + NWNXCall(NWNX_Object, "DeleteInt"); } string NWNX_Object_GetString(object oObject, string sVarName) { - string sFunc = "GetString"; - - NWNX_PushArgumentString(sVarName); - NWNX_PushArgumentObject(oObject); - NWNX_CallFunction(NWNX_Object, sFunc); - - return NWNX_GetReturnValueString(); + NWNXPushString(sVarName); + NWNXPushObject(oObject); + NWNXCall(NWNX_Object, "GetString"); + return NWNXPopString(); } void NWNX_Object_SetString(object oObject, string sVarName, string sValue, int bPersist) { - string sFunc = "SetString"; - - NWNX_PushArgumentInt(bPersist); - NWNX_PushArgumentString(sValue); - NWNX_PushArgumentString(sVarName); - NWNX_PushArgumentObject(oObject); - NWNX_CallFunction(NWNX_Object, sFunc); + NWNXPushInt(bPersist); + NWNXPushString(sValue); + NWNXPushString(sVarName); + NWNXPushObject(oObject); + NWNXCall(NWNX_Object, "SetString"); } void NWNX_Object_DeleteString(object oObject, string sVarName) { - string sFunc = "DeleteString"; - - NWNX_PushArgumentString(sVarName); - NWNX_PushArgumentObject(oObject); - NWNX_CallFunction(NWNX_Object, sFunc); + NWNXPushString(sVarName); + NWNXPushObject(oObject); + NWNXCall(NWNX_Object, "DeleteString"); } float NWNX_Object_GetFloat(object oObject, string sVarName) { - string sFunc = "GetFloat"; - - NWNX_PushArgumentString(sVarName); - NWNX_PushArgumentObject(oObject); - NWNX_CallFunction(NWNX_Object, sFunc); - - return NWNX_GetReturnValueFloat(); + NWNXPushString(sVarName); + NWNXPushObject(oObject); + NWNXCall(NWNX_Object, "GetFloat"); + return NWNXPopFloat(); } void NWNX_Object_SetFloat(object oObject, string sVarName, float fValue, int bPersist) { - string sFunc = "SetFloat"; - - NWNX_PushArgumentInt(bPersist); - NWNX_PushArgumentFloat(fValue); - NWNX_PushArgumentString(sVarName); - NWNX_PushArgumentObject(oObject); - NWNX_CallFunction(NWNX_Object, sFunc); + NWNXPushInt(bPersist); + NWNXPushFloat(fValue); + NWNXPushString(sVarName); + NWNXPushObject(oObject); + NWNXCall(NWNX_Object, "SetFloat"); } void NWNX_Object_DeleteFloat(object oObject, string sVarName) { - string sFunc = "DeleteFloat"; - - NWNX_PushArgumentString(sVarName); - NWNX_PushArgumentObject(oObject); - NWNX_CallFunction(NWNX_Object, sFunc); + NWNXPushString(sVarName); + NWNXPushObject(oObject); + NWNXCall(NWNX_Object, "DeleteFloat"); } void NWNX_Object_DeleteVarRegex(object oObject, string sRegex) { - string sFunc = "DeleteVarRegex"; - - NWNX_PushArgumentString(sRegex); - NWNX_PushArgumentObject(oObject); - NWNX_CallFunction(NWNX_Object, sFunc); + NWNXPushString(sRegex); + NWNXPushObject(oObject); + NWNXCall(NWNX_Object, "DeleteVarRegex"); } int NWNX_Object_GetPositionIsInTrigger(object oTrigger, vector vPosition) { - string sFunc = "GetPositionIsInTrigger"; - - NWNX_PushArgumentFloat(vPosition.z); - NWNX_PushArgumentFloat(vPosition.y); - NWNX_PushArgumentFloat(vPosition.x); - NWNX_PushArgumentObject(oTrigger); - NWNX_CallFunction(NWNX_Object, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushVector(vPosition); + NWNXPushObject(oTrigger); + NWNXCall(NWNX_Object, "GetPositionIsInTrigger"); + return NWNXPopInt(); } int NWNX_Object_GetInternalObjectType(object oObject) { - string sFunc = "GetInternalObjectType"; - - NWNX_PushArgumentObject(oObject); - NWNX_CallFunction(NWNX_Object, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(oObject); + NWNXCall(NWNX_Object, "GetInternalObjectType"); + return NWNXPopInt(); } int NWNX_Object_AcquireItem(object oObject, object oItem) { - string sFunc = "AcquireItem"; - - NWNX_PushArgumentObject(oItem); - NWNX_PushArgumentObject(oObject); - NWNX_CallFunction(NWNX_Object, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(oItem); + NWNXPushObject(oObject); + NWNXCall(NWNX_Object, "AcquireItem"); + return NWNXPopInt(); } void NWNX_Object_ClearSpellEffectsOnOthers(object oObject) { - string sFunc = "ClearSpellEffectsOnOthers"; - - NWNX_PushArgumentObject(oObject); - NWNX_CallFunction(NWNX_Object, sFunc); + NWNXPushObject(oObject); + NWNXCall(NWNX_Object, "ClearSpellEffectsOnOthers"); } string NWNX_Object_PeekUUID(object oObject) { - string sFunc = "PeekUUID"; - - NWNX_PushArgumentObject(oObject); - NWNX_CallFunction(NWNX_Object, sFunc); - - return NWNX_GetReturnValueString(); + NWNXPushObject(oObject); + NWNXCall(NWNX_Object, "PeekUUID"); + return NWNXPopString(); } int NWNX_Object_GetDoorHasVisibleModel(object oDoor) { - string sFunc = "GetDoorHasVisibleModel"; - - NWNX_PushArgumentObject(oDoor); - NWNX_CallFunction(NWNX_Object, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(oDoor); + NWNXCall(NWNX_Object, "GetDoorHasVisibleModel"); + return NWNXPopInt(); } int NWNX_Object_GetIsDestroyable(object oObject) { - string sFunc = "GetIsDestroyable"; - - NWNX_PushArgumentObject(oObject); - NWNX_CallFunction(NWNX_Object, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(oObject); + NWNXCall(NWNX_Object, "GetIsDestroyable"); + return NWNXPopInt(); } int NWNX_Object_DoSpellImmunity(object oDefender, object oCaster, int nSpellId=-1) { - string sFunc = "DoSpellImmunity"; - NWNX_PushArgumentInt(nSpellId); - NWNX_PushArgumentObject(oCaster); - NWNX_PushArgumentObject(oDefender); - NWNX_CallFunction(NWNX_Object, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushInt(nSpellId); + NWNXPushObject(oCaster); + NWNXPushObject(oDefender); + NWNXCall(NWNX_Object, "DoSpellImmunity"); + return NWNXPopInt(); } int NWNX_Object_DoSpellLevelAbsorption(object oDefender, object oCaster, int nSpellId=-1, int nSpellLevel=-1, int nSpellSchool=-1) { - string sFunc = "DoSpellLevelAbsorption"; - NWNX_PushArgumentInt(nSpellSchool); - NWNX_PushArgumentInt(nSpellLevel); - NWNX_PushArgumentInt(nSpellId); - NWNX_PushArgumentObject(oCaster); - NWNX_PushArgumentObject(oDefender); - NWNX_CallFunction(NWNX_Object, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushInt(nSpellSchool); + NWNXPushInt(nSpellLevel); + NWNXPushInt(nSpellId); + NWNXPushObject(oCaster); + NWNXPushObject(oDefender); + NWNXCall(NWNX_Object, "DoSpellLevelAbsorption"); + return NWNXPopInt(); } void NWNX_Object_SetHasInventory(object obj, int bHasInventory) { - string sFunc = "SetHasInventory"; - - NWNX_PushArgumentInt(bHasInventory); - NWNX_PushArgumentObject(obj); - - NWNX_CallFunction(NWNX_Object, sFunc); + NWNXPushInt(bHasInventory); + NWNXPushObject(obj); + NWNXCall(NWNX_Object, "SetHasInventory"); } int NWNX_Object_GetCurrentAnimation(object oObject) { - string sFunc = "GetCurrentAnimation"; - - NWNX_PushArgumentObject(oObject); - NWNX_CallFunction(NWNX_Object, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(oObject); + NWNXCall(NWNX_Object, "GetCurrentAnimation"); + return NWNXPopInt(); } int NWNX_Object_GetAILevel(object oObject) { - string sFunc = "GetAILevel"; - - NWNX_PushArgumentObject(oObject); - NWNX_CallFunction(NWNX_Object, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(oObject); + NWNXCall(NWNX_Object, "GetAILevel"); + return NWNXPopInt(); } void NWNX_Object_SetAILevel(object oObject, int nLevel) { - string sFunc = "SetAILevel"; - - NWNX_PushArgumentInt(nLevel); - NWNX_PushArgumentObject(oObject); - - NWNX_CallFunction(NWNX_Object, sFunc); + NWNXPushInt(nLevel); + NWNXPushObject(oObject); + NWNXCall(NWNX_Object, "SetAILevel"); } string NWNX_Object_GetMapNote(object oObject, int nID = 0, int nGender = 0) { - string sFunc = "GetMapNote"; - - NWNX_PushArgumentInt(nGender); - NWNX_PushArgumentInt(nID); - NWNX_PushArgumentObject(oObject); - NWNX_CallFunction(NWNX_Object, sFunc); - - return NWNX_GetReturnValueString(); + NWNXPushInt(nGender); + NWNXPushInt(nID); + NWNXPushObject(oObject); + NWNXCall(NWNX_Object, "GetMapNote"); + return NWNXPopString(); } void NWNX_Object_SetMapNote(object oObject, string sMapNote, int nID = 0, int nGender = 0) { - string sFunc = "SetMapNote"; - - NWNX_PushArgumentInt(nGender); - NWNX_PushArgumentInt(nID); - NWNX_PushArgumentString(sMapNote); - NWNX_PushArgumentObject(oObject); - NWNX_CallFunction(NWNX_Object, sFunc); + NWNXPushInt(nGender); + NWNXPushInt(nID); + NWNXPushString(sMapNote); + NWNXPushObject(oObject); + NWNXCall(NWNX_Object, "SetMapNote"); } int NWNX_Object_GetLastSpellCastFeat(object oObject) { - string sFunc = "GetLastSpellCastFeat"; - - NWNX_PushArgumentObject(oObject); - NWNX_CallFunction(NWNX_Object, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(oObject); + NWNXCall(NWNX_Object, "GetLastSpellCastFeat"); + return NWNXPopInt(); } void NWNX_Object_SetLastTriggered(object oObject, object oLast) { - string sFunc = "SetLastTriggered"; - - NWNX_PushArgumentObject(oLast); - NWNX_PushArgumentObject(oObject); - - NWNX_CallFunction(NWNX_Object, sFunc); + NWNXPushObject(oLast); + NWNXPushObject(oObject); + NWNXCall(NWNX_Object, "SetLastTriggered"); } float NWNX_Object_GetAoEObjectDurationRemaining(object oAoE) { - string sFunc = "GetAoEObjectDurationRemaining"; - - NWNX_PushArgumentObject(oAoE); - NWNX_CallFunction(NWNX_Object, sFunc); - - return NWNX_GetReturnValueFloat(); + NWNXPushObject(oAoE); + NWNXCall(NWNX_Object, "GetAoEObjectDurationRemaining"); + return NWNXPopFloat(); } void NWNX_Object_SetConversationPrivate(object oObject, int bPrivate) { - string sFunc = "SetConversationPrivate"; - - NWNX_PushArgumentInt(bPrivate); - NWNX_PushArgumentObject(oObject); - - NWNX_CallFunction(NWNX_Object, sFunc); + NWNXPushInt(bPrivate); + NWNXPushObject(oObject); + NWNXCall(NWNX_Object, "SetConversationPrivate"); } void NWNX_Object_SetAoEObjectRadius(object oAoE, float fRadius) { - string sFunc = "SetAoEObjectRadius"; - - NWNX_PushArgumentFloat(fRadius); - NWNX_PushArgumentObject(oAoE); - NWNX_CallFunction(NWNX_Object, sFunc); + NWNXPushFloat(fRadius); + NWNXPushObject(oAoE); + NWNXCall(NWNX_Object, "SetAoEObjectRadius"); } float NWNX_Object_GetAoEObjectRadius(object oAoE) { - string sFunc = "GetAoEObjectRadius"; - - NWNX_PushArgumentObject(oAoE); - NWNX_CallFunction(NWNX_Object, sFunc); - - return NWNX_GetReturnValueFloat(); + NWNXPushObject(oAoE); + NWNXCall(NWNX_Object, "GetAoEObjectRadius"); + return NWNXPopFloat(); } int NWNX_Object_GetLastSpellCastSpontaneous(object oObject) { - string sFunc = "GetLastSpellCastSpontaneous"; - - NWNX_PushArgumentObject(oObject); - NWNX_CallFunction(NWNX_Object, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(oObject); + NWNXCall(NWNX_Object, "GetLastSpellCastSpontaneous"); + return NWNXPopInt(); } int NWNX_Object_GetLastSpellCastDomainLevel(object oObject) { - string sFunc = "GetLastSpellCastDomainLevel"; - - NWNX_PushArgumentObject(oObject); - NWNX_CallFunction(NWNX_Object, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(oObject); + NWNXCall(NWNX_Object, "GetLastSpellCastDomainLevel"); + return NWNXPopInt(); } void NWNX_Object_ForceAssignUUID(object oObject, string sUUID) { - string sFunc = "ForceAssignUUID"; - - NWNX_PushArgumentString(sUUID); - NWNX_PushArgumentObject(oObject); - NWNX_CallFunction(NWNX_Object, sFunc); + NWNXPushString(sUUID); + NWNXPushObject(oObject); + NWNXCall(NWNX_Object, "ForceAssignUUID"); } int NWNX_Object_GetInventoryItemCount(object oObject) { - string sFunc = "GetInventoryItemCount"; - - NWNX_PushArgumentObject(oObject); - NWNX_CallFunction(NWNX_Object, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushObject(oObject); + NWNXCall(NWNX_Object, "GetInventoryItemCount"); + return NWNXPopInt(); } void NWNX_Object_OverrideSpellProjectileVFX(object oCreature, int nProjectileType = -1, int nProjectilePathType = -1, int nSpellID = -1, int bPersist = FALSE) { - string sFunc = "OverrideSpellProjectileVFX"; - - NWNX_PushArgumentInt(bPersist); - NWNX_PushArgumentInt(nSpellID); - NWNX_PushArgumentInt(nProjectilePathType); - NWNX_PushArgumentInt(nProjectileType); - NWNX_PushArgumentObject(oCreature); - NWNX_CallFunction(NWNX_Object, sFunc); + NWNXPushInt(bPersist); + NWNXPushInt(nSpellID); + NWNXPushInt(nProjectilePathType); + NWNXPushInt(nProjectileType); + NWNXPushObject(oCreature); + NWNXCall(NWNX_Object, "OverrideSpellProjectileVFX"); } int NWNX_Object_GetLastSpellInstant() { - string sFunc = "GetLastSpellInstant"; - NWNX_CallFunction(NWNX_Object, sFunc); - return NWNX_GetReturnValueInt(); + NWNXCall(NWNX_Object, "GetLastSpellInstant"); + return NWNXPopInt(); } void NWNX_Object_SetTrapCreator(object oObject, object oCreator) { - string sFunc = "SetTrapCreator"; - NWNX_PushArgumentObject(oCreator); - NWNX_PushArgumentObject(oObject); - NWNX_CallFunction(NWNX_Object, sFunc); + NWNXPushObject(oCreator); + NWNXPushObject(oObject); + NWNXCall(NWNX_Object, "SetTrapCreator"); } string NWNX_Object_GetLocalizedName(object oObject, int nLanguage, int nGender = 0) { string sFunc = "GetLocalizedName"; - NWNX_PushArgumentInt(nGender); - NWNX_PushArgumentInt(nLanguage); - NWNX_PushArgumentObject(oObject); + NWNXPushInt(nGender); + NWNXPushInt(nLanguage); + NWNXPushObject(oObject); - NWNX_CallFunction(NWNX_Object, sFunc); - return NWNX_GetReturnValueString(); + NWNXCall(NWNX_Object, sFunc); + return NWNXPopString(); } void NWNX_Object_SetLocalizedName(object oObject, string sName, int nLanguage, int nGender = 0) { string sFunc = "SetLocalizedName"; - NWNX_PushArgumentInt(nGender); - NWNX_PushArgumentInt(nLanguage); - NWNX_PushArgumentString(sName); - NWNX_PushArgumentObject(oObject); + NWNXPushInt(nGender); + NWNXPushInt(nLanguage); + NWNXPushString(sName); + NWNXPushObject(oObject); - NWNX_CallFunction(NWNX_Object, sFunc); + NWNXCall(NWNX_Object, sFunc); } diff --git a/_module/nss/nwnx_player.nss b/_module/nss/nwnx_player.nss index 3f4ab659..95d0bcd9 100644 --- a/_module/nss/nwnx_player.nss +++ b/_module/nss/nwnx_player.nss @@ -2,7 +2,6 @@ /// @brief Functions exposing additional player properties. /// @{ /// @file nwnx_player.nss -#include "nwnx" const string NWNX_Player = "NWNX_Player"; ///< @private @@ -458,22 +457,16 @@ void NWNX_Player_ReloadColorPalettes(object oPlayer); void NWNX_Player_ForcePlaceableExamineWindow(object player, object placeable) { - string sFunc = "ForcePlaceableExamineWindow"; - - NWNX_PushArgumentObject(placeable); - NWNX_PushArgumentObject(player); - - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushObject(placeable); + NWNXPushObject(player); + NWNXCall(NWNX_Player, "ForcePlaceableExamineWindow"); } void NWNX_Player_ForcePlaceableInventoryWindow(object player, object placeable) { - string sFunc = "ForcePlaceableInventoryWindow"; - - NWNX_PushArgumentObject(placeable); - NWNX_PushArgumentObject(player); - - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushObject(placeable); + NWNXPushObject(player); + NWNXCall(NWNX_Player, "ForcePlaceableInventoryWindow"); } void NWNX_Player_INTERNAL_StopGuiTimingBar(object player, string script = "", int id = -1) ///< @private @@ -482,17 +475,12 @@ void NWNX_Player_INTERNAL_StopGuiTimingBar(object player, string script = "", in // Either the timing event was never started, or it already finished. if (activeId == 0) return; - // If id != -1, we ended up here through DelayCommand. Make sure it's for the right ID if (id != -1 && id != activeId) return; - DeleteLocalInt(player, "NWNX_PLAYER_GUI_TIMING_ACTIVE"); - - string sFunc = "StopGuiTimingBar"; - NWNX_PushArgumentObject(player); - NWNX_CallFunction(NWNX_Player, sFunc); - + NWNXPushObject(player); + NWNXCall(NWNX_Player, "StopGuiTimingBar"); if(script != "") { ExecuteScript(script, player); @@ -503,18 +491,13 @@ void NWNX_Player_StartGuiTimingBar(object player, float seconds, string script = { if (GetLocalInt(player, "NWNX_PLAYER_GUI_TIMING_ACTIVE")) return; - - string sFunc = "StartGuiTimingBar"; - NWNX_PushArgumentInt(type); - NWNX_PushArgumentFloat(seconds); - NWNX_PushArgumentObject(player); - - NWNX_CallFunction(NWNX_Player, sFunc); - + NWNXPushInt(type); + NWNXPushFloat(seconds); + NWNXPushObject(player); + NWNXCall(NWNX_Player, "StartGuiTimingBar"); int id = GetLocalInt(player, "NWNX_PLAYER_GUI_TIMING_ID") + 1; SetLocalInt(player, "NWNX_PLAYER_GUI_TIMING_ACTIVE", id); SetLocalInt(player, "NWNX_PLAYER_GUI_TIMING_ID", id); - DelayCommand(seconds, NWNX_Player_INTERNAL_StopGuiTimingBar(player, script, id)); } @@ -525,638 +508,471 @@ void NWNX_Player_StopGuiTimingBar(object player, string script = "") void NWNX_Player_SetAlwaysWalk(object player, int bWalk=TRUE) { - string sFunc = "SetAlwaysWalk"; - - NWNX_PushArgumentInt(bWalk); - NWNX_PushArgumentObject(player); - - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushInt(bWalk); + NWNXPushObject(player); + NWNXCall(NWNX_Player, "SetAlwaysWalk"); } struct NWNX_Player_QuickBarSlot NWNX_Player_GetQuickBarSlot(object player, int slot) { - string sFunc = "GetQuickBarSlot"; struct NWNX_Player_QuickBarSlot qbs; - - NWNX_PushArgumentInt(slot); - NWNX_PushArgumentObject(player); - NWNX_CallFunction(NWNX_Player, sFunc); - - qbs.oAssociate = NWNX_GetReturnValueObject(); - qbs.nAssociateType = NWNX_GetReturnValueInt(); - qbs.nDomainLevel = NWNX_GetReturnValueInt(); - qbs.nMetaType = NWNX_GetReturnValueInt(); - qbs.nINTParam1 = NWNX_GetReturnValueInt(); - qbs.sToolTip = NWNX_GetReturnValueString(); - qbs.sCommandLine = NWNX_GetReturnValueString(); - qbs.sCommandLabel = NWNX_GetReturnValueString(); - qbs.sResRef = NWNX_GetReturnValueString(); - qbs.nMultiClass = NWNX_GetReturnValueInt(); - qbs.nObjectType = NWNX_GetReturnValueInt(); - qbs.oSecondaryItem = NWNX_GetReturnValueObject(); - qbs.oItem = NWNX_GetReturnValueObject(); - + NWNXPushInt(slot); + NWNXPushObject(player); + NWNXCall(NWNX_Player, "GetQuickBarSlot"); + qbs.oAssociate = NWNXPopObject(); + qbs.nAssociateType = NWNXPopInt(); + qbs.nDomainLevel = NWNXPopInt(); + qbs.nMetaType = NWNXPopInt(); + qbs.nINTParam1 = NWNXPopInt(); + qbs.sToolTip = NWNXPopString(); + qbs.sCommandLine = NWNXPopString(); + qbs.sCommandLabel = NWNXPopString(); + qbs.sResRef = NWNXPopString(); + qbs.nMultiClass = NWNXPopInt(); + qbs.nObjectType = NWNXPopInt(); + qbs.oSecondaryItem = NWNXPopObject(); + qbs.oItem = NWNXPopObject(); return qbs; } void NWNX_Player_SetQuickBarSlot(object player, int slot, struct NWNX_Player_QuickBarSlot qbs) { - string sFunc = "SetQuickBarSlot"; - - NWNX_PushArgumentObject(qbs.oItem); - NWNX_PushArgumentObject(qbs.oSecondaryItem); - NWNX_PushArgumentInt(qbs.nObjectType); - NWNX_PushArgumentInt(qbs.nMultiClass); - NWNX_PushArgumentString(qbs.sResRef); - NWNX_PushArgumentString(qbs.sCommandLabel); - NWNX_PushArgumentString(qbs.sCommandLine); - NWNX_PushArgumentString(qbs.sToolTip); - NWNX_PushArgumentInt(qbs.nINTParam1); - NWNX_PushArgumentInt(qbs.nMetaType); - NWNX_PushArgumentInt(qbs.nDomainLevel); - NWNX_PushArgumentInt(qbs.nAssociateType); - NWNX_PushArgumentObject(qbs.oAssociate); - - NWNX_PushArgumentInt(slot); - NWNX_PushArgumentObject(player); - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushObject(qbs.oItem); + NWNXPushObject(qbs.oSecondaryItem); + NWNXPushInt(qbs.nObjectType); + NWNXPushInt(qbs.nMultiClass); + NWNXPushString(qbs.sResRef); + NWNXPushString(qbs.sCommandLabel); + NWNXPushString(qbs.sCommandLine); + NWNXPushString(qbs.sToolTip); + NWNXPushInt(qbs.nINTParam1); + NWNXPushInt(qbs.nMetaType); + NWNXPushInt(qbs.nDomainLevel); + NWNXPushInt(qbs.nAssociateType); + NWNXPushObject(qbs.oAssociate); + NWNXPushInt(slot); + NWNXPushObject(player); + NWNXCall(NWNX_Player, "SetQuickBarSlot"); } string NWNX_Player_GetBicFileName(object player) { - string sFunc = "GetBicFileName"; - - NWNX_PushArgumentObject(player); - NWNX_CallFunction(NWNX_Player, sFunc); - return NWNX_GetReturnValueString(); + NWNXPushObject(player); + NWNXCall(NWNX_Player, "GetBicFileName"); + return NWNXPopString(); } void NWNX_Player_ShowVisualEffect(object player, int effectId, vector position, float scale=1.0f, vector translate=[], vector rotate=[]) { - string sFunc = "ShowVisualEffect"; - - NWNX_PushArgumentFloat(rotate.x); - NWNX_PushArgumentFloat(rotate.y); - NWNX_PushArgumentFloat(rotate.z); - NWNX_PushArgumentFloat(translate.x); - NWNX_PushArgumentFloat(translate.y); - NWNX_PushArgumentFloat(translate.z); - NWNX_PushArgumentFloat(scale); - NWNX_PushArgumentFloat(position.x); - NWNX_PushArgumentFloat(position.y); - NWNX_PushArgumentFloat(position.z); - NWNX_PushArgumentInt(effectId); - NWNX_PushArgumentObject(player); - - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushVector(rotate); + NWNXPushVector(translate); + NWNXPushFloat(scale); + NWNXPushVector(position); + NWNXPushInt(effectId); + NWNXPushObject(player); + NWNXCall(NWNX_Player, "ShowVisualEffect"); } void NWNX_Player_MusicBackgroundChangeDay(object player, int track) { - string sFunc = "ChangeBackgroundMusic"; - - NWNX_PushArgumentInt(track); - NWNX_PushArgumentInt(TRUE); - NWNX_PushArgumentObject(player); - - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushInt(track); + NWNXPushInt(TRUE); + NWNXPushObject(player); + NWNXCall(NWNX_Player, "ChangeBackgroundMusic"); } void NWNX_Player_MusicBackgroundChangeNight(object player, int track) { - string sFunc = "ChangeBackgroundMusic"; - - NWNX_PushArgumentInt(track); - NWNX_PushArgumentInt(FALSE); - NWNX_PushArgumentObject(player); - - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushInt(track); + NWNXPushInt(FALSE); + NWNXPushObject(player); + NWNXCall(NWNX_Player, "ChangeBackgroundMusic"); } void NWNX_Player_MusicBackgroundStart(object player) { - string sFunc = "PlayBackgroundMusic"; - - NWNX_PushArgumentInt(TRUE); - NWNX_PushArgumentObject(player); - - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushInt(TRUE); + NWNXPushObject(player); + NWNXCall(NWNX_Player, "PlayBackgroundMusic"); } void NWNX_Player_MusicBackgroundStop(object player) { - string sFunc = "PlayBackgroundMusic"; - - NWNX_PushArgumentInt(FALSE); - NWNX_PushArgumentObject(player); - - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushInt(FALSE); + NWNXPushObject(player); + NWNXCall(NWNX_Player, "PlayBackgroundMusic"); } void NWNX_Player_MusicBattleChange(object player, int track) { - string sFunc = "ChangeBattleMusic"; - - NWNX_PushArgumentInt(track); - NWNX_PushArgumentObject(player); - - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushInt(track); + NWNXPushObject(player); + NWNXCall(NWNX_Player, "ChangeBattleMusic"); } void NWNX_Player_MusicBattleStart(object player) { - string sFunc = "PlayBattleMusic"; - - NWNX_PushArgumentInt(TRUE); - NWNX_PushArgumentObject(player); - - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushInt(TRUE); + NWNXPushObject(player); + NWNXCall(NWNX_Player, "PlayBattleMusic"); } void NWNX_Player_MusicBattleStop(object player) { - string sFunc = "PlayBattleMusic"; - - NWNX_PushArgumentInt(FALSE); - NWNX_PushArgumentObject(player); - - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushInt(FALSE); + NWNXPushObject(player); + NWNXCall(NWNX_Player, "PlayBattleMusic"); } void NWNX_Player_PlaySound(object player, string sound, object target = OBJECT_INVALID) { - string sFunc = "PlaySound"; - - NWNX_PushArgumentObject(target); - NWNX_PushArgumentString(sound); - NWNX_PushArgumentObject(player); - - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushObject(target); + NWNXPushString(sound); + NWNXPushObject(player); + NWNXCall(NWNX_Player, "PlaySound"); } void NWNX_Player_SetPlaceableUsable(object player, object placeable, int usable) { - string sFunc = "SetPlaceableUsable"; - - NWNX_PushArgumentInt(usable); - NWNX_PushArgumentObject(placeable); - NWNX_PushArgumentObject(player); - - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushInt(usable); + NWNXPushObject(placeable); + NWNXPushObject(player); + NWNXCall(NWNX_Player, "SetPlaceableUsable"); } void NWNX_Player_SetRestDuration(object player, int duration) { - string sFunc = "SetRestDuration"; - - NWNX_PushArgumentInt(duration); - NWNX_PushArgumentObject(player); - - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushInt(duration); + NWNXPushObject(player); + NWNXCall(NWNX_Player, "SetRestDuration"); } void NWNX_Player_ApplyInstantVisualEffectToObject(object player, object target, int visualeffect, float scale=1.0f, vector translate=[], vector rotate=[]) { - string sFunc = "ApplyInstantVisualEffectToObject"; - - NWNX_PushArgumentFloat(rotate.z); - NWNX_PushArgumentFloat(rotate.y); - NWNX_PushArgumentFloat(rotate.x); - NWNX_PushArgumentFloat(translate.z); - NWNX_PushArgumentFloat(translate.y); - NWNX_PushArgumentFloat(translate.x); - NWNX_PushArgumentFloat(scale); - NWNX_PushArgumentInt(visualeffect); - NWNX_PushArgumentObject(target); - NWNX_PushArgumentObject(player); - - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushVector(rotate); + NWNXPushVector(translate); + NWNXPushFloat(scale); + NWNXPushInt(visualeffect); + NWNXPushObject(target); + NWNXPushObject(player); + NWNXCall(NWNX_Player, "ApplyInstantVisualEffectToObject"); } void NWNX_Player_UpdateCharacterSheet(object player) { - string sFunc = "UpdateCharacterSheet"; - - NWNX_PushArgumentObject(player); - - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushObject(player); + NWNXCall(NWNX_Player, "UpdateCharacterSheet"); } void NWNX_Player_OpenInventory(object player, object target, int open = TRUE) { - string sFunc = "OpenInventory"; - - NWNX_PushArgumentInt(open); - NWNX_PushArgumentObject(target); - NWNX_PushArgumentObject(player); - - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushInt(open); + NWNXPushObject(target); + NWNXPushObject(player); + NWNXCall(NWNX_Player, "OpenInventory"); } string NWNX_Player_GetAreaExplorationState(object player, object area) { - string sFunc = "GetAreaExplorationState"; - - NWNX_PushArgumentObject(area); - NWNX_PushArgumentObject(player); - - NWNX_CallFunction(NWNX_Player, sFunc); - return NWNX_GetReturnValueString(); + NWNXPushObject(area); + NWNXPushObject(player); + NWNXCall(NWNX_Player, "GetAreaExplorationState"); + return NWNXPopString(); } void NWNX_Player_SetAreaExplorationState(object player, object area, string str) { - string sFunc = "SetAreaExplorationState"; - - NWNX_PushArgumentString(str); - NWNX_PushArgumentObject(area); - NWNX_PushArgumentObject(player); - - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushString(str); + NWNXPushObject(area); + NWNXPushObject(player); + NWNXCall(NWNX_Player, "SetAreaExplorationState"); } void NWNX_Player_SetRestAnimation(object oPlayer, int nAnimation) { - string sFunc = "SetRestAnimation"; - - NWNX_PushArgumentInt(nAnimation); - NWNX_PushArgumentObject(oPlayer); - - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushInt(nAnimation); + NWNXPushObject(oPlayer); + NWNXCall(NWNX_Player, "SetRestAnimation"); } void NWNX_Player_SetObjectVisualTransformOverride(object oPlayer, object oObject, int nTransform, float fValue) { - string sFunc = "SetObjectVisualTransformOverride"; - - NWNX_PushArgumentFloat(fValue); - NWNX_PushArgumentInt(nTransform); - NWNX_PushArgumentObject(oObject); - NWNX_PushArgumentObject(oPlayer); - - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushFloat(fValue); + NWNXPushInt(nTransform); + NWNXPushObject(oObject); + NWNXPushObject(oPlayer); + NWNXCall(NWNX_Player, "SetObjectVisualTransformOverride"); } void NWNX_Player_ApplyLoopingVisualEffectToObject(object player, object target, int visualeffect) { - string sFunc = "ApplyLoopingVisualEffectToObject"; - - NWNX_PushArgumentInt(visualeffect); - NWNX_PushArgumentObject(target); - NWNX_PushArgumentObject(player); - - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushInt(visualeffect); + NWNXPushObject(target); + NWNXPushObject(player); + NWNXCall(NWNX_Player, "ApplyLoopingVisualEffectToObject"); } void NWNX_Player_SetPlaceableNameOverride(object player, object placeable, string name) { - string sFunc = "SetPlaceableNameOverride"; - - NWNX_PushArgumentString(name); - NWNX_PushArgumentObject(placeable); - NWNX_PushArgumentObject(player); - - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushString(name); + NWNXPushObject(placeable); + NWNXPushObject(player); + NWNXCall(NWNX_Player, "SetPlaceableNameOverride"); } int NWNX_Player_GetQuestCompleted(object player, string sQuestName) { - string sFunc = "GetQuestCompleted"; - - NWNX_PushArgumentString(sQuestName); - NWNX_PushArgumentObject(player); - - NWNX_CallFunction(NWNX_Player, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushString(sQuestName); + NWNXPushObject(player); + NWNXCall(NWNX_Player, "GetQuestCompleted"); + return NWNXPopInt(); } void NWNX_Player_SetPersistentLocation(string sCDKeyOrCommunityName, string sBicFileName, object oWP, int bFirstConnectOnly = TRUE) { - string sFunc = "SetPersistentLocation"; - - NWNX_PushArgumentInt(bFirstConnectOnly); - NWNX_PushArgumentObject(oWP); - NWNX_PushArgumentString(sBicFileName); - NWNX_PushArgumentString(sCDKeyOrCommunityName); - - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushInt(bFirstConnectOnly); + NWNXPushObject(oWP); + NWNXPushString(sBicFileName); + NWNXPushString(sCDKeyOrCommunityName); + NWNXCall(NWNX_Player, "SetPersistentLocation"); } void NWNX_Player_UpdateItemName(object oPlayer, object oItem) { - string sFunc = "UpdateItemName"; - - NWNX_PushArgumentObject(oItem); - NWNX_PushArgumentObject(oPlayer); - - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushObject(oItem); + NWNXPushObject(oPlayer); + NWNXCall(NWNX_Player, "UpdateItemName"); } int NWNX_Player_PossessCreature(object oPossessor, object oPossessed, int bMindImmune = TRUE, int bCreateDefaultQB = FALSE) { - string sFunc = "PossessCreature"; - - NWNX_PushArgumentInt(bCreateDefaultQB); - NWNX_PushArgumentInt(bMindImmune); - NWNX_PushArgumentObject(oPossessed); - NWNX_PushArgumentObject(oPossessor); - - NWNX_CallFunction(NWNX_Player, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushInt(bCreateDefaultQB); + NWNXPushInt(bMindImmune); + NWNXPushObject(oPossessed); + NWNXPushObject(oPossessor); + NWNXCall(NWNX_Player, "PossessCreature"); + return NWNXPopInt(); } int NWNX_Player_GetPlatformId(object oPlayer) { - string sFunc = "GetPlatformId"; - - NWNX_PushArgumentObject(oPlayer); - - NWNX_CallFunction(NWNX_Player, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushObject(oPlayer); + NWNXCall(NWNX_Player, "GetPlatformId"); + return NWNXPopInt(); } int NWNX_Player_GetLanguage(object oPlayer) { - string sFunc = "GetLanguage"; - - NWNX_PushArgumentObject(oPlayer); - - NWNX_CallFunction(NWNX_Player, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushObject(oPlayer); + NWNXCall(NWNX_Player, "GetLanguage"); + return NWNXPopInt(); } void NWNX_Player_SetResManOverride(object oPlayer, int nResType, string sOldResName, string sNewResName) { - string sFunc = "SetResManOverride"; - - NWNX_PushArgumentString(sNewResName); - NWNX_PushArgumentString(sOldResName); - NWNX_PushArgumentInt(nResType); - NWNX_PushArgumentObject(oPlayer); - - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushString(sNewResName); + NWNXPushString(sOldResName); + NWNXPushInt(nResType); + NWNXPushObject(oPlayer); + NWNXCall(NWNX_Player, "SetResManOverride"); } void NWNX_Player_SetCustomToken(object oPlayer, int nCustomTokenNumber, string sTokenValue) { - string sFunc = "SetCustomToken"; - - NWNX_PushArgumentString(sTokenValue); - NWNX_PushArgumentInt(nCustomTokenNumber); - NWNX_PushArgumentObject(oPlayer); - - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushString(sTokenValue); + NWNXPushInt(nCustomTokenNumber); + NWNXPushObject(oPlayer); + NWNXCall(NWNX_Player, "SetCustomToken"); } void NWNX_Player_SetCreatureNameOverride(object oPlayer, object oCreature, string sName) { - string sFunc = "SetCreatureNameOverride"; - - NWNX_PushArgumentString(sName); - NWNX_PushArgumentObject(oCreature); - NWNX_PushArgumentObject(oPlayer); - - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushString(sName); + NWNXPushObject(oCreature); + NWNXPushObject(oPlayer); + NWNXCall(NWNX_Player, "SetCreatureNameOverride"); } void NWNX_Player_FloatingTextStringOnCreature(object oPlayer, object oCreature, string sText, int bChatWindow = TRUE) { - string sFunc = "FloatingTextStringOnCreature"; - - NWNX_PushArgumentInt(bChatWindow); - NWNX_PushArgumentString(sText); - NWNX_PushArgumentObject(oCreature); - NWNX_PushArgumentObject(oPlayer); - - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushInt(bChatWindow); + NWNXPushString(sText); + NWNXPushObject(oCreature); + NWNXPushObject(oPlayer); + NWNXCall(NWNX_Player, "FloatingTextStringOnCreature"); } void NWNX_Player_ToggleDM(object oPlayer, int bIsDM) { - string sFunc = "ToggleDM"; - - NWNX_PushArgumentInt(bIsDM); - NWNX_PushArgumentObject(oPlayer); - - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushInt(bIsDM); + NWNXPushObject(oPlayer); + NWNXCall(NWNX_Player, "ToggleDM"); } void NWNX_Player_SetObjectMouseCursorOverride(object oPlayer, object oObject, int nCursor) { - string sFunc = "SetObjectMouseCursorOverride"; - - NWNX_PushArgumentInt(nCursor); - NWNX_PushArgumentObject(oObject); - NWNX_PushArgumentObject(oPlayer); - - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushInt(nCursor); + NWNXPushObject(oObject); + NWNXPushObject(oPlayer); + NWNXCall(NWNX_Player, "SetObjectMouseCursorOverride"); } void NWNX_Player_SetObjectHiliteColorOverride(object oPlayer, object oObject, int nColor) { - string sFunc = "SetObjectHiliteColorOverride"; - - NWNX_PushArgumentInt(nColor); - NWNX_PushArgumentObject(oObject); - NWNX_PushArgumentObject(oPlayer); - - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushInt(nColor); + NWNXPushObject(oObject); + NWNXPushObject(oPlayer); + NWNXCall(NWNX_Player, "SetObjectHiliteColorOverride"); } void NWNX_Player_RemoveEffectFromTURD(object oPlayer, string sEffectTag) { - string sFunc = "RemoveEffectFromTURD"; - - NWNX_PushArgumentString(sEffectTag); - NWNX_PushArgumentObject(oPlayer); - - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushString(sEffectTag); + NWNXPushObject(oPlayer); + NWNXCall(NWNX_Player, "RemoveEffectFromTURD"); } void NWNX_Player_SetSpawnLocation(object oPlayer, location locSpawn) { - string sFunc = "SetSpawnLocation"; - - vector vPosition = GetPositionFromLocation(locSpawn); - - NWNX_PushArgumentFloat(GetFacingFromLocation(locSpawn)); - NWNX_PushArgumentFloat(vPosition.z); - NWNX_PushArgumentFloat(vPosition.y); - NWNX_PushArgumentFloat(vPosition.x); - NWNX_PushArgumentObject(GetAreaFromLocation(locSpawn)); - NWNX_PushArgumentObject(oPlayer); - - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushLocation(locSpawn); + NWNXPushObject(oPlayer); + NWNXCall(NWNX_Player, "SetSpawnLocation"); } void NWNX_Player_SendDMAllCreatorLists(object oPlayer) { - string sFunc = "SendDMAllCreatorLists"; - NWNX_PushArgumentObject(oPlayer); - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushObject(oPlayer); + NWNXCall(NWNX_Player, "SendDMAllCreatorLists"); } int NWNX_Player_AddCustomJournalEntry(object oPlayer, struct NWNX_Player_JournalEntry journalEntry, int nSilentUpdate = 0) { - string sFunc = "AddCustomJournalEntry"; - NWNX_PushArgumentInt(nSilentUpdate); - NWNX_PushArgumentInt(journalEntry.nTimeOfDay); - NWNX_PushArgumentInt(journalEntry.nCalendarDay); - NWNX_PushArgumentInt(journalEntry.nUpdated); - NWNX_PushArgumentInt(journalEntry.nQuestDisplayed); - NWNX_PushArgumentInt(journalEntry.nQuestCompleted); - NWNX_PushArgumentInt(journalEntry.nPriority); - NWNX_PushArgumentInt(journalEntry.nState); - NWNX_PushArgumentString(journalEntry.sTag); - NWNX_PushArgumentString(journalEntry.sText); - NWNX_PushArgumentString(journalEntry.sName); - NWNX_PushArgumentObject(oPlayer); - NWNX_CallFunction(NWNX_Player, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushInt(nSilentUpdate); + NWNXPushInt(journalEntry.nTimeOfDay); + NWNXPushInt(journalEntry.nCalendarDay); + NWNXPushInt(journalEntry.nUpdated); + NWNXPushInt(journalEntry.nQuestDisplayed); + NWNXPushInt(journalEntry.nQuestCompleted); + NWNXPushInt(journalEntry.nPriority); + NWNXPushInt(journalEntry.nState); + NWNXPushString(journalEntry.sTag); + NWNXPushString(journalEntry.sText); + NWNXPushString(journalEntry.sName); + NWNXPushObject(oPlayer); + NWNXCall(NWNX_Player, "AddCustomJournalEntry"); + return NWNXPopInt(); } struct NWNX_Player_JournalEntry NWNX_Player_GetJournalEntry(object oPlayer, string questTag) { - string sFunc = "GetJournalEntry"; struct NWNX_Player_JournalEntry entry; - - NWNX_PushArgumentString(questTag); - NWNX_PushArgumentObject(oPlayer); - NWNX_CallFunction(NWNX_Player, sFunc); - - entry.nUpdated = NWNX_GetReturnValueInt(); + NWNXPushString(questTag); + NWNXPushObject(oPlayer); + NWNXCall(NWNX_Player, "GetJournalEntry"); + entry.nUpdated = NWNXPopInt(); if(entry.nUpdated == -1) // -1 set as an indicator to say that the entry was not found { return entry; } - entry.nQuestDisplayed = NWNX_GetReturnValueInt(); - entry.nQuestCompleted = NWNX_GetReturnValueInt(); - entry.nPriority = NWNX_GetReturnValueInt(); - entry.nState = NWNX_GetReturnValueInt(); - entry.nTimeOfDay = NWNX_GetReturnValueInt(); - entry.nCalendarDay = NWNX_GetReturnValueInt(); - entry.sName = NWNX_GetReturnValueString(); - entry.sText = NWNX_GetReturnValueString(); + entry.nQuestDisplayed = NWNXPopInt(); + entry.nQuestCompleted = NWNXPopInt(); + entry.nPriority = NWNXPopInt(); + entry.nState = NWNXPopInt(); + entry.nTimeOfDay = NWNXPopInt(); + entry.nCalendarDay = NWNXPopInt(); + entry.sName = NWNXPopString(); + entry.sText = NWNXPopString(); entry.sTag = questTag; return entry; } void NWNX_Player_CloseStore(object oPlayer) { - string sFunc = "CloseStore"; - - NWNX_PushArgumentObject(oPlayer); - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushObject(oPlayer); + NWNXCall(NWNX_Player, "CloseStore"); } void NWNX_Player_SetTlkOverride(object oPlayer, int nStrRef, string sOverride, int bRestoreGlobal = TRUE) { - string sFunc = "SetTlkOverride"; - - NWNX_PushArgumentInt(bRestoreGlobal); - NWNX_PushArgumentString(sOverride); - NWNX_PushArgumentInt(nStrRef); - NWNX_PushArgumentObject(oPlayer); - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushInt(bRestoreGlobal); + NWNXPushString(sOverride); + NWNXPushInt(nStrRef); + NWNXPushObject(oPlayer); + NWNXCall(NWNX_Player, "SetTlkOverride"); } void NWNX_Player_ReloadTlk(object oPlayer) { - string sFunc = "ReloadTlk"; - - NWNX_PushArgumentObject(oPlayer); - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushObject(oPlayer); + NWNXCall(NWNX_Player, "ReloadTlk"); } void NWNX_Player_UpdateWind(object oPlayer, vector vDirection, float fMagnitude, float fYaw, float fPitch) { - string sFunc = "UpdateWind"; - - NWNX_PushArgumentFloat(fPitch); - NWNX_PushArgumentFloat(fYaw); - NWNX_PushArgumentFloat(fMagnitude); - NWNX_PushArgumentFloat(vDirection.x); - NWNX_PushArgumentFloat(vDirection.y); - NWNX_PushArgumentFloat(vDirection.z); - NWNX_PushArgumentObject(oPlayer); - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushFloat(fPitch); + NWNXPushFloat(fYaw); + NWNXPushFloat(fMagnitude); + NWNXPushVector(vDirection); + NWNXPushObject(oPlayer); + NWNXCall(NWNX_Player, "UpdateWind"); } void NWNX_Player_UpdateSkyBox(object oPlayer, int nSkyBox) { - string sFunc = "UpdateSkyBox"; - - NWNX_PushArgumentInt(nSkyBox); - NWNX_PushArgumentObject(oPlayer); - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushInt(nSkyBox); + NWNXPushObject(oPlayer); + NWNXCall(NWNX_Player, "UpdateSkyBox"); } void NWNX_Player_UpdateFogColor(object oPlayer, int nSunFogColor, int nMoonFogColor) { - string sFunc = "UpdateFogColor"; - - NWNX_PushArgumentInt(nMoonFogColor); - NWNX_PushArgumentInt(nSunFogColor); - NWNX_PushArgumentObject(oPlayer); - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushInt(nMoonFogColor); + NWNXPushInt(nSunFogColor); + NWNXPushObject(oPlayer); + NWNXCall(NWNX_Player, "UpdateFogColor"); } void NWNX_Player_UpdateFogAmount(object oPlayer, int nSunFogAmount, int nMoonFogAmount) { - string sFunc = "UpdateFogAmount"; - - NWNX_PushArgumentInt(nMoonFogAmount); - NWNX_PushArgumentInt(nSunFogAmount); - NWNX_PushArgumentObject(oPlayer); - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushInt(nMoonFogAmount); + NWNXPushInt(nSunFogAmount); + NWNXPushObject(oPlayer); + NWNXCall(NWNX_Player, "UpdateFogAmount"); } object NWNX_Player_GetGameObject(object oPlayer) { - string sFunc = "GetGameObject"; - - NWNX_PushArgumentObject(oPlayer); - NWNX_CallFunction(NWNX_Player, sFunc); - return NWNX_GetReturnValueObject(); + NWNXPushObject(oPlayer); + NWNXCall(NWNX_Player, "GetGameObject"); + return NWNXPopObject(); } void NWNX_Player_SetObjectUiDiscoveryMaskOverride(object oPlayer, object oObject, int nMask) { - string sFunc = "SetObjectUiDiscoveryMaskOverride"; - - NWNX_PushArgumentInt(nMask); - NWNX_PushArgumentObject(oObject); - NWNX_PushArgumentObject(oPlayer); - - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushInt(nMask); + NWNXPushObject(oObject); + NWNXPushObject(oPlayer); + NWNXCall(NWNX_Player, "SetObjectUiDiscoveryMaskOverride"); } void NWNX_Player_SendPartyInvite(object oPlayer, object oInviter, int bForceInvite = FALSE, int bHideDialog = FALSE) { - string sFunc = "SendPartyInvite"; - - NWNX_PushArgumentInt(bHideDialog); - NWNX_PushArgumentInt(bForceInvite); - NWNX_PushArgumentObject(oInviter); - NWNX_PushArgumentObject(oPlayer); - - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushInt(bHideDialog); + NWNXPushInt(bForceInvite); + NWNXPushObject(oInviter); + NWNXPushObject(oPlayer); + NWNXCall(NWNX_Player, "SendPartyInvite"); } object NWNX_Player_GetTURD(object oPlayer) { - string sFunc = "GetTURD"; - - NWNX_PushArgumentObject(oPlayer); - NWNX_CallFunction(NWNX_Player, sFunc); - - return NWNX_GetReturnValueObject(); + NWNXPushObject(oPlayer); + NWNXCall(NWNX_Player, "GetTURD"); + return NWNXPopObject(); } void NWNX_Player_ReloadColorPalettes(object oPlayer) { - string sFunc = "ReloadColorPalettes"; - - NWNX_PushArgumentObject(oPlayer); - NWNX_CallFunction(NWNX_Player, sFunc); + NWNXPushObject(oPlayer); + NWNXCall(NWNX_Player, "ReloadColorPalettes"); } diff --git a/_module/nss/nwnx_profiler.nss b/_module/nss/nwnx_profiler.nss index 9f641068..9eba0729 100644 --- a/_module/nss/nwnx_profiler.nss +++ b/_module/nss/nwnx_profiler.nss @@ -3,7 +3,6 @@ /// @remark These functions are for advanced users. /// @{ /// @file nwnx_profiler.nss -#include "nwnx" const string NWNX_Profiler = "NWNX_Profiler"; ///< @private @@ -39,22 +38,17 @@ void NWNX_Profiler_PopPerfScope(); void NWNX_Profiler_PushPerfScope(string name, string tag0_tag = "", string tag0_value = "") { - string sFunc = "PushPerfScope"; - - NWNX_PushArgumentString(name); - if (tag0_value != "" && tag0_tag != "") { - NWNX_PushArgumentString(tag0_value); - NWNX_PushArgumentString(tag0_tag); + NWNXPushString(tag0_value); + NWNXPushString(tag0_tag); } - - NWNX_CallFunction(NWNX_Profiler, sFunc); + NWNXPushString(name); + NWNXCall(NWNX_Profiler, "PushPerfScope"); } void NWNX_Profiler_PopPerfScope() { - string sFunc = "PopPerfScope"; + NWNXCall(NWNX_Profiler, "PopPerfScope"); +} - NWNX_CallFunction(NWNX_Profiler, sFunc); -} \ No newline at end of file diff --git a/_module/nss/nwnx_race.nss b/_module/nss/nwnx_race.nss index de8c636c..3b892283 100644 --- a/_module/nss/nwnx_race.nss +++ b/_module/nss/nwnx_race.nss @@ -2,7 +2,6 @@ /// @brief Define racial and subrace characteristics. /// @{ /// @file nwnx_race.nss -#include "nwnx" const string NWNX_Race = "NWNX_Race"; ///< @private @@ -54,37 +53,50 @@ int NWNX_Race_GetParentRace(int iRace); /// or Favored Enemy: Wild Elf void NWNX_Race_SetFavoredEnemyFeat(int iRace, int iFeat); +/// @brief Removes any nwnx_race 'Effects' on the targeted creature. Suppression lasts until levelup, next login, or Reactivated by function. +/// @param oCreature The creature to suppress +/// @note Not all nwnx_race modifiers are achieved via effect. Those that are not directly consider the creatures current race. +void NWNX_Race_SuppressCreatureRaceEffects(object oCreature); + +/// @brief Reactivates the nwnx_race 'Effects' on the targeted creature after they were Suppressed. +/// @param oCreature The creature to reactive +/// @note Safe to use on non-suppressed creatures - Triggers a refresh of effects but won't stack. +void NWNX_Race_ReactivateCreatureRaceEffects(object oCreature); + /// @} void NWNX_Race_SetRacialModifier(int iRace, int iMod, int iParam1, int iParam2 = 0xDEADBEEF, int iParam3 = 0xDEADBEEF) { - string sFunc = "SetRacialModifier"; - - NWNX_PushArgumentInt(iParam3); - NWNX_PushArgumentInt(iParam2); - NWNX_PushArgumentInt(iParam1); - NWNX_PushArgumentInt(iMod); - NWNX_PushArgumentInt(iRace); - - NWNX_CallFunction(NWNX_Race, sFunc); + NWNXPushInt(iParam3); + NWNXPushInt(iParam2); + NWNXPushInt(iParam1); + NWNXPushInt(iMod); + NWNXPushInt(iRace); + NWNXCall(NWNX_Race, "SetRacialModifier"); } int NWNX_Race_GetParentRace(int iRace) { - string sFunc = "GetParentRace"; - - NWNX_PushArgumentInt(iRace); - - NWNX_CallFunction(NWNX_Race, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushInt(iRace); + NWNXCall(NWNX_Race, "GetParentRace"); + return NWNXPopInt(); } void NWNX_Race_SetFavoredEnemyFeat(int iRace, int iFeat) { - string sFunc = "SetFavoredEnemyFeat"; - - NWNX_PushArgumentInt(iFeat); - NWNX_PushArgumentInt(iRace); - - NWNX_CallFunction(NWNX_Race, sFunc); + NWNXPushInt(iFeat); + NWNXPushInt(iRace); + NWNXCall(NWNX_Race, "SetFavoredEnemyFeat"); +} + +void NWNX_Race_SuppressCreatureRaceEffects(object creature) +{ + NWNXPushObject(creature); + NWNXCall(NWNX_Race, "SuppressCreatureRaceEffects"); +} + +void NWNX_Race_ReactivateCreatureRaceEffects(object oCreature) +{ + NWNXPushObject(oCreature); + NWNXCall(NWNX_Race, "ReactivateCreatureRaceEffects"); } diff --git a/_module/nss/nwnx_redis.nss b/_module/nss/nwnx_redis.nss index 26c97a5b..0ead8152 100644 --- a/_module/nss/nwnx_redis.nss +++ b/_module/nss/nwnx_redis.nss @@ -3,7 +3,6 @@ /// @{ /// @file nwnx_redis.nss /// @name Redis Commands -#include "nwnx" #include "nwnx_redis_lib" @@ -3235,32 +3234,32 @@ int NWNX_Redis_APPEND( string key, string value ) { - NWNX_PushArgumentString("APPEND"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(value); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("APPEND"); + NWNXPushString(key); + NWNXPushString(value); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_AUTH( string password ) { - NWNX_PushArgumentString("AUTH"); - NWNX_PushArgumentString(password); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("AUTH"); + NWNXPushString(password); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_BGREWRITEAOF() { - NWNX_PushArgumentString("BGREWRITEAOF"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("BGREWRITEAOF"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_BGSAVE() { - NWNX_PushArgumentString("BGSAVE"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("BGSAVE"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_BITCOUNT( @@ -3270,12 +3269,12 @@ int NWNX_Redis_BITCOUNT( // Redis type: integer int end = 0 ) { - NWNX_PushArgumentString("BITCOUNT"); - NWNX_PushArgumentString(key); - if (start != 0) NWNX_PushArgumentString(IntToString(start)); - if (end != 0) NWNX_PushArgumentString(IntToString(end)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("BITCOUNT"); + NWNXPushString(key); + if (start != 0) NWNXPushString(IntToString(start)); + if (end != 0) NWNXPushString(IntToString(end)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_BITFIELD( @@ -3297,18 +3296,18 @@ int NWNX_Redis_BITFIELD( // Redis type: integer int incrby_increment = 0 ) { - NWNX_PushArgumentString("BITFIELD"); - NWNX_PushArgumentString(key); - if (get_type != "") NWNX_PushArgumentString(get_type); - if (get_offset != 0) NWNX_PushArgumentString(IntToString(get_offset)); - if (set_type != "") NWNX_PushArgumentString(set_type); - if (set_offset != 0) NWNX_PushArgumentString(IntToString(set_offset)); - if (set_value != 0) NWNX_PushArgumentString(IntToString(set_value)); - if (incrby_type != "") NWNX_PushArgumentString(incrby_type); - if (incrby_offset != 0) NWNX_PushArgumentString(IntToString(incrby_offset)); - if (incrby_increment != 0) NWNX_PushArgumentString(IntToString(incrby_increment)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("BITFIELD"); + NWNXPushString(key); + if (get_type != "") NWNXPushString(get_type); + if (get_offset != 0) NWNXPushString(IntToString(get_offset)); + if (set_type != "") NWNXPushString(set_type); + if (set_offset != 0) NWNXPushString(IntToString(set_offset)); + if (set_value != 0) NWNXPushString(IntToString(set_value)); + if (incrby_type != "") NWNXPushString(incrby_type); + if (incrby_offset != 0) NWNXPushString(IntToString(incrby_offset)); + if (incrby_increment != 0) NWNXPushString(IntToString(incrby_increment)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_BITOP( @@ -3317,12 +3316,12 @@ int NWNX_Redis_BITOP( string destkey, string key ) { - NWNX_PushArgumentString("BITOP"); - NWNX_PushArgumentString(operation); - NWNX_PushArgumentString(destkey); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("BITOP"); + NWNXPushString(operation); + NWNXPushString(destkey); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_BITPOS( @@ -3334,13 +3333,13 @@ int NWNX_Redis_BITPOS( // Redis type: integer int end = 0 ) { - NWNX_PushArgumentString("BITPOS"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(bit)); - if (start != 0) NWNX_PushArgumentString(IntToString(start)); - if (end != 0) NWNX_PushArgumentString(IntToString(end)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("BITPOS"); + NWNXPushString(key); + NWNXPushString(IntToString(bit)); + if (start != 0) NWNXPushString(IntToString(start)); + if (end != 0) NWNXPushString(IntToString(end)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_BLPOP( @@ -3348,11 +3347,11 @@ int NWNX_Redis_BLPOP( // Redis type: integer int timeout ) { - NWNX_PushArgumentString("BLPOP"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(timeout)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("BLPOP"); + NWNXPushString(key); + NWNXPushString(IntToString(timeout)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_BRPOP( @@ -3360,11 +3359,11 @@ int NWNX_Redis_BRPOP( // Redis type: integer int timeout ) { - NWNX_PushArgumentString("BRPOP"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(timeout)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("BRPOP"); + NWNXPushString(key); + NWNXPushString(IntToString(timeout)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_BRPOPLPUSH( @@ -3375,12 +3374,12 @@ int NWNX_Redis_BRPOPLPUSH( // Redis type: integer int timeout ) { - NWNX_PushArgumentString("BRPOPLPUSH"); - NWNX_PushArgumentString(source); - NWNX_PushArgumentString(destination); - NWNX_PushArgumentString(IntToString(timeout)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("BRPOPLPUSH"); + NWNXPushString(source); + NWNXPushString(destination); + NWNXPushString(IntToString(timeout)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_BZPOPMIN( @@ -3388,11 +3387,11 @@ int NWNX_Redis_BZPOPMIN( // Redis type: integer int timeout ) { - NWNX_PushArgumentString("BZPOPMIN"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(timeout)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("BZPOPMIN"); + NWNXPushString(key); + NWNXPushString(IntToString(timeout)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_BZPOPMAX( @@ -3400,17 +3399,17 @@ int NWNX_Redis_BZPOPMAX( // Redis type: integer int timeout ) { - NWNX_PushArgumentString("BZPOPMAX"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(timeout)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("BZPOPMAX"); + NWNXPushString(key); + NWNXPushString(IntToString(timeout)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_CLIENT_ID() { - NWNX_PushArgumentString("CLIENT_ID"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLIENT_ID"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_CLIENT_KILL( @@ -3420,54 +3419,54 @@ int NWNX_Redis_CLIENT_KILL( string addr_ip_port = "", string skipme_yes_no = "" ) { - NWNX_PushArgumentString("CLIENT_KILL"); - if (ip_port != "") NWNX_PushArgumentString(ip_port); - if (id_client_id != 0) NWNX_PushArgumentString(IntToString(id_client_id)); - if (addr_ip_port != "") NWNX_PushArgumentString(addr_ip_port); - if (skipme_yes_no != "") NWNX_PushArgumentString(skipme_yes_no); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLIENT_KILL"); + if (ip_port != "") NWNXPushString(ip_port); + if (id_client_id != 0) NWNXPushString(IntToString(id_client_id)); + if (addr_ip_port != "") NWNXPushString(addr_ip_port); + if (skipme_yes_no != "") NWNXPushString(skipme_yes_no); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_CLIENT_LIST() { - NWNX_PushArgumentString("CLIENT_LIST"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLIENT_LIST"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_CLIENT_GETNAME() { - NWNX_PushArgumentString("CLIENT_GETNAME"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLIENT_GETNAME"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_CLIENT_PAUSE( // Redis type: integer int timeout ) { - NWNX_PushArgumentString("CLIENT_PAUSE"); - NWNX_PushArgumentString(IntToString(timeout)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLIENT_PAUSE"); + NWNXPushString(IntToString(timeout)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_CLIENT_REPLY( // Redis type: enum string reply_mode ) { - NWNX_PushArgumentString("CLIENT_REPLY"); - NWNX_PushArgumentString(reply_mode); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLIENT_REPLY"); + NWNXPushString(reply_mode); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_CLIENT_SETNAME( string connection_name ) { - NWNX_PushArgumentString("CLIENT_SETNAME"); - NWNX_PushArgumentString(connection_name); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLIENT_SETNAME"); + NWNXPushString(connection_name); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_CLIENT_UNBLOCK( @@ -3475,69 +3474,69 @@ int NWNX_Redis_CLIENT_UNBLOCK( // Redis type: enum string unblock_type = "" ) { - NWNX_PushArgumentString("CLIENT_UNBLOCK"); - NWNX_PushArgumentString(client_id); - if (unblock_type != "") NWNX_PushArgumentString(unblock_type); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLIENT_UNBLOCK"); + NWNXPushString(client_id); + if (unblock_type != "") NWNXPushString(unblock_type); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_CLUSTER_ADDSLOTS( // Redis type: integer int slot ) { - NWNX_PushArgumentString("CLUSTER_ADDSLOTS"); - NWNX_PushArgumentString(IntToString(slot)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLUSTER_ADDSLOTS"); + NWNXPushString(IntToString(slot)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_CLUSTER_COUNT_FAILURE_REPORTS( string node_id ) { - NWNX_PushArgumentString("CLUSTER_COUNT_FAILURE_REPORTS"); - NWNX_PushArgumentString(node_id); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLUSTER_COUNT_FAILURE_REPORTS"); + NWNXPushString(node_id); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_CLUSTER_COUNTKEYSINSLOT( // Redis type: integer int slot ) { - NWNX_PushArgumentString("CLUSTER_COUNTKEYSINSLOT"); - NWNX_PushArgumentString(IntToString(slot)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLUSTER_COUNTKEYSINSLOT"); + NWNXPushString(IntToString(slot)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_CLUSTER_DELSLOTS( // Redis type: integer int slot ) { - NWNX_PushArgumentString("CLUSTER_DELSLOTS"); - NWNX_PushArgumentString(IntToString(slot)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLUSTER_DELSLOTS"); + NWNXPushString(IntToString(slot)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_CLUSTER_FAILOVER( // Redis type: enum string options = "" ) { - NWNX_PushArgumentString("CLUSTER_FAILOVER"); - if (options != "") NWNX_PushArgumentString(options); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLUSTER_FAILOVER"); + if (options != "") NWNXPushString(options); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_CLUSTER_FORGET( string node_id ) { - NWNX_PushArgumentString("CLUSTER_FORGET"); - NWNX_PushArgumentString(node_id); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLUSTER_FORGET"); + NWNXPushString(node_id); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_CLUSTER_GETKEYSINSLOT( @@ -3546,26 +3545,26 @@ int NWNX_Redis_CLUSTER_GETKEYSINSLOT( // Redis type: integer int count ) { - NWNX_PushArgumentString("CLUSTER_GETKEYSINSLOT"); - NWNX_PushArgumentString(IntToString(slot)); - NWNX_PushArgumentString(IntToString(count)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLUSTER_GETKEYSINSLOT"); + NWNXPushString(IntToString(slot)); + NWNXPushString(IntToString(count)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_CLUSTER_INFO() { - NWNX_PushArgumentString("CLUSTER_INFO"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLUSTER_INFO"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_CLUSTER_KEYSLOT( string key ) { - NWNX_PushArgumentString("CLUSTER_KEYSLOT"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLUSTER_KEYSLOT"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_CLUSTER_MEET( @@ -3573,52 +3572,52 @@ int NWNX_Redis_CLUSTER_MEET( // Redis type: integer int port ) { - NWNX_PushArgumentString("CLUSTER_MEET"); - NWNX_PushArgumentString(ip); - NWNX_PushArgumentString(IntToString(port)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLUSTER_MEET"); + NWNXPushString(ip); + NWNXPushString(IntToString(port)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_CLUSTER_NODES() { - NWNX_PushArgumentString("CLUSTER_NODES"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLUSTER_NODES"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_CLUSTER_REPLICATE( string node_id ) { - NWNX_PushArgumentString("CLUSTER_REPLICATE"); - NWNX_PushArgumentString(node_id); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLUSTER_REPLICATE"); + NWNXPushString(node_id); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_CLUSTER_RESET( // Redis type: enum string reset_type = "" ) { - NWNX_PushArgumentString("CLUSTER_RESET"); - if (reset_type != "") NWNX_PushArgumentString(reset_type); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLUSTER_RESET"); + if (reset_type != "") NWNXPushString(reset_type); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_CLUSTER_SAVECONFIG() { - NWNX_PushArgumentString("CLUSTER_SAVECONFIG"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLUSTER_SAVECONFIG"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_CLUSTER_SET_CONFIG_EPOCH( // Redis type: integer int config_epoch ) { - NWNX_PushArgumentString("CLUSTER_SET_CONFIG_EPOCH"); - NWNX_PushArgumentString(IntToString(config_epoch)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLUSTER_SET_CONFIG_EPOCH"); + NWNXPushString(IntToString(config_epoch)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_CLUSTER_SETSLOT( @@ -3628,125 +3627,125 @@ int NWNX_Redis_CLUSTER_SETSLOT( string subcommand, string node_id = "" ) { - NWNX_PushArgumentString("CLUSTER_SETSLOT"); - NWNX_PushArgumentString(IntToString(slot)); - NWNX_PushArgumentString(subcommand); - if (node_id != "") NWNX_PushArgumentString(node_id); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLUSTER_SETSLOT"); + NWNXPushString(IntToString(slot)); + NWNXPushString(subcommand); + if (node_id != "") NWNXPushString(node_id); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_CLUSTER_SLAVES( string node_id ) { - NWNX_PushArgumentString("CLUSTER_SLAVES"); - NWNX_PushArgumentString(node_id); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLUSTER_SLAVES"); + NWNXPushString(node_id); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_CLUSTER_REPLICAS( string node_id ) { - NWNX_PushArgumentString("CLUSTER_REPLICAS"); - NWNX_PushArgumentString(node_id); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLUSTER_REPLICAS"); + NWNXPushString(node_id); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_CLUSTER_SLOTS() { - NWNX_PushArgumentString("CLUSTER_SLOTS"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLUSTER_SLOTS"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_COMMAND() { - NWNX_PushArgumentString("COMMAND"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("COMMAND"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_COMMAND_COUNT() { - NWNX_PushArgumentString("COMMAND_COUNT"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("COMMAND_COUNT"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_COMMAND_GETKEYS() { - NWNX_PushArgumentString("COMMAND_GETKEYS"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("COMMAND_GETKEYS"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_COMMAND_INFO( string command_name ) { - NWNX_PushArgumentString("COMMAND_INFO"); - NWNX_PushArgumentString(command_name); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("COMMAND_INFO"); + NWNXPushString(command_name); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_CONFIG_GET( string parameter ) { - NWNX_PushArgumentString("CONFIG_GET"); - NWNX_PushArgumentString(parameter); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CONFIG_GET"); + NWNXPushString(parameter); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_CONFIG_REWRITE() { - NWNX_PushArgumentString("CONFIG_REWRITE"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CONFIG_REWRITE"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_CONFIG_SET( string parameter, string value ) { - NWNX_PushArgumentString("CONFIG_SET"); - NWNX_PushArgumentString(parameter); - NWNX_PushArgumentString(value); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CONFIG_SET"); + NWNXPushString(parameter); + NWNXPushString(value); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_CONFIG_RESETSTAT() { - NWNX_PushArgumentString("CONFIG_RESETSTAT"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CONFIG_RESETSTAT"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_DBSIZE() { - NWNX_PushArgumentString("DBSIZE"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("DBSIZE"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_DEBUG_OBJECT( string key ) { - NWNX_PushArgumentString("DEBUG_OBJECT"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("DEBUG_OBJECT"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_DEBUG_SEGFAULT() { - NWNX_PushArgumentString("DEBUG_SEGFAULT"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("DEBUG_SEGFAULT"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_DECR( string key ) { - NWNX_PushArgumentString("DECR"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("DECR"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_DECRBY( @@ -3754,44 +3753,44 @@ int NWNX_Redis_DECRBY( // Redis type: integer int decrement ) { - NWNX_PushArgumentString("DECRBY"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(decrement)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("DECRBY"); + NWNXPushString(key); + NWNXPushString(IntToString(decrement)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_DEL( string key ) { - NWNX_PushArgumentString("DEL"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("DEL"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_DISCARD() { - NWNX_PushArgumentString("DISCARD"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("DISCARD"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_DUMP( string key ) { - NWNX_PushArgumentString("DUMP"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("DUMP"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_ECHO( string message ) { - NWNX_PushArgumentString("ECHO"); - NWNX_PushArgumentString(message); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ECHO"); + NWNXPushString(message); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_EVAL( @@ -3801,13 +3800,13 @@ int NWNX_Redis_EVAL( string key, string arg ) { - NWNX_PushArgumentString("EVAL"); - NWNX_PushArgumentString(script); - NWNX_PushArgumentString(IntToString(numkeys)); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(arg); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("EVAL"); + NWNXPushString(script); + NWNXPushString(IntToString(numkeys)); + NWNXPushString(key); + NWNXPushString(arg); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_EVALSHA( @@ -3817,28 +3816,28 @@ int NWNX_Redis_EVALSHA( string key, string arg ) { - NWNX_PushArgumentString("EVALSHA"); - NWNX_PushArgumentString(sha1); - NWNX_PushArgumentString(IntToString(numkeys)); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(arg); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("EVALSHA"); + NWNXPushString(sha1); + NWNXPushString(IntToString(numkeys)); + NWNXPushString(key); + NWNXPushString(arg); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_EXEC() { - NWNX_PushArgumentString("EXEC"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("EXEC"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_EXISTS( string key ) { - NWNX_PushArgumentString("EXISTS"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("EXISTS"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_EXPIRE( @@ -3846,11 +3845,11 @@ int NWNX_Redis_EXPIRE( // Redis type: integer int seconds ) { - NWNX_PushArgumentString("EXPIRE"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(seconds)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("EXPIRE"); + NWNXPushString(key); + NWNXPushString(IntToString(seconds)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_EXPIREAT( @@ -3858,31 +3857,31 @@ int NWNX_Redis_EXPIREAT( // Redis type: posix time string timestamp ) { - NWNX_PushArgumentString("EXPIREAT"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(timestamp); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("EXPIREAT"); + NWNXPushString(key); + NWNXPushString(timestamp); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_FLUSHALL( // Redis type: enum string async = "" ) { - NWNX_PushArgumentString("FLUSHALL"); - if (async != "") NWNX_PushArgumentString(async); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("FLUSHALL"); + if (async != "") NWNXPushString(async); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_FLUSHDB( // Redis type: enum string async = "" ) { - NWNX_PushArgumentString("FLUSHDB"); - if (async != "") NWNX_PushArgumentString(async); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("FLUSHDB"); + if (async != "") NWNXPushString(async); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_GEOADD( @@ -3893,35 +3892,35 @@ int NWNX_Redis_GEOADD( float latitude, string member ) { - NWNX_PushArgumentString("GEOADD"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(FloatToString(longitude, 0)); - NWNX_PushArgumentString(FloatToString(latitude, 0)); - NWNX_PushArgumentString(member); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("GEOADD"); + NWNXPushString(key); + NWNXPushString(FloatToString(longitude, 0)); + NWNXPushString(FloatToString(latitude, 0)); + NWNXPushString(member); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_GEOHASH( string key, string member ) { - NWNX_PushArgumentString("GEOHASH"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(member); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("GEOHASH"); + NWNXPushString(key); + NWNXPushString(member); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_GEOPOS( string key, string member ) { - NWNX_PushArgumentString("GEOPOS"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(member); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("GEOPOS"); + NWNXPushString(key); + NWNXPushString(member); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_GEODIST( @@ -3930,13 +3929,13 @@ int NWNX_Redis_GEODIST( string member2, string unit = "" ) { - NWNX_PushArgumentString("GEODIST"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(member1); - NWNX_PushArgumentString(member2); - if (unit != "") NWNX_PushArgumentString(unit); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("GEODIST"); + NWNXPushString(key); + NWNXPushString(member1); + NWNXPushString(member2); + if (unit != "") NWNXPushString(unit); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_GEORADIUS( @@ -3964,21 +3963,21 @@ int NWNX_Redis_GEORADIUS( // Redis type: key string storedist_key = "" ) { - NWNX_PushArgumentString("GEORADIUS"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(FloatToString(longitude, 0)); - NWNX_PushArgumentString(FloatToString(latitude, 0)); - NWNX_PushArgumentString(FloatToString(radius, 0)); - NWNX_PushArgumentString(unit); - if (withcoord != "") NWNX_PushArgumentString(withcoord); - if (withdist != "") NWNX_PushArgumentString(withdist); - if (withhash != "") NWNX_PushArgumentString(withhash); - if (count_count != 0) NWNX_PushArgumentString(IntToString(count_count)); - if (order != "") NWNX_PushArgumentString(order); - if (store_key != "") NWNX_PushArgumentString(store_key); - if (storedist_key != "") NWNX_PushArgumentString(storedist_key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("GEORADIUS"); + NWNXPushString(key); + NWNXPushString(FloatToString(longitude, 0)); + NWNXPushString(FloatToString(latitude, 0)); + NWNXPushString(FloatToString(radius, 0)); + NWNXPushString(unit); + if (withcoord != "") NWNXPushString(withcoord); + if (withdist != "") NWNXPushString(withdist); + if (withhash != "") NWNXPushString(withhash); + if (count_count != 0) NWNXPushString(IntToString(count_count)); + if (order != "") NWNXPushString(order); + if (store_key != "") NWNXPushString(store_key); + if (storedist_key != "") NWNXPushString(storedist_key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_GEORADIUSBYMEMBER( @@ -4003,29 +4002,29 @@ int NWNX_Redis_GEORADIUSBYMEMBER( // Redis type: key string storedist_key = "" ) { - NWNX_PushArgumentString("GEORADIUSBYMEMBER"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(member); - NWNX_PushArgumentString(FloatToString(radius, 0)); - NWNX_PushArgumentString(unit); - if (withcoord != "") NWNX_PushArgumentString(withcoord); - if (withdist != "") NWNX_PushArgumentString(withdist); - if (withhash != "") NWNX_PushArgumentString(withhash); - if (count_count != 0) NWNX_PushArgumentString(IntToString(count_count)); - if (order != "") NWNX_PushArgumentString(order); - if (store_key != "") NWNX_PushArgumentString(store_key); - if (storedist_key != "") NWNX_PushArgumentString(storedist_key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("GEORADIUSBYMEMBER"); + NWNXPushString(key); + NWNXPushString(member); + NWNXPushString(FloatToString(radius, 0)); + NWNXPushString(unit); + if (withcoord != "") NWNXPushString(withcoord); + if (withdist != "") NWNXPushString(withdist); + if (withhash != "") NWNXPushString(withhash); + if (count_count != 0) NWNXPushString(IntToString(count_count)); + if (order != "") NWNXPushString(order); + if (store_key != "") NWNXPushString(store_key); + if (storedist_key != "") NWNXPushString(storedist_key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_GET( string key ) { - NWNX_PushArgumentString("GET"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("GET"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_GETBIT( @@ -4033,11 +4032,11 @@ int NWNX_Redis_GETBIT( // Redis type: integer int offset ) { - NWNX_PushArgumentString("GETBIT"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(offset)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("GETBIT"); + NWNXPushString(key); + NWNXPushString(IntToString(offset)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_GETRANGE( @@ -4047,65 +4046,65 @@ int NWNX_Redis_GETRANGE( // Redis type: integer int end ) { - NWNX_PushArgumentString("GETRANGE"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(start)); - NWNX_PushArgumentString(IntToString(end)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("GETRANGE"); + NWNXPushString(key); + NWNXPushString(IntToString(start)); + NWNXPushString(IntToString(end)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_GETSET( string key, string value ) { - NWNX_PushArgumentString("GETSET"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(value); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("GETSET"); + NWNXPushString(key); + NWNXPushString(value); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_HDEL( string key, string field ) { - NWNX_PushArgumentString("HDEL"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(field); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("HDEL"); + NWNXPushString(key); + NWNXPushString(field); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_HEXISTS( string key, string field ) { - NWNX_PushArgumentString("HEXISTS"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(field); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("HEXISTS"); + NWNXPushString(key); + NWNXPushString(field); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_HGET( string key, string field ) { - NWNX_PushArgumentString("HGET"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(field); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("HGET"); + NWNXPushString(key); + NWNXPushString(field); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_HGETALL( string key ) { - NWNX_PushArgumentString("HGETALL"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("HGETALL"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_HINCRBY( @@ -4114,12 +4113,12 @@ int NWNX_Redis_HINCRBY( // Redis type: integer int increment ) { - NWNX_PushArgumentString("HINCRBY"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(field); - NWNX_PushArgumentString(IntToString(increment)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("HINCRBY"); + NWNXPushString(key); + NWNXPushString(field); + NWNXPushString(IntToString(increment)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_HINCRBYFLOAT( @@ -4128,41 +4127,41 @@ int NWNX_Redis_HINCRBYFLOAT( // Redis type: double float increment ) { - NWNX_PushArgumentString("HINCRBYFLOAT"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(field); - NWNX_PushArgumentString(FloatToString(increment, 0)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("HINCRBYFLOAT"); + NWNXPushString(key); + NWNXPushString(field); + NWNXPushString(FloatToString(increment, 0)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_HKEYS( string key ) { - NWNX_PushArgumentString("HKEYS"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("HKEYS"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_HLEN( string key ) { - NWNX_PushArgumentString("HLEN"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("HLEN"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_HMGET( string key, string field ) { - NWNX_PushArgumentString("HMGET"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(field); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("HMGET"); + NWNXPushString(key); + NWNXPushString(field); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_HMSET( @@ -4170,12 +4169,12 @@ int NWNX_Redis_HMSET( string field, string value ) { - NWNX_PushArgumentString("HMSET"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(field); - NWNX_PushArgumentString(value); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("HMSET"); + NWNXPushString(key); + NWNXPushString(field); + NWNXPushString(value); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_HSET( @@ -4183,12 +4182,12 @@ int NWNX_Redis_HSET( string field, string value ) { - NWNX_PushArgumentString("HSET"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(field); - NWNX_PushArgumentString(value); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("HSET"); + NWNXPushString(key); + NWNXPushString(field); + NWNXPushString(value); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_HSETNX( @@ -4196,41 +4195,41 @@ int NWNX_Redis_HSETNX( string field, string value ) { - NWNX_PushArgumentString("HSETNX"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(field); - NWNX_PushArgumentString(value); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("HSETNX"); + NWNXPushString(key); + NWNXPushString(field); + NWNXPushString(value); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_HSTRLEN( string key, string field ) { - NWNX_PushArgumentString("HSTRLEN"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(field); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("HSTRLEN"); + NWNXPushString(key); + NWNXPushString(field); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_HVALS( string key ) { - NWNX_PushArgumentString("HVALS"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("HVALS"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_INCR( string key ) { - NWNX_PushArgumentString("INCR"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("INCR"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_INCRBY( @@ -4238,11 +4237,11 @@ int NWNX_Redis_INCRBY( // Redis type: integer int increment ) { - NWNX_PushArgumentString("INCRBY"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(increment)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("INCRBY"); + NWNXPushString(key); + NWNXPushString(IntToString(increment)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_INCRBYFLOAT( @@ -4250,35 +4249,35 @@ int NWNX_Redis_INCRBYFLOAT( // Redis type: double float increment ) { - NWNX_PushArgumentString("INCRBYFLOAT"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(FloatToString(increment, 0)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("INCRBYFLOAT"); + NWNXPushString(key); + NWNXPushString(FloatToString(increment, 0)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_INFO( string section = "" ) { - NWNX_PushArgumentString("INFO"); - if (section != "") NWNX_PushArgumentString(section); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("INFO"); + if (section != "") NWNXPushString(section); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_KEYS( string pattern ) { - NWNX_PushArgumentString("KEYS"); - NWNX_PushArgumentString(pattern); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("KEYS"); + NWNXPushString(pattern); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_LASTSAVE() { - NWNX_PushArgumentString("LASTSAVE"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("LASTSAVE"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_LINDEX( @@ -4286,11 +4285,11 @@ int NWNX_Redis_LINDEX( // Redis type: integer int index ) { - NWNX_PushArgumentString("LINDEX"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(index)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("LINDEX"); + NWNXPushString(key); + NWNXPushString(IntToString(index)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_LINSERT( @@ -4300,53 +4299,53 @@ int NWNX_Redis_LINSERT( string pivot, string value ) { - NWNX_PushArgumentString("LINSERT"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(where); - NWNX_PushArgumentString(pivot); - NWNX_PushArgumentString(value); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("LINSERT"); + NWNXPushString(key); + NWNXPushString(where); + NWNXPushString(pivot); + NWNXPushString(value); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_LLEN( string key ) { - NWNX_PushArgumentString("LLEN"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("LLEN"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_LPOP( string key ) { - NWNX_PushArgumentString("LPOP"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("LPOP"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_LPUSH( string key, string value ) { - NWNX_PushArgumentString("LPUSH"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(value); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("LPUSH"); + NWNXPushString(key); + NWNXPushString(value); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_LPUSHX( string key, string value ) { - NWNX_PushArgumentString("LPUSHX"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(value); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("LPUSHX"); + NWNXPushString(key); + NWNXPushString(value); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_LRANGE( @@ -4356,12 +4355,12 @@ int NWNX_Redis_LRANGE( // Redis type: integer int stop ) { - NWNX_PushArgumentString("LRANGE"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(start)); - NWNX_PushArgumentString(IntToString(stop)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("LRANGE"); + NWNXPushString(key); + NWNXPushString(IntToString(start)); + NWNXPushString(IntToString(stop)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_LREM( @@ -4370,12 +4369,12 @@ int NWNX_Redis_LREM( int count, string value ) { - NWNX_PushArgumentString("LREM"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(count)); - NWNX_PushArgumentString(value); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("LREM"); + NWNXPushString(key); + NWNXPushString(IntToString(count)); + NWNXPushString(value); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_LSET( @@ -4384,12 +4383,12 @@ int NWNX_Redis_LSET( int index, string value ) { - NWNX_PushArgumentString("LSET"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(index)); - NWNX_PushArgumentString(value); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("LSET"); + NWNXPushString(key); + NWNXPushString(IntToString(index)); + NWNXPushString(value); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_LTRIM( @@ -4399,42 +4398,42 @@ int NWNX_Redis_LTRIM( // Redis type: integer int stop ) { - NWNX_PushArgumentString("LTRIM"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(start)); - NWNX_PushArgumentString(IntToString(stop)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("LTRIM"); + NWNXPushString(key); + NWNXPushString(IntToString(start)); + NWNXPushString(IntToString(stop)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_MEMORY_DOCTOR() { - NWNX_PushArgumentString("MEMORY_DOCTOR"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("MEMORY_DOCTOR"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_MEMORY_HELP() { - NWNX_PushArgumentString("MEMORY_HELP"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("MEMORY_HELP"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_MEMORY_MALLOC_STATS() { - NWNX_PushArgumentString("MEMORY_MALLOC_STATS"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("MEMORY_MALLOC_STATS"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_MEMORY_PURGE() { - NWNX_PushArgumentString("MEMORY_PURGE"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("MEMORY_PURGE"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_MEMORY_STATS() { - NWNX_PushArgumentString("MEMORY_STATS"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("MEMORY_STATS"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_MEMORY_USAGE( @@ -4442,20 +4441,20 @@ int NWNX_Redis_MEMORY_USAGE( // Redis type: integer int samples_count = 0 ) { - NWNX_PushArgumentString("MEMORY_USAGE"); - NWNX_PushArgumentString(key); - if (samples_count != 0) NWNX_PushArgumentString(IntToString(samples_count)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("MEMORY_USAGE"); + NWNXPushString(key); + if (samples_count != 0) NWNXPushString(IntToString(samples_count)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_MGET( string key ) { - NWNX_PushArgumentString("MGET"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("MGET"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_MIGRATE( @@ -4475,24 +4474,24 @@ int NWNX_Redis_MIGRATE( // Redis type: key string keys_key = "" ) { - NWNX_PushArgumentString("MIGRATE"); - NWNX_PushArgumentString(host); - NWNX_PushArgumentString(port); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(destination_db)); - NWNX_PushArgumentString(IntToString(timeout)); - if (copy != "") NWNX_PushArgumentString(copy); - if (replace != "") NWNX_PushArgumentString(replace); - if (auth_password != "") NWNX_PushArgumentString(auth_password); - if (keys_key != "") NWNX_PushArgumentString(keys_key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("MIGRATE"); + NWNXPushString(host); + NWNXPushString(port); + NWNXPushString(key); + NWNXPushString(IntToString(destination_db)); + NWNXPushString(IntToString(timeout)); + if (copy != "") NWNXPushString(copy); + if (replace != "") NWNXPushString(replace); + if (auth_password != "") NWNXPushString(auth_password); + if (keys_key != "") NWNXPushString(keys_key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_MONITOR() { - NWNX_PushArgumentString("MONITOR"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("MONITOR"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_MOVE( @@ -4500,59 +4499,59 @@ int NWNX_Redis_MOVE( // Redis type: integer int db ) { - NWNX_PushArgumentString("MOVE"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(db)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("MOVE"); + NWNXPushString(key); + NWNXPushString(IntToString(db)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_MSET( string key, string value ) { - NWNX_PushArgumentString("MSET"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(value); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("MSET"); + NWNXPushString(key); + NWNXPushString(value); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_MSETNX( string key, string value ) { - NWNX_PushArgumentString("MSETNX"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(value); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("MSETNX"); + NWNXPushString(key); + NWNXPushString(value); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_MULTI() { - NWNX_PushArgumentString("MULTI"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("MULTI"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_OBJECT( string subcommand, string arguments = "" ) { - NWNX_PushArgumentString("OBJECT"); - NWNX_PushArgumentString(subcommand); - if (arguments != "") NWNX_PushArgumentString(arguments); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("OBJECT"); + NWNXPushString(subcommand); + if (arguments != "") NWNXPushString(arguments); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_PERSIST( string key ) { - NWNX_PushArgumentString("PERSIST"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("PERSIST"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_PEXPIRE( @@ -4560,11 +4559,11 @@ int NWNX_Redis_PEXPIRE( // Redis type: integer int milliseconds ) { - NWNX_PushArgumentString("PEXPIRE"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(milliseconds)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("PEXPIRE"); + NWNXPushString(key); + NWNXPushString(IntToString(milliseconds)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_PEXPIREAT( @@ -4572,31 +4571,31 @@ int NWNX_Redis_PEXPIREAT( // Redis type: posix time string milliseconds_timestamp ) { - NWNX_PushArgumentString("PEXPIREAT"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(milliseconds_timestamp); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("PEXPIREAT"); + NWNXPushString(key); + NWNXPushString(milliseconds_timestamp); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_PFADD( string key, string element ) { - NWNX_PushArgumentString("PFADD"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(element); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("PFADD"); + NWNXPushString(key); + NWNXPushString(element); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_PFCOUNT( string key ) { - NWNX_PushArgumentString("PFCOUNT"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("PFCOUNT"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_PFMERGE( @@ -4605,20 +4604,20 @@ int NWNX_Redis_PFMERGE( // Redis type: key string sourcekey ) { - NWNX_PushArgumentString("PFMERGE"); - NWNX_PushArgumentString(destkey); - NWNX_PushArgumentString(sourcekey); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("PFMERGE"); + NWNXPushString(destkey); + NWNXPushString(sourcekey); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_PING( string message = "" ) { - NWNX_PushArgumentString("PING"); - if (message != "") NWNX_PushArgumentString(message); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("PING"); + if (message != "") NWNXPushString(message); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_PSETEX( @@ -4627,67 +4626,67 @@ int NWNX_Redis_PSETEX( int milliseconds, string value ) { - NWNX_PushArgumentString("PSETEX"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(milliseconds)); - NWNX_PushArgumentString(value); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("PSETEX"); + NWNXPushString(key); + NWNXPushString(IntToString(milliseconds)); + NWNXPushString(value); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_PUBSUB( string subcommand, string argument = "" ) { - NWNX_PushArgumentString("PUBSUB"); - NWNX_PushArgumentString(subcommand); - if (argument != "") NWNX_PushArgumentString(argument); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("PUBSUB"); + NWNXPushString(subcommand); + if (argument != "") NWNXPushString(argument); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_PTTL( string key ) { - NWNX_PushArgumentString("PTTL"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("PTTL"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_PUBLISH( string channel, string message ) { - NWNX_PushArgumentString("PUBLISH"); - NWNX_PushArgumentString(channel); - NWNX_PushArgumentString(message); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("PUBLISH"); + NWNXPushString(channel); + NWNXPushString(message); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_QUIT() { - NWNX_PushArgumentString("QUIT"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("QUIT"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_RANDOMKEY() { - NWNX_PushArgumentString("RANDOMKEY"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("RANDOMKEY"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_READONLY() { - NWNX_PushArgumentString("READONLY"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("READONLY"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_READWRITE() { - NWNX_PushArgumentString("READWRITE"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("READWRITE"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_RENAME( @@ -4695,11 +4694,11 @@ int NWNX_Redis_RENAME( // Redis type: key string newkey ) { - NWNX_PushArgumentString("RENAME"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(newkey); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("RENAME"); + NWNXPushString(key); + NWNXPushString(newkey); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_RENAMENX( @@ -4707,11 +4706,11 @@ int NWNX_Redis_RENAMENX( // Redis type: key string newkey ) { - NWNX_PushArgumentString("RENAMENX"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(newkey); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("RENAMENX"); + NWNXPushString(key); + NWNXPushString(newkey); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_RESTORE( @@ -4728,31 +4727,31 @@ int NWNX_Redis_RESTORE( // Redis type: integer int freq_frequency = 0 ) { - NWNX_PushArgumentString("RESTORE"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(ttl)); - NWNX_PushArgumentString(serialized_value); - if (replace != "") NWNX_PushArgumentString(replace); - if (absttl != "") NWNX_PushArgumentString(absttl); - if (idletime_seconds != 0) NWNX_PushArgumentString(IntToString(idletime_seconds)); - if (freq_frequency != 0) NWNX_PushArgumentString(IntToString(freq_frequency)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("RESTORE"); + NWNXPushString(key); + NWNXPushString(IntToString(ttl)); + NWNXPushString(serialized_value); + if (replace != "") NWNXPushString(replace); + if (absttl != "") NWNXPushString(absttl); + if (idletime_seconds != 0) NWNXPushString(IntToString(idletime_seconds)); + if (freq_frequency != 0) NWNXPushString(IntToString(freq_frequency)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_ROLE() { - NWNX_PushArgumentString("ROLE"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ROLE"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_RPOP( string key ) { - NWNX_PushArgumentString("RPOP"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("RPOP"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_RPOPLPUSH( @@ -4761,108 +4760,108 @@ int NWNX_Redis_RPOPLPUSH( // Redis type: key string destination ) { - NWNX_PushArgumentString("RPOPLPUSH"); - NWNX_PushArgumentString(source); - NWNX_PushArgumentString(destination); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("RPOPLPUSH"); + NWNXPushString(source); + NWNXPushString(destination); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_RPUSH( string key, string value ) { - NWNX_PushArgumentString("RPUSH"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(value); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("RPUSH"); + NWNXPushString(key); + NWNXPushString(value); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_RPUSHX( string key, string value ) { - NWNX_PushArgumentString("RPUSHX"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(value); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("RPUSHX"); + NWNXPushString(key); + NWNXPushString(value); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_SADD( string key, string member ) { - NWNX_PushArgumentString("SADD"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(member); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SADD"); + NWNXPushString(key); + NWNXPushString(member); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_SAVE() { - NWNX_PushArgumentString("SAVE"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SAVE"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_SCARD( string key ) { - NWNX_PushArgumentString("SCARD"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SCARD"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_SCRIPT_DEBUG( // Redis type: enum string mode ) { - NWNX_PushArgumentString("SCRIPT_DEBUG"); - NWNX_PushArgumentString(mode); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SCRIPT_DEBUG"); + NWNXPushString(mode); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_SCRIPT_EXISTS( string sha1 ) { - NWNX_PushArgumentString("SCRIPT_EXISTS"); - NWNX_PushArgumentString(sha1); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SCRIPT_EXISTS"); + NWNXPushString(sha1); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_SCRIPT_FLUSH() { - NWNX_PushArgumentString("SCRIPT_FLUSH"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SCRIPT_FLUSH"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_SCRIPT_KILL() { - NWNX_PushArgumentString("SCRIPT_KILL"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SCRIPT_KILL"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_SCRIPT_LOAD( string script ) { - NWNX_PushArgumentString("SCRIPT_LOAD"); - NWNX_PushArgumentString(script); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SCRIPT_LOAD"); + NWNXPushString(script); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_SDIFF( string key ) { - NWNX_PushArgumentString("SDIFF"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SDIFF"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_SDIFFSTORE( @@ -4870,21 +4869,21 @@ int NWNX_Redis_SDIFFSTORE( string destination, string key ) { - NWNX_PushArgumentString("SDIFFSTORE"); - NWNX_PushArgumentString(destination); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SDIFFSTORE"); + NWNXPushString(destination); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_SELECT( // Redis type: integer int index ) { - NWNX_PushArgumentString("SELECT"); - NWNX_PushArgumentString(IntToString(index)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SELECT"); + NWNXPushString(IntToString(index)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_SET( @@ -4893,12 +4892,12 @@ int NWNX_Redis_SET( // Redis type: enum string condition = "" ) { - NWNX_PushArgumentString("SET"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(value); - if (condition != "") NWNX_PushArgumentString(condition); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SET"); + NWNXPushString(key); + NWNXPushString(value); + if (condition != "") NWNXPushString(condition); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_SETBIT( @@ -4907,12 +4906,12 @@ int NWNX_Redis_SETBIT( int offset, string value ) { - NWNX_PushArgumentString("SETBIT"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(offset)); - NWNX_PushArgumentString(value); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SETBIT"); + NWNXPushString(key); + NWNXPushString(IntToString(offset)); + NWNXPushString(value); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_SETEX( @@ -4921,23 +4920,23 @@ int NWNX_Redis_SETEX( int seconds, string value ) { - NWNX_PushArgumentString("SETEX"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(seconds)); - NWNX_PushArgumentString(value); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SETEX"); + NWNXPushString(key); + NWNXPushString(IntToString(seconds)); + NWNXPushString(value); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_SETNX( string key, string value ) { - NWNX_PushArgumentString("SETNX"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(value); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SETNX"); + NWNXPushString(key); + NWNXPushString(value); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_SETRANGE( @@ -4946,31 +4945,31 @@ int NWNX_Redis_SETRANGE( int offset, string value ) { - NWNX_PushArgumentString("SETRANGE"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(offset)); - NWNX_PushArgumentString(value); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SETRANGE"); + NWNXPushString(key); + NWNXPushString(IntToString(offset)); + NWNXPushString(value); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_SHUTDOWN( // Redis type: enum string save_mode = "" ) { - NWNX_PushArgumentString("SHUTDOWN"); - if (save_mode != "") NWNX_PushArgumentString(save_mode); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SHUTDOWN"); + if (save_mode != "") NWNXPushString(save_mode); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_SINTER( string key ) { - NWNX_PushArgumentString("SINTER"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SINTER"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_SINTERSTORE( @@ -4978,64 +4977,64 @@ int NWNX_Redis_SINTERSTORE( string destination, string key ) { - NWNX_PushArgumentString("SINTERSTORE"); - NWNX_PushArgumentString(destination); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SINTERSTORE"); + NWNXPushString(destination); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_SISMEMBER( string key, string member ) { - NWNX_PushArgumentString("SISMEMBER"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(member); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SISMEMBER"); + NWNXPushString(key); + NWNXPushString(member); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_SLAVEOF( string host, string port ) { - NWNX_PushArgumentString("SLAVEOF"); - NWNX_PushArgumentString(host); - NWNX_PushArgumentString(port); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SLAVEOF"); + NWNXPushString(host); + NWNXPushString(port); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_REPLICAOF( string host, string port ) { - NWNX_PushArgumentString("REPLICAOF"); - NWNX_PushArgumentString(host); - NWNX_PushArgumentString(port); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("REPLICAOF"); + NWNXPushString(host); + NWNXPushString(port); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_SLOWLOG( string subcommand, string argument = "" ) { - NWNX_PushArgumentString("SLOWLOG"); - NWNX_PushArgumentString(subcommand); - if (argument != "") NWNX_PushArgumentString(argument); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SLOWLOG"); + NWNXPushString(subcommand); + if (argument != "") NWNXPushString(argument); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_SMEMBERS( string key ) { - NWNX_PushArgumentString("SMEMBERS"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SMEMBERS"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_SMOVE( @@ -5045,12 +5044,12 @@ int NWNX_Redis_SMOVE( string destination, string member ) { - NWNX_PushArgumentString("SMOVE"); - NWNX_PushArgumentString(source); - NWNX_PushArgumentString(destination); - NWNX_PushArgumentString(member); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SMOVE"); + NWNXPushString(source); + NWNXPushString(destination); + NWNXPushString(member); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_SORT( @@ -5069,17 +5068,17 @@ int NWNX_Redis_SORT( // Redis type: key string store_destination = "" ) { - NWNX_PushArgumentString("SORT"); - NWNX_PushArgumentString(key); - if (by_pattern != "") NWNX_PushArgumentString(by_pattern); - if (limit_offset != 0) NWNX_PushArgumentString(IntToString(limit_offset)); - if (limit_count != 0) NWNX_PushArgumentString(IntToString(limit_count)); - if (get_pattern != "") NWNX_PushArgumentString(get_pattern); - if (order != "") NWNX_PushArgumentString(order); - if (sorting != "") NWNX_PushArgumentString(sorting); - if (store_destination != "") NWNX_PushArgumentString(store_destination); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SORT"); + NWNXPushString(key); + if (by_pattern != "") NWNXPushString(by_pattern); + if (limit_offset != 0) NWNXPushString(IntToString(limit_offset)); + if (limit_count != 0) NWNXPushString(IntToString(limit_count)); + if (get_pattern != "") NWNXPushString(get_pattern); + if (order != "") NWNXPushString(order); + if (sorting != "") NWNXPushString(sorting); + if (store_destination != "") NWNXPushString(store_destination); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_SPOP( @@ -5087,11 +5086,11 @@ int NWNX_Redis_SPOP( // Redis type: integer int count = 0 ) { - NWNX_PushArgumentString("SPOP"); - NWNX_PushArgumentString(key); - if (count != 0) NWNX_PushArgumentString(IntToString(count)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SPOP"); + NWNXPushString(key); + if (count != 0) NWNXPushString(IntToString(count)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_SRANDMEMBER( @@ -5099,40 +5098,40 @@ int NWNX_Redis_SRANDMEMBER( // Redis type: integer int count = 0 ) { - NWNX_PushArgumentString("SRANDMEMBER"); - NWNX_PushArgumentString(key); - if (count != 0) NWNX_PushArgumentString(IntToString(count)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SRANDMEMBER"); + NWNXPushString(key); + if (count != 0) NWNXPushString(IntToString(count)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_SREM( string key, string member ) { - NWNX_PushArgumentString("SREM"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(member); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SREM"); + NWNXPushString(key); + NWNXPushString(member); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_STRLEN( string key ) { - NWNX_PushArgumentString("STRLEN"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("STRLEN"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_SUNION( string key ) { - NWNX_PushArgumentString("SUNION"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SUNION"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_SUNIONSTORE( @@ -5140,11 +5139,11 @@ int NWNX_Redis_SUNIONSTORE( string destination, string key ) { - NWNX_PushArgumentString("SUNIONSTORE"); - NWNX_PushArgumentString(destination); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SUNIONSTORE"); + NWNXPushString(destination); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_SWAPDB( @@ -5153,65 +5152,65 @@ int NWNX_Redis_SWAPDB( // Redis type: integer int index_1 ) { - NWNX_PushArgumentString("SWAPDB"); - NWNX_PushArgumentString(IntToString(index)); - NWNX_PushArgumentString(IntToString(index_1)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SWAPDB"); + NWNXPushString(IntToString(index)); + NWNXPushString(IntToString(index_1)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_SYNC() { - NWNX_PushArgumentString("SYNC"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SYNC"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_TIME() { - NWNX_PushArgumentString("TIME"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("TIME"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_TOUCH( string key ) { - NWNX_PushArgumentString("TOUCH"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("TOUCH"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_TTL( string key ) { - NWNX_PushArgumentString("TTL"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("TTL"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_TYPE( string key ) { - NWNX_PushArgumentString("TYPE"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("TYPE"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_UNLINK( string key ) { - NWNX_PushArgumentString("UNLINK"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("UNLINK"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_UNWATCH() { - NWNX_PushArgumentString("UNWATCH"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("UNWATCH"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_WAIT( @@ -5220,20 +5219,20 @@ int NWNX_Redis_WAIT( // Redis type: integer int timeout ) { - NWNX_PushArgumentString("WAIT"); - NWNX_PushArgumentString(IntToString(numreplicas)); - NWNX_PushArgumentString(IntToString(timeout)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("WAIT"); + NWNXPushString(IntToString(numreplicas)); + NWNXPushString(IntToString(timeout)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_WATCH( string key ) { - NWNX_PushArgumentString("WATCH"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("WATCH"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_ZADD( @@ -5248,24 +5247,24 @@ int NWNX_Redis_ZADD( float score = 0.0, string member = "" ) { - NWNX_PushArgumentString("ZADD"); - NWNX_PushArgumentString(key); - if (condition != "") NWNX_PushArgumentString(condition); - if (change != "") NWNX_PushArgumentString(change); - if (increment != "") NWNX_PushArgumentString(increment); - NWNX_PushArgumentString(FloatToString(score, 0)); - NWNX_PushArgumentString(member); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZADD"); + NWNXPushString(key); + if (condition != "") NWNXPushString(condition); + if (change != "") NWNXPushString(change); + if (increment != "") NWNXPushString(increment); + NWNXPushString(FloatToString(score, 0)); + NWNXPushString(member); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_ZCARD( string key ) { - NWNX_PushArgumentString("ZCARD"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZCARD"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_ZCOUNT( @@ -5275,12 +5274,12 @@ int NWNX_Redis_ZCOUNT( // Redis type: double float max ) { - NWNX_PushArgumentString("ZCOUNT"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(FloatToString(min, 0)); - NWNX_PushArgumentString(FloatToString(max, 0)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZCOUNT"); + NWNXPushString(key); + NWNXPushString(FloatToString(min, 0)); + NWNXPushString(FloatToString(max, 0)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_ZINCRBY( @@ -5289,12 +5288,12 @@ int NWNX_Redis_ZINCRBY( int increment, string member ) { - NWNX_PushArgumentString("ZINCRBY"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(increment)); - NWNX_PushArgumentString(member); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZINCRBY"); + NWNXPushString(key); + NWNXPushString(IntToString(increment)); + NWNXPushString(member); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_ZINTERSTORE( @@ -5308,14 +5307,14 @@ int NWNX_Redis_ZINTERSTORE( // Redis type: enum string aggregate_aggregate = "" ) { - NWNX_PushArgumentString("ZINTERSTORE"); - NWNX_PushArgumentString(destination); - NWNX_PushArgumentString(IntToString(numkeys)); - NWNX_PushArgumentString(key); - if (weights_weight != 0) NWNX_PushArgumentString(IntToString(weights_weight)); - if (aggregate_aggregate != "") NWNX_PushArgumentString(aggregate_aggregate); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZINTERSTORE"); + NWNXPushString(destination); + NWNXPushString(IntToString(numkeys)); + NWNXPushString(key); + if (weights_weight != 0) NWNXPushString(IntToString(weights_weight)); + if (aggregate_aggregate != "") NWNXPushString(aggregate_aggregate); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_ZLEXCOUNT( @@ -5323,12 +5322,12 @@ int NWNX_Redis_ZLEXCOUNT( string min, string max ) { - NWNX_PushArgumentString("ZLEXCOUNT"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(min); - NWNX_PushArgumentString(max); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZLEXCOUNT"); + NWNXPushString(key); + NWNXPushString(min); + NWNXPushString(max); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_ZPOPMAX( @@ -5336,11 +5335,11 @@ int NWNX_Redis_ZPOPMAX( // Redis type: integer int count = 0 ) { - NWNX_PushArgumentString("ZPOPMAX"); - NWNX_PushArgumentString(key); - if (count != 0) NWNX_PushArgumentString(IntToString(count)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZPOPMAX"); + NWNXPushString(key); + if (count != 0) NWNXPushString(IntToString(count)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_ZPOPMIN( @@ -5348,11 +5347,11 @@ int NWNX_Redis_ZPOPMIN( // Redis type: integer int count = 0 ) { - NWNX_PushArgumentString("ZPOPMIN"); - NWNX_PushArgumentString(key); - if (count != 0) NWNX_PushArgumentString(IntToString(count)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZPOPMIN"); + NWNXPushString(key); + if (count != 0) NWNXPushString(IntToString(count)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_ZRANGE( @@ -5364,13 +5363,13 @@ int NWNX_Redis_ZRANGE( // Redis type: enum string withscores = "" ) { - NWNX_PushArgumentString("ZRANGE"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(start)); - NWNX_PushArgumentString(IntToString(stop)); - if (withscores != "") NWNX_PushArgumentString(withscores); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZRANGE"); + NWNXPushString(key); + NWNXPushString(IntToString(start)); + NWNXPushString(IntToString(stop)); + if (withscores != "") NWNXPushString(withscores); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_ZRANGEBYLEX( @@ -5382,14 +5381,14 @@ int NWNX_Redis_ZRANGEBYLEX( // Redis type: integer int limit_count = 0 ) { - NWNX_PushArgumentString("ZRANGEBYLEX"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(min); - NWNX_PushArgumentString(max); - if (limit_offset != 0) NWNX_PushArgumentString(IntToString(limit_offset)); - if (limit_count != 0) NWNX_PushArgumentString(IntToString(limit_count)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZRANGEBYLEX"); + NWNXPushString(key); + NWNXPushString(min); + NWNXPushString(max); + if (limit_offset != 0) NWNXPushString(IntToString(limit_offset)); + if (limit_count != 0) NWNXPushString(IntToString(limit_count)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_ZREVRANGEBYLEX( @@ -5401,14 +5400,14 @@ int NWNX_Redis_ZREVRANGEBYLEX( // Redis type: integer int limit_count = 0 ) { - NWNX_PushArgumentString("ZREVRANGEBYLEX"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(max); - NWNX_PushArgumentString(min); - if (limit_offset != 0) NWNX_PushArgumentString(IntToString(limit_offset)); - if (limit_count != 0) NWNX_PushArgumentString(IntToString(limit_count)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZREVRANGEBYLEX"); + NWNXPushString(key); + NWNXPushString(max); + NWNXPushString(min); + if (limit_offset != 0) NWNXPushString(IntToString(limit_offset)); + if (limit_count != 0) NWNXPushString(IntToString(limit_count)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_ZRANGEBYSCORE( @@ -5424,37 +5423,37 @@ int NWNX_Redis_ZRANGEBYSCORE( // Redis type: integer int limit_count = 0 ) { - NWNX_PushArgumentString("ZRANGEBYSCORE"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(FloatToString(min, 0)); - NWNX_PushArgumentString(FloatToString(max, 0)); - if (withscores != "") NWNX_PushArgumentString(withscores); - if (limit_offset != 0) NWNX_PushArgumentString(IntToString(limit_offset)); - if (limit_count != 0) NWNX_PushArgumentString(IntToString(limit_count)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZRANGEBYSCORE"); + NWNXPushString(key); + NWNXPushString(FloatToString(min, 0)); + NWNXPushString(FloatToString(max, 0)); + if (withscores != "") NWNXPushString(withscores); + if (limit_offset != 0) NWNXPushString(IntToString(limit_offset)); + if (limit_count != 0) NWNXPushString(IntToString(limit_count)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_ZRANK( string key, string member ) { - NWNX_PushArgumentString("ZRANK"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(member); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZRANK"); + NWNXPushString(key); + NWNXPushString(member); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_ZREM( string key, string member ) { - NWNX_PushArgumentString("ZREM"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(member); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZREM"); + NWNXPushString(key); + NWNXPushString(member); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_ZREMRANGEBYLEX( @@ -5462,12 +5461,12 @@ int NWNX_Redis_ZREMRANGEBYLEX( string min, string max ) { - NWNX_PushArgumentString("ZREMRANGEBYLEX"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(min); - NWNX_PushArgumentString(max); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZREMRANGEBYLEX"); + NWNXPushString(key); + NWNXPushString(min); + NWNXPushString(max); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_ZREMRANGEBYRANK( @@ -5477,12 +5476,12 @@ int NWNX_Redis_ZREMRANGEBYRANK( // Redis type: integer int stop ) { - NWNX_PushArgumentString("ZREMRANGEBYRANK"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(start)); - NWNX_PushArgumentString(IntToString(stop)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZREMRANGEBYRANK"); + NWNXPushString(key); + NWNXPushString(IntToString(start)); + NWNXPushString(IntToString(stop)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_ZREMRANGEBYSCORE( @@ -5492,12 +5491,12 @@ int NWNX_Redis_ZREMRANGEBYSCORE( // Redis type: double float max ) { - NWNX_PushArgumentString("ZREMRANGEBYSCORE"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(FloatToString(min, 0)); - NWNX_PushArgumentString(FloatToString(max, 0)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZREMRANGEBYSCORE"); + NWNXPushString(key); + NWNXPushString(FloatToString(min, 0)); + NWNXPushString(FloatToString(max, 0)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_ZREVRANGE( @@ -5509,13 +5508,13 @@ int NWNX_Redis_ZREVRANGE( // Redis type: enum string withscores = "" ) { - NWNX_PushArgumentString("ZREVRANGE"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(start)); - NWNX_PushArgumentString(IntToString(stop)); - if (withscores != "") NWNX_PushArgumentString(withscores); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZREVRANGE"); + NWNXPushString(key); + NWNXPushString(IntToString(start)); + NWNXPushString(IntToString(stop)); + if (withscores != "") NWNXPushString(withscores); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_ZREVRANGEBYSCORE( @@ -5531,37 +5530,37 @@ int NWNX_Redis_ZREVRANGEBYSCORE( // Redis type: integer int limit_count = 0 ) { - NWNX_PushArgumentString("ZREVRANGEBYSCORE"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(FloatToString(max, 0)); - NWNX_PushArgumentString(FloatToString(min, 0)); - if (withscores != "") NWNX_PushArgumentString(withscores); - if (limit_offset != 0) NWNX_PushArgumentString(IntToString(limit_offset)); - if (limit_count != 0) NWNX_PushArgumentString(IntToString(limit_count)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZREVRANGEBYSCORE"); + NWNXPushString(key); + NWNXPushString(FloatToString(max, 0)); + NWNXPushString(FloatToString(min, 0)); + if (withscores != "") NWNXPushString(withscores); + if (limit_offset != 0) NWNXPushString(IntToString(limit_offset)); + if (limit_count != 0) NWNXPushString(IntToString(limit_count)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_ZREVRANK( string key, string member ) { - NWNX_PushArgumentString("ZREVRANK"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(member); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZREVRANK"); + NWNXPushString(key); + NWNXPushString(member); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_ZSCORE( string key, string member ) { - NWNX_PushArgumentString("ZSCORE"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(member); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZSCORE"); + NWNXPushString(key); + NWNXPushString(member); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_ZUNIONSTORE( @@ -5575,14 +5574,14 @@ int NWNX_Redis_ZUNIONSTORE( // Redis type: enum string aggregate_aggregate = "" ) { - NWNX_PushArgumentString("ZUNIONSTORE"); - NWNX_PushArgumentString(destination); - NWNX_PushArgumentString(IntToString(numkeys)); - NWNX_PushArgumentString(key); - if (weights_weight != 0) NWNX_PushArgumentString(IntToString(weights_weight)); - if (aggregate_aggregate != "") NWNX_PushArgumentString(aggregate_aggregate); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZUNIONSTORE"); + NWNXPushString(destination); + NWNXPushString(IntToString(numkeys)); + NWNXPushString(key); + if (weights_weight != 0) NWNXPushString(IntToString(weights_weight)); + if (aggregate_aggregate != "") NWNXPushString(aggregate_aggregate); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_SCAN( @@ -5594,13 +5593,13 @@ int NWNX_Redis_SCAN( int count_count = 0, string type_type = "" ) { - NWNX_PushArgumentString("SCAN"); - NWNX_PushArgumentString(IntToString(cursor)); - if (match_pattern != "") NWNX_PushArgumentString(match_pattern); - if (count_count != 0) NWNX_PushArgumentString(IntToString(count_count)); - if (type_type != "") NWNX_PushArgumentString(type_type); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SCAN"); + NWNXPushString(IntToString(cursor)); + if (match_pattern != "") NWNXPushString(match_pattern); + if (count_count != 0) NWNXPushString(IntToString(count_count)); + if (type_type != "") NWNXPushString(type_type); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_SSCAN( @@ -5612,13 +5611,13 @@ int NWNX_Redis_SSCAN( // Redis type: integer int count_count = 0 ) { - NWNX_PushArgumentString("SSCAN"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(cursor)); - if (match_pattern != "") NWNX_PushArgumentString(match_pattern); - if (count_count != 0) NWNX_PushArgumentString(IntToString(count_count)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SSCAN"); + NWNXPushString(key); + NWNXPushString(IntToString(cursor)); + if (match_pattern != "") NWNXPushString(match_pattern); + if (count_count != 0) NWNXPushString(IntToString(count_count)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_HSCAN( @@ -5630,13 +5629,13 @@ int NWNX_Redis_HSCAN( // Redis type: integer int count_count = 0 ) { - NWNX_PushArgumentString("HSCAN"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(cursor)); - if (match_pattern != "") NWNX_PushArgumentString(match_pattern); - if (count_count != 0) NWNX_PushArgumentString(IntToString(count_count)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("HSCAN"); + NWNXPushString(key); + NWNXPushString(IntToString(cursor)); + if (match_pattern != "") NWNXPushString(match_pattern); + if (count_count != 0) NWNXPushString(IntToString(count_count)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_ZSCAN( @@ -5648,13 +5647,13 @@ int NWNX_Redis_ZSCAN( // Redis type: integer int count_count = 0 ) { - NWNX_PushArgumentString("ZSCAN"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(cursor)); - if (match_pattern != "") NWNX_PushArgumentString(match_pattern); - if (count_count != 0) NWNX_PushArgumentString(IntToString(count_count)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZSCAN"); + NWNXPushString(key); + NWNXPushString(IntToString(cursor)); + if (match_pattern != "") NWNXPushString(match_pattern); + if (count_count != 0) NWNXPushString(IntToString(count_count)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_XINFO( @@ -5668,14 +5667,14 @@ int NWNX_Redis_XINFO( // Redis type: enum string help = "" ) { - NWNX_PushArgumentString("XINFO"); - if (consumers_key != "") NWNX_PushArgumentString(consumers_key); - if (consumers_groupname != "") NWNX_PushArgumentString(consumers_groupname); - if (groups_key != "") NWNX_PushArgumentString(groups_key); - if (stream_key != "") NWNX_PushArgumentString(stream_key); - if (help != "") NWNX_PushArgumentString(help); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("XINFO"); + if (consumers_key != "") NWNXPushString(consumers_key); + if (consumers_groupname != "") NWNXPushString(consumers_groupname); + if (groups_key != "") NWNXPushString(groups_key); + if (stream_key != "") NWNXPushString(stream_key); + if (help != "") NWNXPushString(help); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_XADD( @@ -5685,13 +5684,13 @@ int NWNX_Redis_XADD( string field, string str ) { - NWNX_PushArgumentString("XADD"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(ID); - NWNX_PushArgumentString(field); - NWNX_PushArgumentString(str); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("XADD"); + NWNXPushString(key); + NWNXPushString(ID); + NWNXPushString(field); + NWNXPushString(str); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_XTRIM( @@ -5703,24 +5702,24 @@ int NWNX_Redis_XTRIM( // Redis type: integer int count = 0 ) { - NWNX_PushArgumentString("XTRIM"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(strategy); - if (approx != "") NWNX_PushArgumentString(approx); - NWNX_PushArgumentString(IntToString(count)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("XTRIM"); + NWNXPushString(key); + NWNXPushString(strategy); + if (approx != "") NWNXPushString(approx); + NWNXPushString(IntToString(count)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_XDEL( string key, string ID ) { - NWNX_PushArgumentString("XDEL"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(ID); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("XDEL"); + NWNXPushString(key); + NWNXPushString(ID); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_XRANGE( @@ -5730,13 +5729,13 @@ int NWNX_Redis_XRANGE( // Redis type: integer int count_count = 0 ) { - NWNX_PushArgumentString("XRANGE"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(start); - NWNX_PushArgumentString(end); - if (count_count != 0) NWNX_PushArgumentString(IntToString(count_count)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("XRANGE"); + NWNXPushString(key); + NWNXPushString(start); + NWNXPushString(end); + if (count_count != 0) NWNXPushString(IntToString(count_count)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_XREVRANGE( @@ -5746,22 +5745,22 @@ int NWNX_Redis_XREVRANGE( // Redis type: integer int count_count = 0 ) { - NWNX_PushArgumentString("XREVRANGE"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(end); - NWNX_PushArgumentString(start); - if (count_count != 0) NWNX_PushArgumentString(IntToString(count_count)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("XREVRANGE"); + NWNXPushString(key); + NWNXPushString(end); + NWNXPushString(start); + if (count_count != 0) NWNXPushString(IntToString(count_count)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_XLEN( string key ) { - NWNX_PushArgumentString("XLEN"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("XLEN"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_XREAD( @@ -5774,14 +5773,14 @@ int NWNX_Redis_XREAD( string key = "", string ID = "" ) { - NWNX_PushArgumentString("XREAD"); - if (count_count != 0) NWNX_PushArgumentString(IntToString(count_count)); - if (block_milliseconds != 0) NWNX_PushArgumentString(IntToString(block_milliseconds)); - NWNX_PushArgumentString(streams); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(ID); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("XREAD"); + if (count_count != 0) NWNXPushString(IntToString(count_count)); + if (block_milliseconds != 0) NWNXPushString(IntToString(block_milliseconds)); + NWNXPushString(streams); + NWNXPushString(key); + NWNXPushString(ID); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_XGROUP( @@ -5801,20 +5800,20 @@ int NWNX_Redis_XGROUP( string delconsumer_groupname = "", string delconsumer_consumername = "" ) { - NWNX_PushArgumentString("XGROUP"); - if (create_key != "") NWNX_PushArgumentString(create_key); - if (create_groupname != "") NWNX_PushArgumentString(create_groupname); - if (create_id_or__ != "") NWNX_PushArgumentString(create_id_or__); - if (setid_key != "") NWNX_PushArgumentString(setid_key); - if (setid_groupname != "") NWNX_PushArgumentString(setid_groupname); - if (setid_id_or__ != "") NWNX_PushArgumentString(setid_id_or__); - if (destroy_key != "") NWNX_PushArgumentString(destroy_key); - if (destroy_groupname != "") NWNX_PushArgumentString(destroy_groupname); - if (delconsumer_key != "") NWNX_PushArgumentString(delconsumer_key); - if (delconsumer_groupname != "") NWNX_PushArgumentString(delconsumer_groupname); - if (delconsumer_consumername != "") NWNX_PushArgumentString(delconsumer_consumername); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("XGROUP"); + if (create_key != "") NWNXPushString(create_key); + if (create_groupname != "") NWNXPushString(create_groupname); + if (create_id_or__ != "") NWNXPushString(create_id_or__); + if (setid_key != "") NWNXPushString(setid_key); + if (setid_groupname != "") NWNXPushString(setid_groupname); + if (setid_id_or__ != "") NWNXPushString(setid_id_or__); + if (destroy_key != "") NWNXPushString(destroy_key); + if (destroy_groupname != "") NWNXPushString(destroy_groupname); + if (delconsumer_key != "") NWNXPushString(delconsumer_key); + if (delconsumer_groupname != "") NWNXPushString(delconsumer_groupname); + if (delconsumer_consumername != "") NWNXPushString(delconsumer_consumername); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_XREADGROUP( @@ -5831,17 +5830,17 @@ int NWNX_Redis_XREADGROUP( string key = "", string ID = "" ) { - NWNX_PushArgumentString("XREADGROUP"); - NWNX_PushArgumentString(group_group); - NWNX_PushArgumentString(group_consumer); - if (count_count != 0) NWNX_PushArgumentString(IntToString(count_count)); - if (block_milliseconds != 0) NWNX_PushArgumentString(IntToString(block_milliseconds)); - if (noack != "") NWNX_PushArgumentString(noack); - NWNX_PushArgumentString(streams); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(ID); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("XREADGROUP"); + NWNXPushString(group_group); + NWNXPushString(group_consumer); + if (count_count != 0) NWNXPushString(IntToString(count_count)); + if (block_milliseconds != 0) NWNXPushString(IntToString(block_milliseconds)); + if (noack != "") NWNXPushString(noack); + NWNXPushString(streams); + NWNXPushString(key); + NWNXPushString(ID); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_XACK( @@ -5849,12 +5848,12 @@ int NWNX_Redis_XACK( string group, string ID ) { - NWNX_PushArgumentString("XACK"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(group); - NWNX_PushArgumentString(ID); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("XACK"); + NWNXPushString(key); + NWNXPushString(group); + NWNXPushString(ID); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_XCLAIM( @@ -5870,17 +5869,17 @@ int NWNX_Redis_XCLAIM( // Redis type: integer int retrycount_count = 0 ) { - NWNX_PushArgumentString("XCLAIM"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(group); - NWNX_PushArgumentString(consumer); - NWNX_PushArgumentString(min_idle_time); - NWNX_PushArgumentString(ID); - if (idle_ms != 0) NWNX_PushArgumentString(IntToString(idle_ms)); - if (time_ms_unix_time != 0) NWNX_PushArgumentString(IntToString(time_ms_unix_time)); - if (retrycount_count != 0) NWNX_PushArgumentString(IntToString(retrycount_count)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("XCLAIM"); + NWNXPushString(key); + NWNXPushString(group); + NWNXPushString(consumer); + NWNXPushString(min_idle_time); + NWNXPushString(ID); + if (idle_ms != 0) NWNXPushString(IntToString(idle_ms)); + if (time_ms_unix_time != 0) NWNXPushString(IntToString(time_ms_unix_time)); + if (retrycount_count != 0) NWNXPushString(IntToString(retrycount_count)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int NWNX_Redis_XPENDING( @@ -5892,15 +5891,15 @@ int NWNX_Redis_XPENDING( int count = 0, string consumer = "" ) { - NWNX_PushArgumentString("XPENDING"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(group); - if (start != "") NWNX_PushArgumentString(start); - if (end != "") NWNX_PushArgumentString(end); - if (count != 0) NWNX_PushArgumentString(IntToString(count)); - if (consumer != "") NWNX_PushArgumentString(consumer); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("XPENDING"); + NWNXPushString(key); + NWNXPushString(group); + if (start != "") NWNXPushString(start); + if (end != "") NWNXPushString(end); + if (count != 0) NWNXPushString(IntToString(count)); + if (consumer != "") NWNXPushString(consumer); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } /// @} diff --git a/_module/nss/nwnx_redis_lib.nss b/_module/nss/nwnx_redis_lib.nss index 1593345f..ce931a2b 100644 --- a/_module/nss/nwnx_redis_lib.nss +++ b/_module/nss/nwnx_redis_lib.nss @@ -3,7 +3,6 @@ /// @{ /// @file nwnx_redis_lib.nss /// @brief Allows connection and interfacing with a redis server. -#include "nwnx" /// @anchor redis_results /// @name Redis Results @@ -65,44 +64,44 @@ string NWNX_Redis_GetResultAsString(int resultId); int NWNX_Redis_GetResultType(int resultId) { - NWNX_PushArgumentInt(resultId); - NWNX_CallFunction("NWNX_Redis", "GetResultType"); - return NWNX_GetReturnValueInt(); + NWNXPushInt(resultId); + NWNXCall("NWNX_Redis", "GetResultType"); + return NWNXPopInt(); } int NWNX_Redis_GetArrayLength(int resultId) { - NWNX_PushArgumentInt(resultId); - NWNX_CallFunction("NWNX_Redis", "GetResultArrayLength"); - return NWNX_GetReturnValueInt(); + NWNXPushInt(resultId); + NWNXCall("NWNX_Redis", "GetResultArrayLength"); + return NWNXPopInt(); } // Returns the last int NWNX_Redis_GetArrayElement(int resultId, int idx) { - NWNX_PushArgumentInt(resultId); - NWNX_PushArgumentInt(idx); - NWNX_CallFunction("NWNX_Redis", "GetResultArrayElement"); - return NWNX_GetReturnValueInt(); + NWNXPushInt(resultId); + NWNXPushInt(idx); + NWNXCall("NWNX_Redis", "GetResultArrayElement"); + return NWNXPopInt(); } float NWNX_Redis_GetResultAsFloat(int resultId) { - NWNX_PushArgumentInt(resultId); - NWNX_CallFunction("NWNX_Redis", "GetResultAsString"); - return StringToFloat(NWNX_GetReturnValueString()); + NWNXPushInt(resultId); + NWNXCall("NWNX_Redis", "GetResultAsString"); + return StringToFloat(NWNXPopString()); } int NWNX_Redis_GetResultAsInt(int resultId) { - NWNX_PushArgumentInt(resultId); - NWNX_CallFunction("NWNX_Redis", "GetResultAsString"); - return StringToInt(NWNX_GetReturnValueString()); + NWNXPushInt(resultId); + NWNXCall("NWNX_Redis", "GetResultAsString"); + return StringToInt(NWNXPopString()); } string NWNX_Redis_GetResultAsString(int resultId) { - NWNX_PushArgumentInt(resultId); - NWNX_CallFunction("NWNX_Redis", "GetResultAsString"); - return NWNX_GetReturnValueString(); + NWNXPushInt(resultId); + NWNXCall("NWNX_Redis", "GetResultAsString"); + return NWNXPopString(); } diff --git a/_module/nss/nwnx_redis_ps.nss b/_module/nss/nwnx_redis_ps.nss index 83ca4485..ca03f317 100644 --- a/_module/nss/nwnx_redis_ps.nss +++ b/_module/nss/nwnx_redis_ps.nss @@ -2,7 +2,6 @@ /// @brief Interface to Redis PUBSUB /// @{ /// @file nwnx_redis_ps.nss -#include "nwnx" /// A redis PUBSUB message struct NWNX_Redis_PubSubMessageData { @@ -15,9 +14,9 @@ struct NWNX_Redis_PubSubMessageData { struct NWNX_Redis_PubSubMessageData NWNX_Redis_GetPubSubMessageData() { struct NWNX_Redis_PubSubMessageData ret; - NWNX_CallFunction("NWNX_Redis", "GetPubSubData"); - ret.message = NWNX_GetReturnValueString(); - ret.channel = NWNX_GetReturnValueString(); + NWNXCall("NWNX_Redis", "GetPubSubData"); + ret.message = NWNXPopString(); + ret.channel = NWNXPopString(); return ret; } /// @} diff --git a/_module/nss/nwnx_redis_short.nss b/_module/nss/nwnx_redis_short.nss index 53b2d01f..ec1945e6 100644 --- a/_module/nss/nwnx_redis_short.nss +++ b/_module/nss/nwnx_redis_short.nss @@ -1,4 +1,3 @@ -#include "nwnx" #include "nwnx_redis_lib" @@ -3230,32 +3229,32 @@ int APPEND( string key, string value ) { - NWNX_PushArgumentString("APPEND"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(value); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("APPEND"); + NWNXPushString(key); + NWNXPushString(value); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int AUTH( string password ) { - NWNX_PushArgumentString("AUTH"); - NWNX_PushArgumentString(password); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("AUTH"); + NWNXPushString(password); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int BGREWRITEAOF() { - NWNX_PushArgumentString("BGREWRITEAOF"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("BGREWRITEAOF"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int BGSAVE() { - NWNX_PushArgumentString("BGSAVE"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("BGSAVE"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int BITCOUNT( @@ -3265,12 +3264,12 @@ int BITCOUNT( // Redis type: integer int end = 0 ) { - NWNX_PushArgumentString("BITCOUNT"); - NWNX_PushArgumentString(key); - if (start != 0) NWNX_PushArgumentString(IntToString(start)); - if (end != 0) NWNX_PushArgumentString(IntToString(end)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("BITCOUNT"); + NWNXPushString(key); + if (start != 0) NWNXPushString(IntToString(start)); + if (end != 0) NWNXPushString(IntToString(end)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int BITFIELD( @@ -3292,18 +3291,18 @@ int BITFIELD( // Redis type: integer int incrby_increment = 0 ) { - NWNX_PushArgumentString("BITFIELD"); - NWNX_PushArgumentString(key); - if (get_type != "") NWNX_PushArgumentString(get_type); - if (get_offset != 0) NWNX_PushArgumentString(IntToString(get_offset)); - if (set_type != "") NWNX_PushArgumentString(set_type); - if (set_offset != 0) NWNX_PushArgumentString(IntToString(set_offset)); - if (set_value != 0) NWNX_PushArgumentString(IntToString(set_value)); - if (incrby_type != "") NWNX_PushArgumentString(incrby_type); - if (incrby_offset != 0) NWNX_PushArgumentString(IntToString(incrby_offset)); - if (incrby_increment != 0) NWNX_PushArgumentString(IntToString(incrby_increment)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("BITFIELD"); + NWNXPushString(key); + if (get_type != "") NWNXPushString(get_type); + if (get_offset != 0) NWNXPushString(IntToString(get_offset)); + if (set_type != "") NWNXPushString(set_type); + if (set_offset != 0) NWNXPushString(IntToString(set_offset)); + if (set_value != 0) NWNXPushString(IntToString(set_value)); + if (incrby_type != "") NWNXPushString(incrby_type); + if (incrby_offset != 0) NWNXPushString(IntToString(incrby_offset)); + if (incrby_increment != 0) NWNXPushString(IntToString(incrby_increment)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int BITOP( @@ -3312,12 +3311,12 @@ int BITOP( string destkey, string key ) { - NWNX_PushArgumentString("BITOP"); - NWNX_PushArgumentString(operation); - NWNX_PushArgumentString(destkey); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("BITOP"); + NWNXPushString(operation); + NWNXPushString(destkey); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int BITPOS( @@ -3329,13 +3328,13 @@ int BITPOS( // Redis type: integer int end = 0 ) { - NWNX_PushArgumentString("BITPOS"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(bit)); - if (start != 0) NWNX_PushArgumentString(IntToString(start)); - if (end != 0) NWNX_PushArgumentString(IntToString(end)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("BITPOS"); + NWNXPushString(key); + NWNXPushString(IntToString(bit)); + if (start != 0) NWNXPushString(IntToString(start)); + if (end != 0) NWNXPushString(IntToString(end)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int BLPOP( @@ -3343,11 +3342,11 @@ int BLPOP( // Redis type: integer int timeout ) { - NWNX_PushArgumentString("BLPOP"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(timeout)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("BLPOP"); + NWNXPushString(key); + NWNXPushString(IntToString(timeout)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int BRPOP( @@ -3355,11 +3354,11 @@ int BRPOP( // Redis type: integer int timeout ) { - NWNX_PushArgumentString("BRPOP"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(timeout)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("BRPOP"); + NWNXPushString(key); + NWNXPushString(IntToString(timeout)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int BRPOPLPUSH( @@ -3370,12 +3369,12 @@ int BRPOPLPUSH( // Redis type: integer int timeout ) { - NWNX_PushArgumentString("BRPOPLPUSH"); - NWNX_PushArgumentString(source); - NWNX_PushArgumentString(destination); - NWNX_PushArgumentString(IntToString(timeout)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("BRPOPLPUSH"); + NWNXPushString(source); + NWNXPushString(destination); + NWNXPushString(IntToString(timeout)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int BZPOPMIN( @@ -3383,11 +3382,11 @@ int BZPOPMIN( // Redis type: integer int timeout ) { - NWNX_PushArgumentString("BZPOPMIN"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(timeout)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("BZPOPMIN"); + NWNXPushString(key); + NWNXPushString(IntToString(timeout)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int BZPOPMAX( @@ -3395,17 +3394,17 @@ int BZPOPMAX( // Redis type: integer int timeout ) { - NWNX_PushArgumentString("BZPOPMAX"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(timeout)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("BZPOPMAX"); + NWNXPushString(key); + NWNXPushString(IntToString(timeout)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int CLIENT_ID() { - NWNX_PushArgumentString("CLIENT_ID"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLIENT_ID"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int CLIENT_KILL( @@ -3415,54 +3414,54 @@ int CLIENT_KILL( string addr_ip_port = "", string skipme_yes_no = "" ) { - NWNX_PushArgumentString("CLIENT_KILL"); - if (ip_port != "") NWNX_PushArgumentString(ip_port); - if (id_client_id != 0) NWNX_PushArgumentString(IntToString(id_client_id)); - if (addr_ip_port != "") NWNX_PushArgumentString(addr_ip_port); - if (skipme_yes_no != "") NWNX_PushArgumentString(skipme_yes_no); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLIENT_KILL"); + if (ip_port != "") NWNXPushString(ip_port); + if (id_client_id != 0) NWNXPushString(IntToString(id_client_id)); + if (addr_ip_port != "") NWNXPushString(addr_ip_port); + if (skipme_yes_no != "") NWNXPushString(skipme_yes_no); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int CLIENT_LIST() { - NWNX_PushArgumentString("CLIENT_LIST"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLIENT_LIST"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int CLIENT_GETNAME() { - NWNX_PushArgumentString("CLIENT_GETNAME"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLIENT_GETNAME"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int CLIENT_PAUSE( // Redis type: integer int timeout ) { - NWNX_PushArgumentString("CLIENT_PAUSE"); - NWNX_PushArgumentString(IntToString(timeout)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLIENT_PAUSE"); + NWNXPushString(IntToString(timeout)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int CLIENT_REPLY( // Redis type: enum string reply_mode ) { - NWNX_PushArgumentString("CLIENT_REPLY"); - NWNX_PushArgumentString(reply_mode); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLIENT_REPLY"); + NWNXPushString(reply_mode); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int CLIENT_SETNAME( string connection_name ) { - NWNX_PushArgumentString("CLIENT_SETNAME"); - NWNX_PushArgumentString(connection_name); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLIENT_SETNAME"); + NWNXPushString(connection_name); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int CLIENT_UNBLOCK( @@ -3470,69 +3469,69 @@ int CLIENT_UNBLOCK( // Redis type: enum string unblock_type = "" ) { - NWNX_PushArgumentString("CLIENT_UNBLOCK"); - NWNX_PushArgumentString(client_id); - if (unblock_type != "") NWNX_PushArgumentString(unblock_type); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLIENT_UNBLOCK"); + NWNXPushString(client_id); + if (unblock_type != "") NWNXPushString(unblock_type); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int CLUSTER_ADDSLOTS( // Redis type: integer int slot ) { - NWNX_PushArgumentString("CLUSTER_ADDSLOTS"); - NWNX_PushArgumentString(IntToString(slot)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLUSTER_ADDSLOTS"); + NWNXPushString(IntToString(slot)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int CLUSTER_COUNT_FAILURE_REPORTS( string node_id ) { - NWNX_PushArgumentString("CLUSTER_COUNT_FAILURE_REPORTS"); - NWNX_PushArgumentString(node_id); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLUSTER_COUNT_FAILURE_REPORTS"); + NWNXPushString(node_id); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int CLUSTER_COUNTKEYSINSLOT( // Redis type: integer int slot ) { - NWNX_PushArgumentString("CLUSTER_COUNTKEYSINSLOT"); - NWNX_PushArgumentString(IntToString(slot)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLUSTER_COUNTKEYSINSLOT"); + NWNXPushString(IntToString(slot)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int CLUSTER_DELSLOTS( // Redis type: integer int slot ) { - NWNX_PushArgumentString("CLUSTER_DELSLOTS"); - NWNX_PushArgumentString(IntToString(slot)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLUSTER_DELSLOTS"); + NWNXPushString(IntToString(slot)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int CLUSTER_FAILOVER( // Redis type: enum string options = "" ) { - NWNX_PushArgumentString("CLUSTER_FAILOVER"); - if (options != "") NWNX_PushArgumentString(options); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLUSTER_FAILOVER"); + if (options != "") NWNXPushString(options); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int CLUSTER_FORGET( string node_id ) { - NWNX_PushArgumentString("CLUSTER_FORGET"); - NWNX_PushArgumentString(node_id); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLUSTER_FORGET"); + NWNXPushString(node_id); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int CLUSTER_GETKEYSINSLOT( @@ -3541,26 +3540,26 @@ int CLUSTER_GETKEYSINSLOT( // Redis type: integer int count ) { - NWNX_PushArgumentString("CLUSTER_GETKEYSINSLOT"); - NWNX_PushArgumentString(IntToString(slot)); - NWNX_PushArgumentString(IntToString(count)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLUSTER_GETKEYSINSLOT"); + NWNXPushString(IntToString(slot)); + NWNXPushString(IntToString(count)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int CLUSTER_INFO() { - NWNX_PushArgumentString("CLUSTER_INFO"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLUSTER_INFO"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int CLUSTER_KEYSLOT( string key ) { - NWNX_PushArgumentString("CLUSTER_KEYSLOT"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLUSTER_KEYSLOT"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int CLUSTER_MEET( @@ -3568,52 +3567,52 @@ int CLUSTER_MEET( // Redis type: integer int port ) { - NWNX_PushArgumentString("CLUSTER_MEET"); - NWNX_PushArgumentString(ip); - NWNX_PushArgumentString(IntToString(port)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLUSTER_MEET"); + NWNXPushString(ip); + NWNXPushString(IntToString(port)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int CLUSTER_NODES() { - NWNX_PushArgumentString("CLUSTER_NODES"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLUSTER_NODES"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int CLUSTER_REPLICATE( string node_id ) { - NWNX_PushArgumentString("CLUSTER_REPLICATE"); - NWNX_PushArgumentString(node_id); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLUSTER_REPLICATE"); + NWNXPushString(node_id); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int CLUSTER_RESET( // Redis type: enum string reset_type = "" ) { - NWNX_PushArgumentString("CLUSTER_RESET"); - if (reset_type != "") NWNX_PushArgumentString(reset_type); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLUSTER_RESET"); + if (reset_type != "") NWNXPushString(reset_type); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int CLUSTER_SAVECONFIG() { - NWNX_PushArgumentString("CLUSTER_SAVECONFIG"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLUSTER_SAVECONFIG"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int CLUSTER_SET_CONFIG_EPOCH( // Redis type: integer int config_epoch ) { - NWNX_PushArgumentString("CLUSTER_SET_CONFIG_EPOCH"); - NWNX_PushArgumentString(IntToString(config_epoch)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLUSTER_SET_CONFIG_EPOCH"); + NWNXPushString(IntToString(config_epoch)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int CLUSTER_SETSLOT( @@ -3623,125 +3622,125 @@ int CLUSTER_SETSLOT( string subcommand, string node_id = "" ) { - NWNX_PushArgumentString("CLUSTER_SETSLOT"); - NWNX_PushArgumentString(IntToString(slot)); - NWNX_PushArgumentString(subcommand); - if (node_id != "") NWNX_PushArgumentString(node_id); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLUSTER_SETSLOT"); + NWNXPushString(IntToString(slot)); + NWNXPushString(subcommand); + if (node_id != "") NWNXPushString(node_id); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int CLUSTER_SLAVES( string node_id ) { - NWNX_PushArgumentString("CLUSTER_SLAVES"); - NWNX_PushArgumentString(node_id); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLUSTER_SLAVES"); + NWNXPushString(node_id); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int CLUSTER_REPLICAS( string node_id ) { - NWNX_PushArgumentString("CLUSTER_REPLICAS"); - NWNX_PushArgumentString(node_id); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLUSTER_REPLICAS"); + NWNXPushString(node_id); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int CLUSTER_SLOTS() { - NWNX_PushArgumentString("CLUSTER_SLOTS"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CLUSTER_SLOTS"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int COMMAND() { - NWNX_PushArgumentString("COMMAND"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("COMMAND"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int COMMAND_COUNT() { - NWNX_PushArgumentString("COMMAND_COUNT"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("COMMAND_COUNT"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int COMMAND_GETKEYS() { - NWNX_PushArgumentString("COMMAND_GETKEYS"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("COMMAND_GETKEYS"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int COMMAND_INFO( string command_name ) { - NWNX_PushArgumentString("COMMAND_INFO"); - NWNX_PushArgumentString(command_name); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("COMMAND_INFO"); + NWNXPushString(command_name); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int CONFIG_GET( string parameter ) { - NWNX_PushArgumentString("CONFIG_GET"); - NWNX_PushArgumentString(parameter); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CONFIG_GET"); + NWNXPushString(parameter); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int CONFIG_REWRITE() { - NWNX_PushArgumentString("CONFIG_REWRITE"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CONFIG_REWRITE"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int CONFIG_SET( string parameter, string value ) { - NWNX_PushArgumentString("CONFIG_SET"); - NWNX_PushArgumentString(parameter); - NWNX_PushArgumentString(value); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CONFIG_SET"); + NWNXPushString(parameter); + NWNXPushString(value); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int CONFIG_RESETSTAT() { - NWNX_PushArgumentString("CONFIG_RESETSTAT"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("CONFIG_RESETSTAT"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int DBSIZE() { - NWNX_PushArgumentString("DBSIZE"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("DBSIZE"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int DEBUG_OBJECT( string key ) { - NWNX_PushArgumentString("DEBUG_OBJECT"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("DEBUG_OBJECT"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int DEBUG_SEGFAULT() { - NWNX_PushArgumentString("DEBUG_SEGFAULT"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("DEBUG_SEGFAULT"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int DECR( string key ) { - NWNX_PushArgumentString("DECR"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("DECR"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int DECRBY( @@ -3749,44 +3748,44 @@ int DECRBY( // Redis type: integer int decrement ) { - NWNX_PushArgumentString("DECRBY"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(decrement)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("DECRBY"); + NWNXPushString(key); + NWNXPushString(IntToString(decrement)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int DEL( string key ) { - NWNX_PushArgumentString("DEL"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("DEL"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int DISCARD() { - NWNX_PushArgumentString("DISCARD"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("DISCARD"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int DUMP( string key ) { - NWNX_PushArgumentString("DUMP"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("DUMP"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int ECHO( string message ) { - NWNX_PushArgumentString("ECHO"); - NWNX_PushArgumentString(message); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ECHO"); + NWNXPushString(message); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int EVAL( @@ -3796,13 +3795,13 @@ int EVAL( string key, string arg ) { - NWNX_PushArgumentString("EVAL"); - NWNX_PushArgumentString(script); - NWNX_PushArgumentString(IntToString(numkeys)); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(arg); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("EVAL"); + NWNXPushString(script); + NWNXPushString(IntToString(numkeys)); + NWNXPushString(key); + NWNXPushString(arg); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int EVALSHA( @@ -3812,28 +3811,28 @@ int EVALSHA( string key, string arg ) { - NWNX_PushArgumentString("EVALSHA"); - NWNX_PushArgumentString(sha1); - NWNX_PushArgumentString(IntToString(numkeys)); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(arg); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("EVALSHA"); + NWNXPushString(sha1); + NWNXPushString(IntToString(numkeys)); + NWNXPushString(key); + NWNXPushString(arg); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int EXEC() { - NWNX_PushArgumentString("EXEC"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("EXEC"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int EXISTS( string key ) { - NWNX_PushArgumentString("EXISTS"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("EXISTS"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int EXPIRE( @@ -3841,11 +3840,11 @@ int EXPIRE( // Redis type: integer int seconds ) { - NWNX_PushArgumentString("EXPIRE"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(seconds)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("EXPIRE"); + NWNXPushString(key); + NWNXPushString(IntToString(seconds)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int EXPIREAT( @@ -3853,31 +3852,31 @@ int EXPIREAT( // Redis type: posix time string timestamp ) { - NWNX_PushArgumentString("EXPIREAT"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(timestamp); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("EXPIREAT"); + NWNXPushString(key); + NWNXPushString(timestamp); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int FLUSHALL( // Redis type: enum string async = "" ) { - NWNX_PushArgumentString("FLUSHALL"); - if (async != "") NWNX_PushArgumentString(async); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("FLUSHALL"); + if (async != "") NWNXPushString(async); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int FLUSHDB( // Redis type: enum string async = "" ) { - NWNX_PushArgumentString("FLUSHDB"); - if (async != "") NWNX_PushArgumentString(async); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("FLUSHDB"); + if (async != "") NWNXPushString(async); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int GEOADD( @@ -3888,35 +3887,35 @@ int GEOADD( float latitude, string member ) { - NWNX_PushArgumentString("GEOADD"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(FloatToString(longitude, 0)); - NWNX_PushArgumentString(FloatToString(latitude, 0)); - NWNX_PushArgumentString(member); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("GEOADD"); + NWNXPushString(key); + NWNXPushString(FloatToString(longitude, 0)); + NWNXPushString(FloatToString(latitude, 0)); + NWNXPushString(member); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int GEOHASH( string key, string member ) { - NWNX_PushArgumentString("GEOHASH"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(member); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("GEOHASH"); + NWNXPushString(key); + NWNXPushString(member); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int GEOPOS( string key, string member ) { - NWNX_PushArgumentString("GEOPOS"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(member); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("GEOPOS"); + NWNXPushString(key); + NWNXPushString(member); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int GEODIST( @@ -3925,13 +3924,13 @@ int GEODIST( string member2, string unit = "" ) { - NWNX_PushArgumentString("GEODIST"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(member1); - NWNX_PushArgumentString(member2); - if (unit != "") NWNX_PushArgumentString(unit); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("GEODIST"); + NWNXPushString(key); + NWNXPushString(member1); + NWNXPushString(member2); + if (unit != "") NWNXPushString(unit); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int GEORADIUS( @@ -3959,21 +3958,21 @@ int GEORADIUS( // Redis type: key string storedist_key = "" ) { - NWNX_PushArgumentString("GEORADIUS"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(FloatToString(longitude, 0)); - NWNX_PushArgumentString(FloatToString(latitude, 0)); - NWNX_PushArgumentString(FloatToString(radius, 0)); - NWNX_PushArgumentString(unit); - if (withcoord != "") NWNX_PushArgumentString(withcoord); - if (withdist != "") NWNX_PushArgumentString(withdist); - if (withhash != "") NWNX_PushArgumentString(withhash); - if (count_count != 0) NWNX_PushArgumentString(IntToString(count_count)); - if (order != "") NWNX_PushArgumentString(order); - if (store_key != "") NWNX_PushArgumentString(store_key); - if (storedist_key != "") NWNX_PushArgumentString(storedist_key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("GEORADIUS"); + NWNXPushString(key); + NWNXPushString(FloatToString(longitude, 0)); + NWNXPushString(FloatToString(latitude, 0)); + NWNXPushString(FloatToString(radius, 0)); + NWNXPushString(unit); + if (withcoord != "") NWNXPushString(withcoord); + if (withdist != "") NWNXPushString(withdist); + if (withhash != "") NWNXPushString(withhash); + if (count_count != 0) NWNXPushString(IntToString(count_count)); + if (order != "") NWNXPushString(order); + if (store_key != "") NWNXPushString(store_key); + if (storedist_key != "") NWNXPushString(storedist_key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int GEORADIUSBYMEMBER( @@ -3998,29 +3997,29 @@ int GEORADIUSBYMEMBER( // Redis type: key string storedist_key = "" ) { - NWNX_PushArgumentString("GEORADIUSBYMEMBER"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(member); - NWNX_PushArgumentString(FloatToString(radius, 0)); - NWNX_PushArgumentString(unit); - if (withcoord != "") NWNX_PushArgumentString(withcoord); - if (withdist != "") NWNX_PushArgumentString(withdist); - if (withhash != "") NWNX_PushArgumentString(withhash); - if (count_count != 0) NWNX_PushArgumentString(IntToString(count_count)); - if (order != "") NWNX_PushArgumentString(order); - if (store_key != "") NWNX_PushArgumentString(store_key); - if (storedist_key != "") NWNX_PushArgumentString(storedist_key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("GEORADIUSBYMEMBER"); + NWNXPushString(key); + NWNXPushString(member); + NWNXPushString(FloatToString(radius, 0)); + NWNXPushString(unit); + if (withcoord != "") NWNXPushString(withcoord); + if (withdist != "") NWNXPushString(withdist); + if (withhash != "") NWNXPushString(withhash); + if (count_count != 0) NWNXPushString(IntToString(count_count)); + if (order != "") NWNXPushString(order); + if (store_key != "") NWNXPushString(store_key); + if (storedist_key != "") NWNXPushString(storedist_key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int GET( string key ) { - NWNX_PushArgumentString("GET"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("GET"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int GETBIT( @@ -4028,11 +4027,11 @@ int GETBIT( // Redis type: integer int offset ) { - NWNX_PushArgumentString("GETBIT"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(offset)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("GETBIT"); + NWNXPushString(key); + NWNXPushString(IntToString(offset)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int GETRANGE( @@ -4042,65 +4041,65 @@ int GETRANGE( // Redis type: integer int end ) { - NWNX_PushArgumentString("GETRANGE"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(start)); - NWNX_PushArgumentString(IntToString(end)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("GETRANGE"); + NWNXPushString(key); + NWNXPushString(IntToString(start)); + NWNXPushString(IntToString(end)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int GETSET( string key, string value ) { - NWNX_PushArgumentString("GETSET"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(value); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("GETSET"); + NWNXPushString(key); + NWNXPushString(value); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int HDEL( string key, string field ) { - NWNX_PushArgumentString("HDEL"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(field); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("HDEL"); + NWNXPushString(key); + NWNXPushString(field); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int HEXISTS( string key, string field ) { - NWNX_PushArgumentString("HEXISTS"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(field); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("HEXISTS"); + NWNXPushString(key); + NWNXPushString(field); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int HGET( string key, string field ) { - NWNX_PushArgumentString("HGET"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(field); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("HGET"); + NWNXPushString(key); + NWNXPushString(field); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int HGETALL( string key ) { - NWNX_PushArgumentString("HGETALL"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("HGETALL"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int HINCRBY( @@ -4109,12 +4108,12 @@ int HINCRBY( // Redis type: integer int increment ) { - NWNX_PushArgumentString("HINCRBY"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(field); - NWNX_PushArgumentString(IntToString(increment)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("HINCRBY"); + NWNXPushString(key); + NWNXPushString(field); + NWNXPushString(IntToString(increment)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int HINCRBYFLOAT( @@ -4123,41 +4122,41 @@ int HINCRBYFLOAT( // Redis type: double float increment ) { - NWNX_PushArgumentString("HINCRBYFLOAT"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(field); - NWNX_PushArgumentString(FloatToString(increment, 0)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("HINCRBYFLOAT"); + NWNXPushString(key); + NWNXPushString(field); + NWNXPushString(FloatToString(increment, 0)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int HKEYS( string key ) { - NWNX_PushArgumentString("HKEYS"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("HKEYS"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int HLEN( string key ) { - NWNX_PushArgumentString("HLEN"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("HLEN"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int HMGET( string key, string field ) { - NWNX_PushArgumentString("HMGET"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(field); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("HMGET"); + NWNXPushString(key); + NWNXPushString(field); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int HMSET( @@ -4165,12 +4164,12 @@ int HMSET( string field, string value ) { - NWNX_PushArgumentString("HMSET"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(field); - NWNX_PushArgumentString(value); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("HMSET"); + NWNXPushString(key); + NWNXPushString(field); + NWNXPushString(value); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int HSET( @@ -4178,12 +4177,12 @@ int HSET( string field, string value ) { - NWNX_PushArgumentString("HSET"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(field); - NWNX_PushArgumentString(value); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("HSET"); + NWNXPushString(key); + NWNXPushString(field); + NWNXPushString(value); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int HSETNX( @@ -4191,41 +4190,41 @@ int HSETNX( string field, string value ) { - NWNX_PushArgumentString("HSETNX"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(field); - NWNX_PushArgumentString(value); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("HSETNX"); + NWNXPushString(key); + NWNXPushString(field); + NWNXPushString(value); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int HSTRLEN( string key, string field ) { - NWNX_PushArgumentString("HSTRLEN"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(field); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("HSTRLEN"); + NWNXPushString(key); + NWNXPushString(field); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int HVALS( string key ) { - NWNX_PushArgumentString("HVALS"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("HVALS"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int INCR( string key ) { - NWNX_PushArgumentString("INCR"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("INCR"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int INCRBY( @@ -4233,11 +4232,11 @@ int INCRBY( // Redis type: integer int increment ) { - NWNX_PushArgumentString("INCRBY"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(increment)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("INCRBY"); + NWNXPushString(key); + NWNXPushString(IntToString(increment)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int INCRBYFLOAT( @@ -4245,35 +4244,35 @@ int INCRBYFLOAT( // Redis type: double float increment ) { - NWNX_PushArgumentString("INCRBYFLOAT"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(FloatToString(increment, 0)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("INCRBYFLOAT"); + NWNXPushString(key); + NWNXPushString(FloatToString(increment, 0)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int INFO( string section = "" ) { - NWNX_PushArgumentString("INFO"); - if (section != "") NWNX_PushArgumentString(section); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("INFO"); + if (section != "") NWNXPushString(section); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int KEYS( string pattern ) { - NWNX_PushArgumentString("KEYS"); - NWNX_PushArgumentString(pattern); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("KEYS"); + NWNXPushString(pattern); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int LASTSAVE() { - NWNX_PushArgumentString("LASTSAVE"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("LASTSAVE"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int LINDEX( @@ -4281,11 +4280,11 @@ int LINDEX( // Redis type: integer int index ) { - NWNX_PushArgumentString("LINDEX"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(index)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("LINDEX"); + NWNXPushString(key); + NWNXPushString(IntToString(index)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int LINSERT( @@ -4295,53 +4294,53 @@ int LINSERT( string pivot, string value ) { - NWNX_PushArgumentString("LINSERT"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(where); - NWNX_PushArgumentString(pivot); - NWNX_PushArgumentString(value); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("LINSERT"); + NWNXPushString(key); + NWNXPushString(where); + NWNXPushString(pivot); + NWNXPushString(value); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int LLEN( string key ) { - NWNX_PushArgumentString("LLEN"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("LLEN"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int LPOP( string key ) { - NWNX_PushArgumentString("LPOP"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("LPOP"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int LPUSH( string key, string value ) { - NWNX_PushArgumentString("LPUSH"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(value); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("LPUSH"); + NWNXPushString(key); + NWNXPushString(value); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int LPUSHX( string key, string value ) { - NWNX_PushArgumentString("LPUSHX"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(value); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("LPUSHX"); + NWNXPushString(key); + NWNXPushString(value); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int LRANGE( @@ -4351,12 +4350,12 @@ int LRANGE( // Redis type: integer int stop ) { - NWNX_PushArgumentString("LRANGE"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(start)); - NWNX_PushArgumentString(IntToString(stop)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("LRANGE"); + NWNXPushString(key); + NWNXPushString(IntToString(start)); + NWNXPushString(IntToString(stop)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int LREM( @@ -4365,12 +4364,12 @@ int LREM( int count, string value ) { - NWNX_PushArgumentString("LREM"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(count)); - NWNX_PushArgumentString(value); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("LREM"); + NWNXPushString(key); + NWNXPushString(IntToString(count)); + NWNXPushString(value); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int LSET( @@ -4379,12 +4378,12 @@ int LSET( int index, string value ) { - NWNX_PushArgumentString("LSET"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(index)); - NWNX_PushArgumentString(value); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("LSET"); + NWNXPushString(key); + NWNXPushString(IntToString(index)); + NWNXPushString(value); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int LTRIM( @@ -4394,42 +4393,42 @@ int LTRIM( // Redis type: integer int stop ) { - NWNX_PushArgumentString("LTRIM"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(start)); - NWNX_PushArgumentString(IntToString(stop)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("LTRIM"); + NWNXPushString(key); + NWNXPushString(IntToString(start)); + NWNXPushString(IntToString(stop)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int MEMORY_DOCTOR() { - NWNX_PushArgumentString("MEMORY_DOCTOR"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("MEMORY_DOCTOR"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int MEMORY_HELP() { - NWNX_PushArgumentString("MEMORY_HELP"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("MEMORY_HELP"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int MEMORY_MALLOC_STATS() { - NWNX_PushArgumentString("MEMORY_MALLOC_STATS"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("MEMORY_MALLOC_STATS"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int MEMORY_PURGE() { - NWNX_PushArgumentString("MEMORY_PURGE"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("MEMORY_PURGE"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int MEMORY_STATS() { - NWNX_PushArgumentString("MEMORY_STATS"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("MEMORY_STATS"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int MEMORY_USAGE( @@ -4437,20 +4436,20 @@ int MEMORY_USAGE( // Redis type: integer int samples_count = 0 ) { - NWNX_PushArgumentString("MEMORY_USAGE"); - NWNX_PushArgumentString(key); - if (samples_count != 0) NWNX_PushArgumentString(IntToString(samples_count)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("MEMORY_USAGE"); + NWNXPushString(key); + if (samples_count != 0) NWNXPushString(IntToString(samples_count)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int MGET( string key ) { - NWNX_PushArgumentString("MGET"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("MGET"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int MIGRATE( @@ -4470,24 +4469,24 @@ int MIGRATE( // Redis type: key string keys_key = "" ) { - NWNX_PushArgumentString("MIGRATE"); - NWNX_PushArgumentString(host); - NWNX_PushArgumentString(port); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(destination_db)); - NWNX_PushArgumentString(IntToString(timeout)); - if (copy != "") NWNX_PushArgumentString(copy); - if (replace != "") NWNX_PushArgumentString(replace); - if (auth_password != "") NWNX_PushArgumentString(auth_password); - if (keys_key != "") NWNX_PushArgumentString(keys_key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("MIGRATE"); + NWNXPushString(host); + NWNXPushString(port); + NWNXPushString(key); + NWNXPushString(IntToString(destination_db)); + NWNXPushString(IntToString(timeout)); + if (copy != "") NWNXPushString(copy); + if (replace != "") NWNXPushString(replace); + if (auth_password != "") NWNXPushString(auth_password); + if (keys_key != "") NWNXPushString(keys_key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int MONITOR() { - NWNX_PushArgumentString("MONITOR"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("MONITOR"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int MOVE( @@ -4495,59 +4494,59 @@ int MOVE( // Redis type: integer int db ) { - NWNX_PushArgumentString("MOVE"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(db)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("MOVE"); + NWNXPushString(key); + NWNXPushString(IntToString(db)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int MSET( string key, string value ) { - NWNX_PushArgumentString("MSET"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(value); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("MSET"); + NWNXPushString(key); + NWNXPushString(value); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int MSETNX( string key, string value ) { - NWNX_PushArgumentString("MSETNX"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(value); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("MSETNX"); + NWNXPushString(key); + NWNXPushString(value); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int MULTI() { - NWNX_PushArgumentString("MULTI"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("MULTI"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int OBJECT( string subcommand, string arguments = "" ) { - NWNX_PushArgumentString("OBJECT"); - NWNX_PushArgumentString(subcommand); - if (arguments != "") NWNX_PushArgumentString(arguments); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("OBJECT"); + NWNXPushString(subcommand); + if (arguments != "") NWNXPushString(arguments); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int PERSIST( string key ) { - NWNX_PushArgumentString("PERSIST"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("PERSIST"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int PEXPIRE( @@ -4555,11 +4554,11 @@ int PEXPIRE( // Redis type: integer int milliseconds ) { - NWNX_PushArgumentString("PEXPIRE"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(milliseconds)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("PEXPIRE"); + NWNXPushString(key); + NWNXPushString(IntToString(milliseconds)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int PEXPIREAT( @@ -4567,31 +4566,31 @@ int PEXPIREAT( // Redis type: posix time string milliseconds_timestamp ) { - NWNX_PushArgumentString("PEXPIREAT"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(milliseconds_timestamp); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("PEXPIREAT"); + NWNXPushString(key); + NWNXPushString(milliseconds_timestamp); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int PFADD( string key, string element ) { - NWNX_PushArgumentString("PFADD"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(element); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("PFADD"); + NWNXPushString(key); + NWNXPushString(element); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int PFCOUNT( string key ) { - NWNX_PushArgumentString("PFCOUNT"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("PFCOUNT"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int PFMERGE( @@ -4600,20 +4599,20 @@ int PFMERGE( // Redis type: key string sourcekey ) { - NWNX_PushArgumentString("PFMERGE"); - NWNX_PushArgumentString(destkey); - NWNX_PushArgumentString(sourcekey); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("PFMERGE"); + NWNXPushString(destkey); + NWNXPushString(sourcekey); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int PING( string message = "" ) { - NWNX_PushArgumentString("PING"); - if (message != "") NWNX_PushArgumentString(message); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("PING"); + if (message != "") NWNXPushString(message); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int PSETEX( @@ -4622,67 +4621,67 @@ int PSETEX( int milliseconds, string value ) { - NWNX_PushArgumentString("PSETEX"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(milliseconds)); - NWNX_PushArgumentString(value); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("PSETEX"); + NWNXPushString(key); + NWNXPushString(IntToString(milliseconds)); + NWNXPushString(value); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int PUBSUB( string subcommand, string argument = "" ) { - NWNX_PushArgumentString("PUBSUB"); - NWNX_PushArgumentString(subcommand); - if (argument != "") NWNX_PushArgumentString(argument); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("PUBSUB"); + NWNXPushString(subcommand); + if (argument != "") NWNXPushString(argument); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int PTTL( string key ) { - NWNX_PushArgumentString("PTTL"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("PTTL"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int PUBLISH( string channel, string message ) { - NWNX_PushArgumentString("PUBLISH"); - NWNX_PushArgumentString(channel); - NWNX_PushArgumentString(message); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("PUBLISH"); + NWNXPushString(channel); + NWNXPushString(message); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int QUIT() { - NWNX_PushArgumentString("QUIT"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("QUIT"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int RANDOMKEY() { - NWNX_PushArgumentString("RANDOMKEY"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("RANDOMKEY"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int READONLY() { - NWNX_PushArgumentString("READONLY"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("READONLY"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int READWRITE() { - NWNX_PushArgumentString("READWRITE"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("READWRITE"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int RENAME( @@ -4690,11 +4689,11 @@ int RENAME( // Redis type: key string newkey ) { - NWNX_PushArgumentString("RENAME"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(newkey); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("RENAME"); + NWNXPushString(key); + NWNXPushString(newkey); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int RENAMENX( @@ -4702,11 +4701,11 @@ int RENAMENX( // Redis type: key string newkey ) { - NWNX_PushArgumentString("RENAMENX"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(newkey); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("RENAMENX"); + NWNXPushString(key); + NWNXPushString(newkey); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int RESTORE( @@ -4723,31 +4722,31 @@ int RESTORE( // Redis type: integer int freq_frequency = 0 ) { - NWNX_PushArgumentString("RESTORE"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(ttl)); - NWNX_PushArgumentString(serialized_value); - if (replace != "") NWNX_PushArgumentString(replace); - if (absttl != "") NWNX_PushArgumentString(absttl); - if (idletime_seconds != 0) NWNX_PushArgumentString(IntToString(idletime_seconds)); - if (freq_frequency != 0) NWNX_PushArgumentString(IntToString(freq_frequency)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("RESTORE"); + NWNXPushString(key); + NWNXPushString(IntToString(ttl)); + NWNXPushString(serialized_value); + if (replace != "") NWNXPushString(replace); + if (absttl != "") NWNXPushString(absttl); + if (idletime_seconds != 0) NWNXPushString(IntToString(idletime_seconds)); + if (freq_frequency != 0) NWNXPushString(IntToString(freq_frequency)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int ROLE() { - NWNX_PushArgumentString("ROLE"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ROLE"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int RPOP( string key ) { - NWNX_PushArgumentString("RPOP"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("RPOP"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int RPOPLPUSH( @@ -4756,108 +4755,108 @@ int RPOPLPUSH( // Redis type: key string destination ) { - NWNX_PushArgumentString("RPOPLPUSH"); - NWNX_PushArgumentString(source); - NWNX_PushArgumentString(destination); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("RPOPLPUSH"); + NWNXPushString(source); + NWNXPushString(destination); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int RPUSH( string key, string value ) { - NWNX_PushArgumentString("RPUSH"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(value); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("RPUSH"); + NWNXPushString(key); + NWNXPushString(value); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int RPUSHX( string key, string value ) { - NWNX_PushArgumentString("RPUSHX"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(value); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("RPUSHX"); + NWNXPushString(key); + NWNXPushString(value); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int SADD( string key, string member ) { - NWNX_PushArgumentString("SADD"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(member); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SADD"); + NWNXPushString(key); + NWNXPushString(member); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int SAVE() { - NWNX_PushArgumentString("SAVE"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SAVE"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int SCARD( string key ) { - NWNX_PushArgumentString("SCARD"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SCARD"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int SCRIPT_DEBUG( // Redis type: enum string mode ) { - NWNX_PushArgumentString("SCRIPT_DEBUG"); - NWNX_PushArgumentString(mode); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SCRIPT_DEBUG"); + NWNXPushString(mode); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int SCRIPT_EXISTS( string sha1 ) { - NWNX_PushArgumentString("SCRIPT_EXISTS"); - NWNX_PushArgumentString(sha1); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SCRIPT_EXISTS"); + NWNXPushString(sha1); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int SCRIPT_FLUSH() { - NWNX_PushArgumentString("SCRIPT_FLUSH"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SCRIPT_FLUSH"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int SCRIPT_KILL() { - NWNX_PushArgumentString("SCRIPT_KILL"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SCRIPT_KILL"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int SCRIPT_LOAD( string script ) { - NWNX_PushArgumentString("SCRIPT_LOAD"); - NWNX_PushArgumentString(script); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SCRIPT_LOAD"); + NWNXPushString(script); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int SDIFF( string key ) { - NWNX_PushArgumentString("SDIFF"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SDIFF"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int SDIFFSTORE( @@ -4865,21 +4864,21 @@ int SDIFFSTORE( string destination, string key ) { - NWNX_PushArgumentString("SDIFFSTORE"); - NWNX_PushArgumentString(destination); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SDIFFSTORE"); + NWNXPushString(destination); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int SELECT( // Redis type: integer int index ) { - NWNX_PushArgumentString("SELECT"); - NWNX_PushArgumentString(IntToString(index)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SELECT"); + NWNXPushString(IntToString(index)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int SET( @@ -4888,12 +4887,12 @@ int SET( // Redis type: enum string condition = "" ) { - NWNX_PushArgumentString("SET"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(value); - if (condition != "") NWNX_PushArgumentString(condition); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SET"); + NWNXPushString(key); + NWNXPushString(value); + if (condition != "") NWNXPushString(condition); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int SETBIT( @@ -4902,12 +4901,12 @@ int SETBIT( int offset, string value ) { - NWNX_PushArgumentString("SETBIT"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(offset)); - NWNX_PushArgumentString(value); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SETBIT"); + NWNXPushString(key); + NWNXPushString(IntToString(offset)); + NWNXPushString(value); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int SETEX( @@ -4916,23 +4915,23 @@ int SETEX( int seconds, string value ) { - NWNX_PushArgumentString("SETEX"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(seconds)); - NWNX_PushArgumentString(value); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SETEX"); + NWNXPushString(key); + NWNXPushString(IntToString(seconds)); + NWNXPushString(value); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int SETNX( string key, string value ) { - NWNX_PushArgumentString("SETNX"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(value); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SETNX"); + NWNXPushString(key); + NWNXPushString(value); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int SETRANGE( @@ -4941,31 +4940,31 @@ int SETRANGE( int offset, string value ) { - NWNX_PushArgumentString("SETRANGE"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(offset)); - NWNX_PushArgumentString(value); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SETRANGE"); + NWNXPushString(key); + NWNXPushString(IntToString(offset)); + NWNXPushString(value); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int SHUTDOWN( // Redis type: enum string save_mode = "" ) { - NWNX_PushArgumentString("SHUTDOWN"); - if (save_mode != "") NWNX_PushArgumentString(save_mode); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SHUTDOWN"); + if (save_mode != "") NWNXPushString(save_mode); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int SINTER( string key ) { - NWNX_PushArgumentString("SINTER"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SINTER"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int SINTERSTORE( @@ -4973,64 +4972,64 @@ int SINTERSTORE( string destination, string key ) { - NWNX_PushArgumentString("SINTERSTORE"); - NWNX_PushArgumentString(destination); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SINTERSTORE"); + NWNXPushString(destination); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int SISMEMBER( string key, string member ) { - NWNX_PushArgumentString("SISMEMBER"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(member); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SISMEMBER"); + NWNXPushString(key); + NWNXPushString(member); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int SLAVEOF( string host, string port ) { - NWNX_PushArgumentString("SLAVEOF"); - NWNX_PushArgumentString(host); - NWNX_PushArgumentString(port); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SLAVEOF"); + NWNXPushString(host); + NWNXPushString(port); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int REPLICAOF( string host, string port ) { - NWNX_PushArgumentString("REPLICAOF"); - NWNX_PushArgumentString(host); - NWNX_PushArgumentString(port); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("REPLICAOF"); + NWNXPushString(host); + NWNXPushString(port); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int SLOWLOG( string subcommand, string argument = "" ) { - NWNX_PushArgumentString("SLOWLOG"); - NWNX_PushArgumentString(subcommand); - if (argument != "") NWNX_PushArgumentString(argument); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SLOWLOG"); + NWNXPushString(subcommand); + if (argument != "") NWNXPushString(argument); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int SMEMBERS( string key ) { - NWNX_PushArgumentString("SMEMBERS"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SMEMBERS"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int SMOVE( @@ -5040,12 +5039,12 @@ int SMOVE( string destination, string member ) { - NWNX_PushArgumentString("SMOVE"); - NWNX_PushArgumentString(source); - NWNX_PushArgumentString(destination); - NWNX_PushArgumentString(member); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SMOVE"); + NWNXPushString(source); + NWNXPushString(destination); + NWNXPushString(member); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int SORT( @@ -5064,17 +5063,17 @@ int SORT( // Redis type: key string store_destination = "" ) { - NWNX_PushArgumentString("SORT"); - NWNX_PushArgumentString(key); - if (by_pattern != "") NWNX_PushArgumentString(by_pattern); - if (limit_offset != 0) NWNX_PushArgumentString(IntToString(limit_offset)); - if (limit_count != 0) NWNX_PushArgumentString(IntToString(limit_count)); - if (get_pattern != "") NWNX_PushArgumentString(get_pattern); - if (order != "") NWNX_PushArgumentString(order); - if (sorting != "") NWNX_PushArgumentString(sorting); - if (store_destination != "") NWNX_PushArgumentString(store_destination); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SORT"); + NWNXPushString(key); + if (by_pattern != "") NWNXPushString(by_pattern); + if (limit_offset != 0) NWNXPushString(IntToString(limit_offset)); + if (limit_count != 0) NWNXPushString(IntToString(limit_count)); + if (get_pattern != "") NWNXPushString(get_pattern); + if (order != "") NWNXPushString(order); + if (sorting != "") NWNXPushString(sorting); + if (store_destination != "") NWNXPushString(store_destination); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int SPOP( @@ -5082,11 +5081,11 @@ int SPOP( // Redis type: integer int count = 0 ) { - NWNX_PushArgumentString("SPOP"); - NWNX_PushArgumentString(key); - if (count != 0) NWNX_PushArgumentString(IntToString(count)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SPOP"); + NWNXPushString(key); + if (count != 0) NWNXPushString(IntToString(count)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int SRANDMEMBER( @@ -5094,40 +5093,40 @@ int SRANDMEMBER( // Redis type: integer int count = 0 ) { - NWNX_PushArgumentString("SRANDMEMBER"); - NWNX_PushArgumentString(key); - if (count != 0) NWNX_PushArgumentString(IntToString(count)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SRANDMEMBER"); + NWNXPushString(key); + if (count != 0) NWNXPushString(IntToString(count)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int SREM( string key, string member ) { - NWNX_PushArgumentString("SREM"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(member); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SREM"); + NWNXPushString(key); + NWNXPushString(member); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int STRLEN( string key ) { - NWNX_PushArgumentString("STRLEN"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("STRLEN"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int SUNION( string key ) { - NWNX_PushArgumentString("SUNION"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SUNION"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int SUNIONSTORE( @@ -5135,11 +5134,11 @@ int SUNIONSTORE( string destination, string key ) { - NWNX_PushArgumentString("SUNIONSTORE"); - NWNX_PushArgumentString(destination); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SUNIONSTORE"); + NWNXPushString(destination); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int SWAPDB( @@ -5148,65 +5147,65 @@ int SWAPDB( // Redis type: integer int index_1 ) { - NWNX_PushArgumentString("SWAPDB"); - NWNX_PushArgumentString(IntToString(index)); - NWNX_PushArgumentString(IntToString(index_1)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SWAPDB"); + NWNXPushString(IntToString(index)); + NWNXPushString(IntToString(index_1)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int SYNC() { - NWNX_PushArgumentString("SYNC"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SYNC"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int TIME() { - NWNX_PushArgumentString("TIME"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("TIME"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int TOUCH( string key ) { - NWNX_PushArgumentString("TOUCH"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("TOUCH"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int TTL( string key ) { - NWNX_PushArgumentString("TTL"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("TTL"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int TYPE( string key ) { - NWNX_PushArgumentString("TYPE"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("TYPE"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int UNLINK( string key ) { - NWNX_PushArgumentString("UNLINK"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("UNLINK"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int UNWATCH() { - NWNX_PushArgumentString("UNWATCH"); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("UNWATCH"); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int WAIT( @@ -5215,20 +5214,20 @@ int WAIT( // Redis type: integer int timeout ) { - NWNX_PushArgumentString("WAIT"); - NWNX_PushArgumentString(IntToString(numreplicas)); - NWNX_PushArgumentString(IntToString(timeout)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("WAIT"); + NWNXPushString(IntToString(numreplicas)); + NWNXPushString(IntToString(timeout)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int WATCH( string key ) { - NWNX_PushArgumentString("WATCH"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("WATCH"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int ZADD( @@ -5243,24 +5242,24 @@ int ZADD( float score = 0.0, string member = "" ) { - NWNX_PushArgumentString("ZADD"); - NWNX_PushArgumentString(key); - if (condition != "") NWNX_PushArgumentString(condition); - if (change != "") NWNX_PushArgumentString(change); - if (increment != "") NWNX_PushArgumentString(increment); - NWNX_PushArgumentString(FloatToString(score, 0)); - NWNX_PushArgumentString(member); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZADD"); + NWNXPushString(key); + if (condition != "") NWNXPushString(condition); + if (change != "") NWNXPushString(change); + if (increment != "") NWNXPushString(increment); + NWNXPushString(FloatToString(score, 0)); + NWNXPushString(member); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int ZCARD( string key ) { - NWNX_PushArgumentString("ZCARD"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZCARD"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int ZCOUNT( @@ -5270,12 +5269,12 @@ int ZCOUNT( // Redis type: double float max ) { - NWNX_PushArgumentString("ZCOUNT"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(FloatToString(min, 0)); - NWNX_PushArgumentString(FloatToString(max, 0)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZCOUNT"); + NWNXPushString(key); + NWNXPushString(FloatToString(min, 0)); + NWNXPushString(FloatToString(max, 0)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int ZINCRBY( @@ -5284,12 +5283,12 @@ int ZINCRBY( int increment, string member ) { - NWNX_PushArgumentString("ZINCRBY"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(increment)); - NWNX_PushArgumentString(member); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZINCRBY"); + NWNXPushString(key); + NWNXPushString(IntToString(increment)); + NWNXPushString(member); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int ZINTERSTORE( @@ -5303,14 +5302,14 @@ int ZINTERSTORE( // Redis type: enum string aggregate_aggregate = "" ) { - NWNX_PushArgumentString("ZINTERSTORE"); - NWNX_PushArgumentString(destination); - NWNX_PushArgumentString(IntToString(numkeys)); - NWNX_PushArgumentString(key); - if (weights_weight != 0) NWNX_PushArgumentString(IntToString(weights_weight)); - if (aggregate_aggregate != "") NWNX_PushArgumentString(aggregate_aggregate); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZINTERSTORE"); + NWNXPushString(destination); + NWNXPushString(IntToString(numkeys)); + NWNXPushString(key); + if (weights_weight != 0) NWNXPushString(IntToString(weights_weight)); + if (aggregate_aggregate != "") NWNXPushString(aggregate_aggregate); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int ZLEXCOUNT( @@ -5318,12 +5317,12 @@ int ZLEXCOUNT( string min, string max ) { - NWNX_PushArgumentString("ZLEXCOUNT"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(min); - NWNX_PushArgumentString(max); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZLEXCOUNT"); + NWNXPushString(key); + NWNXPushString(min); + NWNXPushString(max); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int ZPOPMAX( @@ -5331,11 +5330,11 @@ int ZPOPMAX( // Redis type: integer int count = 0 ) { - NWNX_PushArgumentString("ZPOPMAX"); - NWNX_PushArgumentString(key); - if (count != 0) NWNX_PushArgumentString(IntToString(count)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZPOPMAX"); + NWNXPushString(key); + if (count != 0) NWNXPushString(IntToString(count)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int ZPOPMIN( @@ -5343,11 +5342,11 @@ int ZPOPMIN( // Redis type: integer int count = 0 ) { - NWNX_PushArgumentString("ZPOPMIN"); - NWNX_PushArgumentString(key); - if (count != 0) NWNX_PushArgumentString(IntToString(count)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZPOPMIN"); + NWNXPushString(key); + if (count != 0) NWNXPushString(IntToString(count)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int ZRANGE( @@ -5359,13 +5358,13 @@ int ZRANGE( // Redis type: enum string withscores = "" ) { - NWNX_PushArgumentString("ZRANGE"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(start)); - NWNX_PushArgumentString(IntToString(stop)); - if (withscores != "") NWNX_PushArgumentString(withscores); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZRANGE"); + NWNXPushString(key); + NWNXPushString(IntToString(start)); + NWNXPushString(IntToString(stop)); + if (withscores != "") NWNXPushString(withscores); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int ZRANGEBYLEX( @@ -5377,14 +5376,14 @@ int ZRANGEBYLEX( // Redis type: integer int limit_count = 0 ) { - NWNX_PushArgumentString("ZRANGEBYLEX"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(min); - NWNX_PushArgumentString(max); - if (limit_offset != 0) NWNX_PushArgumentString(IntToString(limit_offset)); - if (limit_count != 0) NWNX_PushArgumentString(IntToString(limit_count)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZRANGEBYLEX"); + NWNXPushString(key); + NWNXPushString(min); + NWNXPushString(max); + if (limit_offset != 0) NWNXPushString(IntToString(limit_offset)); + if (limit_count != 0) NWNXPushString(IntToString(limit_count)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int ZREVRANGEBYLEX( @@ -5396,14 +5395,14 @@ int ZREVRANGEBYLEX( // Redis type: integer int limit_count = 0 ) { - NWNX_PushArgumentString("ZREVRANGEBYLEX"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(max); - NWNX_PushArgumentString(min); - if (limit_offset != 0) NWNX_PushArgumentString(IntToString(limit_offset)); - if (limit_count != 0) NWNX_PushArgumentString(IntToString(limit_count)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZREVRANGEBYLEX"); + NWNXPushString(key); + NWNXPushString(max); + NWNXPushString(min); + if (limit_offset != 0) NWNXPushString(IntToString(limit_offset)); + if (limit_count != 0) NWNXPushString(IntToString(limit_count)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int ZRANGEBYSCORE( @@ -5419,37 +5418,37 @@ int ZRANGEBYSCORE( // Redis type: integer int limit_count = 0 ) { - NWNX_PushArgumentString("ZRANGEBYSCORE"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(FloatToString(min, 0)); - NWNX_PushArgumentString(FloatToString(max, 0)); - if (withscores != "") NWNX_PushArgumentString(withscores); - if (limit_offset != 0) NWNX_PushArgumentString(IntToString(limit_offset)); - if (limit_count != 0) NWNX_PushArgumentString(IntToString(limit_count)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZRANGEBYSCORE"); + NWNXPushString(key); + NWNXPushString(FloatToString(min, 0)); + NWNXPushString(FloatToString(max, 0)); + if (withscores != "") NWNXPushString(withscores); + if (limit_offset != 0) NWNXPushString(IntToString(limit_offset)); + if (limit_count != 0) NWNXPushString(IntToString(limit_count)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int ZRANK( string key, string member ) { - NWNX_PushArgumentString("ZRANK"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(member); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZRANK"); + NWNXPushString(key); + NWNXPushString(member); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int ZREM( string key, string member ) { - NWNX_PushArgumentString("ZREM"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(member); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZREM"); + NWNXPushString(key); + NWNXPushString(member); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int ZREMRANGEBYLEX( @@ -5457,12 +5456,12 @@ int ZREMRANGEBYLEX( string min, string max ) { - NWNX_PushArgumentString("ZREMRANGEBYLEX"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(min); - NWNX_PushArgumentString(max); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZREMRANGEBYLEX"); + NWNXPushString(key); + NWNXPushString(min); + NWNXPushString(max); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int ZREMRANGEBYRANK( @@ -5472,12 +5471,12 @@ int ZREMRANGEBYRANK( // Redis type: integer int stop ) { - NWNX_PushArgumentString("ZREMRANGEBYRANK"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(start)); - NWNX_PushArgumentString(IntToString(stop)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZREMRANGEBYRANK"); + NWNXPushString(key); + NWNXPushString(IntToString(start)); + NWNXPushString(IntToString(stop)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int ZREMRANGEBYSCORE( @@ -5487,12 +5486,12 @@ int ZREMRANGEBYSCORE( // Redis type: double float max ) { - NWNX_PushArgumentString("ZREMRANGEBYSCORE"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(FloatToString(min, 0)); - NWNX_PushArgumentString(FloatToString(max, 0)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZREMRANGEBYSCORE"); + NWNXPushString(key); + NWNXPushString(FloatToString(min, 0)); + NWNXPushString(FloatToString(max, 0)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int ZREVRANGE( @@ -5504,13 +5503,13 @@ int ZREVRANGE( // Redis type: enum string withscores = "" ) { - NWNX_PushArgumentString("ZREVRANGE"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(start)); - NWNX_PushArgumentString(IntToString(stop)); - if (withscores != "") NWNX_PushArgumentString(withscores); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZREVRANGE"); + NWNXPushString(key); + NWNXPushString(IntToString(start)); + NWNXPushString(IntToString(stop)); + if (withscores != "") NWNXPushString(withscores); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int ZREVRANGEBYSCORE( @@ -5526,37 +5525,37 @@ int ZREVRANGEBYSCORE( // Redis type: integer int limit_count = 0 ) { - NWNX_PushArgumentString("ZREVRANGEBYSCORE"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(FloatToString(max, 0)); - NWNX_PushArgumentString(FloatToString(min, 0)); - if (withscores != "") NWNX_PushArgumentString(withscores); - if (limit_offset != 0) NWNX_PushArgumentString(IntToString(limit_offset)); - if (limit_count != 0) NWNX_PushArgumentString(IntToString(limit_count)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZREVRANGEBYSCORE"); + NWNXPushString(key); + NWNXPushString(FloatToString(max, 0)); + NWNXPushString(FloatToString(min, 0)); + if (withscores != "") NWNXPushString(withscores); + if (limit_offset != 0) NWNXPushString(IntToString(limit_offset)); + if (limit_count != 0) NWNXPushString(IntToString(limit_count)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int ZREVRANK( string key, string member ) { - NWNX_PushArgumentString("ZREVRANK"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(member); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZREVRANK"); + NWNXPushString(key); + NWNXPushString(member); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int ZSCORE( string key, string member ) { - NWNX_PushArgumentString("ZSCORE"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(member); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZSCORE"); + NWNXPushString(key); + NWNXPushString(member); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int ZUNIONSTORE( @@ -5570,14 +5569,14 @@ int ZUNIONSTORE( // Redis type: enum string aggregate_aggregate = "" ) { - NWNX_PushArgumentString("ZUNIONSTORE"); - NWNX_PushArgumentString(destination); - NWNX_PushArgumentString(IntToString(numkeys)); - NWNX_PushArgumentString(key); - if (weights_weight != 0) NWNX_PushArgumentString(IntToString(weights_weight)); - if (aggregate_aggregate != "") NWNX_PushArgumentString(aggregate_aggregate); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZUNIONSTORE"); + NWNXPushString(destination); + NWNXPushString(IntToString(numkeys)); + NWNXPushString(key); + if (weights_weight != 0) NWNXPushString(IntToString(weights_weight)); + if (aggregate_aggregate != "") NWNXPushString(aggregate_aggregate); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int SCAN( @@ -5589,13 +5588,13 @@ int SCAN( int count_count = 0, string type_type = "" ) { - NWNX_PushArgumentString("SCAN"); - NWNX_PushArgumentString(IntToString(cursor)); - if (match_pattern != "") NWNX_PushArgumentString(match_pattern); - if (count_count != 0) NWNX_PushArgumentString(IntToString(count_count)); - if (type_type != "") NWNX_PushArgumentString(type_type); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SCAN"); + NWNXPushString(IntToString(cursor)); + if (match_pattern != "") NWNXPushString(match_pattern); + if (count_count != 0) NWNXPushString(IntToString(count_count)); + if (type_type != "") NWNXPushString(type_type); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int SSCAN( @@ -5607,13 +5606,13 @@ int SSCAN( // Redis type: integer int count_count = 0 ) { - NWNX_PushArgumentString("SSCAN"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(cursor)); - if (match_pattern != "") NWNX_PushArgumentString(match_pattern); - if (count_count != 0) NWNX_PushArgumentString(IntToString(count_count)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("SSCAN"); + NWNXPushString(key); + NWNXPushString(IntToString(cursor)); + if (match_pattern != "") NWNXPushString(match_pattern); + if (count_count != 0) NWNXPushString(IntToString(count_count)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int HSCAN( @@ -5625,13 +5624,13 @@ int HSCAN( // Redis type: integer int count_count = 0 ) { - NWNX_PushArgumentString("HSCAN"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(cursor)); - if (match_pattern != "") NWNX_PushArgumentString(match_pattern); - if (count_count != 0) NWNX_PushArgumentString(IntToString(count_count)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("HSCAN"); + NWNXPushString(key); + NWNXPushString(IntToString(cursor)); + if (match_pattern != "") NWNXPushString(match_pattern); + if (count_count != 0) NWNXPushString(IntToString(count_count)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int ZSCAN( @@ -5643,13 +5642,13 @@ int ZSCAN( // Redis type: integer int count_count = 0 ) { - NWNX_PushArgumentString("ZSCAN"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(IntToString(cursor)); - if (match_pattern != "") NWNX_PushArgumentString(match_pattern); - if (count_count != 0) NWNX_PushArgumentString(IntToString(count_count)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("ZSCAN"); + NWNXPushString(key); + NWNXPushString(IntToString(cursor)); + if (match_pattern != "") NWNXPushString(match_pattern); + if (count_count != 0) NWNXPushString(IntToString(count_count)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int XINFO( @@ -5663,14 +5662,14 @@ int XINFO( // Redis type: enum string help = "" ) { - NWNX_PushArgumentString("XINFO"); - if (consumers_key != "") NWNX_PushArgumentString(consumers_key); - if (consumers_groupname != "") NWNX_PushArgumentString(consumers_groupname); - if (groups_key != "") NWNX_PushArgumentString(groups_key); - if (stream_key != "") NWNX_PushArgumentString(stream_key); - if (help != "") NWNX_PushArgumentString(help); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("XINFO"); + if (consumers_key != "") NWNXPushString(consumers_key); + if (consumers_groupname != "") NWNXPushString(consumers_groupname); + if (groups_key != "") NWNXPushString(groups_key); + if (stream_key != "") NWNXPushString(stream_key); + if (help != "") NWNXPushString(help); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int XADD( @@ -5680,13 +5679,13 @@ int XADD( string field, string str ) { - NWNX_PushArgumentString("XADD"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(ID); - NWNX_PushArgumentString(field); - NWNX_PushArgumentString(str); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("XADD"); + NWNXPushString(key); + NWNXPushString(ID); + NWNXPushString(field); + NWNXPushString(str); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int XTRIM( @@ -5698,24 +5697,24 @@ int XTRIM( // Redis type: integer int count = 0 ) { - NWNX_PushArgumentString("XTRIM"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(strategy); - if (approx != "") NWNX_PushArgumentString(approx); - NWNX_PushArgumentString(IntToString(count)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("XTRIM"); + NWNXPushString(key); + NWNXPushString(strategy); + if (approx != "") NWNXPushString(approx); + NWNXPushString(IntToString(count)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int XDEL( string key, string ID ) { - NWNX_PushArgumentString("XDEL"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(ID); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("XDEL"); + NWNXPushString(key); + NWNXPushString(ID); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int XRANGE( @@ -5725,13 +5724,13 @@ int XRANGE( // Redis type: integer int count_count = 0 ) { - NWNX_PushArgumentString("XRANGE"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(start); - NWNX_PushArgumentString(end); - if (count_count != 0) NWNX_PushArgumentString(IntToString(count_count)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("XRANGE"); + NWNXPushString(key); + NWNXPushString(start); + NWNXPushString(end); + if (count_count != 0) NWNXPushString(IntToString(count_count)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int XREVRANGE( @@ -5741,22 +5740,22 @@ int XREVRANGE( // Redis type: integer int count_count = 0 ) { - NWNX_PushArgumentString("XREVRANGE"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(end); - NWNX_PushArgumentString(start); - if (count_count != 0) NWNX_PushArgumentString(IntToString(count_count)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("XREVRANGE"); + NWNXPushString(key); + NWNXPushString(end); + NWNXPushString(start); + if (count_count != 0) NWNXPushString(IntToString(count_count)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int XLEN( string key ) { - NWNX_PushArgumentString("XLEN"); - NWNX_PushArgumentString(key); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("XLEN"); + NWNXPushString(key); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int XREAD( @@ -5769,14 +5768,14 @@ int XREAD( string key = "", string ID = "" ) { - NWNX_PushArgumentString("XREAD"); - if (count_count != 0) NWNX_PushArgumentString(IntToString(count_count)); - if (block_milliseconds != 0) NWNX_PushArgumentString(IntToString(block_milliseconds)); - NWNX_PushArgumentString(streams); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(ID); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("XREAD"); + if (count_count != 0) NWNXPushString(IntToString(count_count)); + if (block_milliseconds != 0) NWNXPushString(IntToString(block_milliseconds)); + NWNXPushString(streams); + NWNXPushString(key); + NWNXPushString(ID); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int XGROUP( @@ -5796,20 +5795,20 @@ int XGROUP( string delconsumer_groupname = "", string delconsumer_consumername = "" ) { - NWNX_PushArgumentString("XGROUP"); - if (create_key != "") NWNX_PushArgumentString(create_key); - if (create_groupname != "") NWNX_PushArgumentString(create_groupname); - if (create_id_or__ != "") NWNX_PushArgumentString(create_id_or__); - if (setid_key != "") NWNX_PushArgumentString(setid_key); - if (setid_groupname != "") NWNX_PushArgumentString(setid_groupname); - if (setid_id_or__ != "") NWNX_PushArgumentString(setid_id_or__); - if (destroy_key != "") NWNX_PushArgumentString(destroy_key); - if (destroy_groupname != "") NWNX_PushArgumentString(destroy_groupname); - if (delconsumer_key != "") NWNX_PushArgumentString(delconsumer_key); - if (delconsumer_groupname != "") NWNX_PushArgumentString(delconsumer_groupname); - if (delconsumer_consumername != "") NWNX_PushArgumentString(delconsumer_consumername); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("XGROUP"); + if (create_key != "") NWNXPushString(create_key); + if (create_groupname != "") NWNXPushString(create_groupname); + if (create_id_or__ != "") NWNXPushString(create_id_or__); + if (setid_key != "") NWNXPushString(setid_key); + if (setid_groupname != "") NWNXPushString(setid_groupname); + if (setid_id_or__ != "") NWNXPushString(setid_id_or__); + if (destroy_key != "") NWNXPushString(destroy_key); + if (destroy_groupname != "") NWNXPushString(destroy_groupname); + if (delconsumer_key != "") NWNXPushString(delconsumer_key); + if (delconsumer_groupname != "") NWNXPushString(delconsumer_groupname); + if (delconsumer_consumername != "") NWNXPushString(delconsumer_consumername); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int XREADGROUP( @@ -5826,17 +5825,17 @@ int XREADGROUP( string key = "", string ID = "" ) { - NWNX_PushArgumentString("XREADGROUP"); - NWNX_PushArgumentString(group_group); - NWNX_PushArgumentString(group_consumer); - if (count_count != 0) NWNX_PushArgumentString(IntToString(count_count)); - if (block_milliseconds != 0) NWNX_PushArgumentString(IntToString(block_milliseconds)); - if (noack != "") NWNX_PushArgumentString(noack); - NWNX_PushArgumentString(streams); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(ID); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("XREADGROUP"); + NWNXPushString(group_group); + NWNXPushString(group_consumer); + if (count_count != 0) NWNXPushString(IntToString(count_count)); + if (block_milliseconds != 0) NWNXPushString(IntToString(block_milliseconds)); + if (noack != "") NWNXPushString(noack); + NWNXPushString(streams); + NWNXPushString(key); + NWNXPushString(ID); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int XACK( @@ -5844,12 +5843,12 @@ int XACK( string group, string ID ) { - NWNX_PushArgumentString("XACK"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(group); - NWNX_PushArgumentString(ID); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("XACK"); + NWNXPushString(key); + NWNXPushString(group); + NWNXPushString(ID); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int XCLAIM( @@ -5865,17 +5864,17 @@ int XCLAIM( // Redis type: integer int retrycount_count = 0 ) { - NWNX_PushArgumentString("XCLAIM"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(group); - NWNX_PushArgumentString(consumer); - NWNX_PushArgumentString(min_idle_time); - NWNX_PushArgumentString(ID); - if (idle_ms != 0) NWNX_PushArgumentString(IntToString(idle_ms)); - if (time_ms_unix_time != 0) NWNX_PushArgumentString(IntToString(time_ms_unix_time)); - if (retrycount_count != 0) NWNX_PushArgumentString(IntToString(retrycount_count)); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("XCLAIM"); + NWNXPushString(key); + NWNXPushString(group); + NWNXPushString(consumer); + NWNXPushString(min_idle_time); + NWNXPushString(ID); + if (idle_ms != 0) NWNXPushString(IntToString(idle_ms)); + if (time_ms_unix_time != 0) NWNXPushString(IntToString(time_ms_unix_time)); + if (retrycount_count != 0) NWNXPushString(IntToString(retrycount_count)); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } int XPENDING( @@ -5887,13 +5886,13 @@ int XPENDING( int count = 0, string consumer = "" ) { - NWNX_PushArgumentString("XPENDING"); - NWNX_PushArgumentString(key); - NWNX_PushArgumentString(group); - if (start != "") NWNX_PushArgumentString(start); - if (end != "") NWNX_PushArgumentString(end); - if (count != 0) NWNX_PushArgumentString(IntToString(count)); - if (consumer != "") NWNX_PushArgumentString(consumer); - NWNX_CallFunction("NWNX_Redis", "Deferred"); - return NWNX_GetReturnValueInt(); + NWNXPushString("XPENDING"); + NWNXPushString(key); + NWNXPushString(group); + if (start != "") NWNXPushString(start); + if (end != "") NWNXPushString(end); + if (count != 0) NWNXPushString(IntToString(count)); + if (consumer != "") NWNXPushString(consumer); + NWNXCall("NWNX_Redis", "Deferred"); + return NWNXPopInt(); } diff --git a/_module/nss/nwnx_rename.nss b/_module/nss/nwnx_rename.nss index fbd3cfc8..88231eb8 100644 --- a/_module/nss/nwnx_rename.nss +++ b/_module/nss/nwnx_rename.nss @@ -2,7 +2,6 @@ /// @brief Facilitates renaming, overriding and customization of player names. /// @{ /// @file nwnx_rename.nss -#include "nwnx" const string NWNX_Rename = "NWNX_Rename"; ///< @private @@ -46,35 +45,26 @@ void NWNX_Rename_ClearPCNameOverride(object oTarget, object oObserver = OBJECT_I void NWNX_Rename_SetPCNameOverride(object oTarget, string sNewName, string sPrefix = "" , string sSuffix = "" , int iPlayerNameState = NWNX_RENAME_PLAYERNAME_DEFAULT, object oObserver = OBJECT_INVALID) { - string sFunc = "SetPCNameOverride"; - - NWNX_PushArgumentObject(oObserver); - NWNX_PushArgumentInt(iPlayerNameState); - NWNX_PushArgumentString(sSuffix); - NWNX_PushArgumentString(sPrefix); - NWNX_PushArgumentString(sNewName); - NWNX_PushArgumentObject(oTarget); - - NWNX_CallFunction(NWNX_Rename, sFunc); + NWNXPushObject(oObserver); + NWNXPushInt(iPlayerNameState); + NWNXPushString(sSuffix); + NWNXPushString(sPrefix); + NWNXPushString(sNewName); + NWNXPushObject(oTarget); + NWNXCall(NWNX_Rename, "SetPCNameOverride"); } string NWNX_Rename_GetPCNameOverride(object oTarget, object oObserver = OBJECT_INVALID) { - string sFunc = "GetPCNameOverride"; - - NWNX_PushArgumentObject(oObserver); - NWNX_PushArgumentObject(oTarget); - - NWNX_CallFunction(NWNX_Rename, sFunc); - return NWNX_GetReturnValueString(); + NWNXPushObject(oObserver); + NWNXPushObject(oTarget); + NWNXCall(NWNX_Rename, "GetPCNameOverride"); + return NWNXPopString(); } void NWNX_Rename_ClearPCNameOverride(object oTarget, object oObserver = OBJECT_INVALID, int clearAll = FALSE) { - string sFunc = "ClearPCNameOverride"; - - NWNX_PushArgumentInt(clearAll); - NWNX_PushArgumentObject(oObserver); - NWNX_PushArgumentObject(oTarget); - - NWNX_CallFunction(NWNX_Rename, sFunc); + NWNXPushInt(clearAll); + NWNXPushObject(oObserver); + NWNXPushObject(oTarget); + NWNXCall(NWNX_Rename, "ClearPCNameOverride"); } diff --git a/_module/nss/nwnx_reveal.nss b/_module/nss/nwnx_reveal.nss index 4615e886..12618306 100644 --- a/_module/nss/nwnx_reveal.nss +++ b/_module/nss/nwnx_reveal.nss @@ -2,7 +2,6 @@ /// @brief Allows the selective revealing of a stealthing character to another character or their party. /// @{ /// @file nwnx_reveal.nss -#include "nwnx" const string NWNX_Reveal = "NWNX_Reveal"; ///< @private @@ -28,22 +27,16 @@ void NWNX_Reveal_SetRevealToParty(object oHiding, int bReveal, int iDetectionMet void NWNX_Reveal_RevealTo(object oHiding, object oObserver, int iDetectionMethod = NWNX_REVEAL_HEARD) { - string sFunc = "RevealTo"; - - NWNX_PushArgumentInt(iDetectionMethod); - NWNX_PushArgumentObject(oObserver); - NWNX_PushArgumentObject(oHiding); - - NWNX_CallFunction(NWNX_Reveal, sFunc); + NWNXPushInt(iDetectionMethod); + NWNXPushObject(oObserver); + NWNXPushObject(oHiding); + NWNXCall(NWNX_Reveal, "RevealTo"); } void NWNX_Reveal_SetRevealToParty(object oHiding, int bReveal, int iDetectionMethod = NWNX_REVEAL_HEARD) { - string sFunc = "SetRevealToParty"; - - NWNX_PushArgumentInt(iDetectionMethod); - NWNX_PushArgumentInt(bReveal); - NWNX_PushArgumentObject(oHiding); - - NWNX_CallFunction(NWNX_Reveal, sFunc); + NWNXPushInt(iDetectionMethod); + NWNXPushInt(bReveal); + NWNXPushObject(oHiding); + NWNXCall(NWNX_Reveal, "SetRevealToParty"); } diff --git a/_module/nss/nwnx_ruby.nss b/_module/nss/nwnx_ruby.nss index 3c31819a..ce377cc8 100644 --- a/_module/nss/nwnx_ruby.nss +++ b/_module/nss/nwnx_ruby.nss @@ -2,7 +2,6 @@ /// @brief Allows users to execute arbitrary Ruby from the game. /// @{ /// @file nwnx_ruby.nss -#include "nwnx" const string NWNX_Ruby = "NWNX_Ruby"; ///< @private @@ -13,11 +12,9 @@ string NWNX_Ruby_Evaluate(string sCode); /// @return The output of the call. string NWNX_Ruby_Evaluate(string sCode) { - string sFunc = "Evaluate"; - - NWNX_PushArgumentString(sCode); - NWNX_CallFunction(NWNX_Ruby, sFunc); - return NWNX_GetReturnValueString(); + NWNXPushString(sCode); + NWNXCall(NWNX_Ruby, "Evaluate"); + return NWNXPopString(); } /// @} diff --git a/_module/nss/nwnx_skillranks.nss b/_module/nss/nwnx_skillranks.nss index 9cab9883..ae38d96f 100644 --- a/_module/nss/nwnx_skillranks.nss +++ b/_module/nss/nwnx_skillranks.nss @@ -3,7 +3,6 @@ /// skill related feats as well as modifying stock feats. /// @{ /// @file nwnx_skillranks.nss -#include "nwnx" const string NWNX_SkillRanks = "NWNX_SkillRanks"; ///< @private @@ -144,82 +143,67 @@ void NWNX_SkillRanks_SetAreaModifier(object oArea, int iSkill, int iModifier); int NWNX_SkillRanks_GetSkillFeatCountForSkill(int iSkill) { - string sFunc = "GetSkillFeatCountForSkill"; - - NWNX_PushArgumentInt(iSkill); - NWNX_CallFunction(NWNX_SkillRanks, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushInt(iSkill); + NWNXCall(NWNX_SkillRanks, "GetSkillFeatCountForSkill"); + return NWNXPopInt(); } struct NWNX_SkillRanks_SkillFeat NWNX_SkillRanks_GetSkillFeatForSkillByIndex(int iSkill, int iIndex) { - string sFunc = "GetSkillFeatForSkillByIndex"; - - NWNX_PushArgumentInt(iIndex); - NWNX_PushArgumentInt(iSkill); - NWNX_CallFunction(NWNX_SkillRanks, sFunc); - + NWNXPushInt(iIndex); + NWNXPushInt(iSkill); + NWNXCall(NWNX_SkillRanks, "GetSkillFeatForSkillByIndex"); struct NWNX_SkillRanks_SkillFeat skillFeat; - skillFeat.iSkill = iSkill; - skillFeat.iFeat = NWNX_GetReturnValueInt(); - skillFeat.iModifier = NWNX_GetReturnValueInt(); - skillFeat.iFocusFeat = NWNX_GetReturnValueInt(); - skillFeat.sClasses = NWNX_GetReturnValueString(); - skillFeat.fClassLevelMod = NWNX_GetReturnValueFloat(); - skillFeat.iAreaFlagsRequired = NWNX_GetReturnValueInt(); - skillFeat.iAreaFlagsForbidden = NWNX_GetReturnValueInt(); - skillFeat.iDayOrNight = NWNX_GetReturnValueInt(); - skillFeat.bBypassArmorCheckPenalty = NWNX_GetReturnValueInt(); - skillFeat.iKeyAbilityMask = NWNX_GetReturnValueInt(); - + skillFeat.iFeat = NWNXPopInt(); + skillFeat.iModifier = NWNXPopInt(); + skillFeat.iFocusFeat = NWNXPopInt(); + skillFeat.sClasses = NWNXPopString(); + skillFeat.fClassLevelMod = NWNXPopFloat(); + skillFeat.iAreaFlagsRequired = NWNXPopInt(); + skillFeat.iAreaFlagsForbidden = NWNXPopInt(); + skillFeat.iDayOrNight = NWNXPopInt(); + skillFeat.bBypassArmorCheckPenalty = NWNXPopInt(); + skillFeat.iKeyAbilityMask = NWNXPopInt(); return skillFeat; } struct NWNX_SkillRanks_SkillFeat NWNX_SkillRanks_GetSkillFeat(int iSkill, int iFeat) { - string sFunc = "GetSkillFeat"; - - NWNX_PushArgumentInt(iFeat); - NWNX_PushArgumentInt(iSkill); - NWNX_CallFunction(NWNX_SkillRanks, sFunc); - + NWNXPushInt(iFeat); + NWNXPushInt(iSkill); + NWNXCall(NWNX_SkillRanks, "GetSkillFeat"); struct NWNX_SkillRanks_SkillFeat skillFeat; - skillFeat.iSkill = iSkill; skillFeat.iFeat = iFeat; - skillFeat.iModifier = NWNX_GetReturnValueInt(); - skillFeat.iFocusFeat = NWNX_GetReturnValueInt(); - skillFeat.sClasses = NWNX_GetReturnValueString(); - skillFeat.fClassLevelMod = NWNX_GetReturnValueFloat(); - skillFeat.iAreaFlagsRequired = NWNX_GetReturnValueInt(); - skillFeat.iAreaFlagsForbidden = NWNX_GetReturnValueInt(); - skillFeat.iDayOrNight = NWNX_GetReturnValueInt(); - skillFeat.bBypassArmorCheckPenalty = NWNX_GetReturnValueInt(); - skillFeat.iKeyAbilityMask = NWNX_GetReturnValueInt(); - + skillFeat.iModifier = NWNXPopInt(); + skillFeat.iFocusFeat = NWNXPopInt(); + skillFeat.sClasses = NWNXPopString(); + skillFeat.fClassLevelMod = NWNXPopFloat(); + skillFeat.iAreaFlagsRequired = NWNXPopInt(); + skillFeat.iAreaFlagsForbidden = NWNXPopInt(); + skillFeat.iDayOrNight = NWNXPopInt(); + skillFeat.bBypassArmorCheckPenalty = NWNXPopInt(); + skillFeat.iKeyAbilityMask = NWNXPopInt(); return skillFeat; } void NWNX_SkillRanks_SetSkillFeat(struct NWNX_SkillRanks_SkillFeat skillFeat, int createIfNonExistent = FALSE) { - string sFunc = "SetSkillFeat"; - - NWNX_PushArgumentInt(createIfNonExistent); - NWNX_PushArgumentInt(skillFeat.iKeyAbilityMask); - NWNX_PushArgumentInt(skillFeat.bBypassArmorCheckPenalty); - NWNX_PushArgumentInt(skillFeat.iDayOrNight); - NWNX_PushArgumentInt(skillFeat.iAreaFlagsForbidden); - NWNX_PushArgumentInt(skillFeat.iAreaFlagsRequired); - NWNX_PushArgumentFloat(skillFeat.fClassLevelMod); + NWNXPushInt(createIfNonExistent); + NWNXPushInt(skillFeat.iKeyAbilityMask); + NWNXPushInt(skillFeat.bBypassArmorCheckPenalty); + NWNXPushInt(skillFeat.iDayOrNight); + NWNXPushInt(skillFeat.iAreaFlagsForbidden); + NWNXPushInt(skillFeat.iAreaFlagsRequired); + NWNXPushFloat(skillFeat.fClassLevelMod); // We only need to send the string from the point of the first set bit - NWNX_PushArgumentString(GetStringRight(skillFeat.sClasses,GetStringLength(skillFeat.sClasses)-FindSubString(skillFeat.sClasses,"1"))); - NWNX_PushArgumentInt(skillFeat.iFocusFeat); - NWNX_PushArgumentInt(skillFeat.iModifier); - NWNX_PushArgumentInt(skillFeat.iFeat); - NWNX_PushArgumentInt(skillFeat.iSkill); - NWNX_CallFunction(NWNX_SkillRanks, sFunc); + NWNXPushString(GetStringRight(skillFeat.sClasses,GetStringLength(skillFeat.sClasses)-FindSubString(skillFeat.sClasses,"1"))); + NWNXPushInt(skillFeat.iFocusFeat); + NWNXPushInt(skillFeat.iModifier); + NWNXPushInt(skillFeat.iFeat); + NWNXPushInt(skillFeat.iSkill); + NWNXCall(NWNX_SkillRanks, "SetSkillFeat"); } struct NWNX_SkillRanks_SkillFeat NWNX_SkillRanks_AddSkillFeatClass(struct NWNX_SkillRanks_SkillFeat skillFeat, int iClass) @@ -237,47 +221,35 @@ struct NWNX_SkillRanks_SkillFeat NWNX_SkillRanks_AddSkillFeatClass(struct NWNX_S void NWNX_SkillRanks_SetSkillFeatFocusModifier(int iModifier, int epicFocus = FALSE) { - string sFunc = "SetSkillFeatFocusModifier"; - - NWNX_PushArgumentInt(epicFocus); - NWNX_PushArgumentInt(iModifier); - NWNX_CallFunction(NWNX_SkillRanks, sFunc); + NWNXPushInt(epicFocus); + NWNXPushInt(iModifier); + NWNXCall(NWNX_SkillRanks, "SetSkillFeatFocusModifier"); } int NWNX_SkillRanks_GetBlindnessPenalty() { - string sFunc = "GetBlindnessPenalty"; - - NWNX_CallFunction(NWNX_SkillRanks, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXCall(NWNX_SkillRanks, "GetBlindnessPenalty"); + return NWNXPopInt(); } void NWNX_SkillRanks_SetBlindnessPenalty(int iModifier) { - string sFunc = "SetBlindnessPenalty"; - - NWNX_PushArgumentInt(iModifier); - NWNX_CallFunction(NWNX_SkillRanks, sFunc); + NWNXPushInt(iModifier); + NWNXCall(NWNX_SkillRanks, "SetBlindnessPenalty"); } int NWNX_SkillRanks_GetAreaModifier(object oArea, int iSkill) { - string sFunc = "GetAreaModifier"; - - NWNX_PushArgumentInt(iSkill); - NWNX_PushArgumentObject(oArea); - NWNX_CallFunction(NWNX_SkillRanks, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushInt(iSkill); + NWNXPushObject(oArea); + NWNXCall(NWNX_SkillRanks, "GetAreaModifier"); + return NWNXPopInt(); } void NWNX_SkillRanks_SetAreaModifier(object oArea, int iSkill, int iModifier) { - string sFunc = "SetAreaModifier"; - - NWNX_PushArgumentInt(iModifier); - NWNX_PushArgumentInt(iSkill); - NWNX_PushArgumentObject(oArea); - NWNX_CallFunction(NWNX_SkillRanks, sFunc); + NWNXPushInt(iModifier); + NWNXPushInt(iSkill); + NWNXPushObject(oArea); + NWNXCall(NWNX_SkillRanks, "SetAreaModifier"); } diff --git a/_module/nss/nwnx_spellcheck.nss b/_module/nss/nwnx_spellcheck.nss index 5a6b268d..45a0e659 100644 --- a/_module/nss/nwnx_spellcheck.nss +++ b/_module/nss/nwnx_spellcheck.nss @@ -2,7 +2,6 @@ /// @brief Functions related to spellchecking /// @{ /// @file nwnx_spellcheck.nss -#include "nwnx" const string NWNX_SpellChecker = "NWNX_SpellChecker"; ///< @private @@ -27,17 +26,14 @@ string NWNX_SpellChecker_GetSuggestSpell(string word); string NWNX_SpellChecker_FindMisspell(string sentence) { - string sFunc = "FindMisspell"; - - NWNX_PushArgumentString(sentence); - NWNX_CallFunction(NWNX_SpellChecker, sFunc); - return NWNX_GetReturnValueString(); + NWNXPushString(sentence); + NWNXCall(NWNX_SpellChecker, "FindMisspell"); + return NWNXPopString(); } string NWNX_SpellChecker_GetSuggestSpell(string word) { - string sFunc = "GetSuggestSpell"; - NWNX_PushArgumentString(word); - NWNX_CallFunction(NWNX_SpellChecker, sFunc); - return NWNX_GetReturnValueString(); + NWNXPushString(word); + NWNXCall(NWNX_SpellChecker, "GetSuggestSpell"); + return NWNXPopString(); } diff --git a/_module/nss/nwnx_sql.nss b/_module/nss/nwnx_sql.nss index f3ab3d20..cb324943 100644 --- a/_module/nss/nwnx_sql.nss +++ b/_module/nss/nwnx_sql.nss @@ -2,7 +2,6 @@ /// @brief Functions to interface with a database through SQL /// @{ /// @file nwnx_sql.nss -#include "nwnx" const string NWNX_SQL = "NWNX_SQL"; ///< @private @@ -116,19 +115,15 @@ void NWNX_SQL_PostgreSQL_SetNextQueryResultsBinaryMode(); int NWNX_SQL_PrepareQuery(string query) { - string sFunc = "PrepareQuery"; - - NWNX_PushArgumentString(query); - NWNX_CallFunction(NWNX_SQL, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushString(query); + NWNXCall(NWNX_SQL, "PrepareQuery"); + return NWNXPopInt(); } int NWNX_SQL_ExecutePreparedQuery() { - string sFunc = "ExecutePreparedQuery"; - - NWNX_CallFunction(NWNX_SQL, sFunc); - return NWNX_GetReturnValueInt(); + NWNXCall(NWNX_SQL, "ExecutePreparedQuery"); + return NWNXPopInt(); } int NWNX_SQL_ExecuteQuery(string query) @@ -146,76 +141,58 @@ int NWNX_SQL_ExecuteQuery(string query) int NWNX_SQL_ReadyToReadNextRow() { - string sFunc = "ReadyToReadNextRow"; - - NWNX_CallFunction(NWNX_SQL, sFunc); - return NWNX_GetReturnValueInt(); + NWNXCall(NWNX_SQL, "ReadyToReadNextRow"); + return NWNXPopInt(); } void NWNX_SQL_ReadNextRow() { - string sFunc = "ReadNextRow"; - - NWNX_CallFunction(NWNX_SQL, sFunc); + NWNXCall(NWNX_SQL, "ReadNextRow"); } string NWNX_SQL_ReadDataInActiveRow(int column = 0) { - string sFunc = "ReadDataInActiveRow"; - - NWNX_PushArgumentInt(column); - NWNX_CallFunction(NWNX_SQL, sFunc); - return NWNX_GetReturnValueString(); + NWNXPushInt(column); + NWNXCall(NWNX_SQL, "ReadDataInActiveRow"); + return NWNXPopString(); } void NWNX_SQL_PreparedInt(int position, int value) { - string sFunc = "PreparedInt"; - - NWNX_PushArgumentInt(value); - NWNX_PushArgumentInt(position); - NWNX_CallFunction(NWNX_SQL, sFunc); + NWNXPushInt(value); + NWNXPushInt(position); + NWNXCall(NWNX_SQL, "PreparedInt"); } void NWNX_SQL_PreparedString(int position, string value) { - string sFunc = "PreparedString"; - - NWNX_PushArgumentString(value); - NWNX_PushArgumentInt(position); - NWNX_CallFunction(NWNX_SQL, sFunc); + NWNXPushString(value); + NWNXPushInt(position); + NWNXCall(NWNX_SQL, "PreparedString"); } void NWNX_SQL_PreparedFloat(int position, float value) { - string sFunc = "PreparedFloat"; - - NWNX_PushArgumentFloat(value); - NWNX_PushArgumentInt(position); - NWNX_CallFunction(NWNX_SQL, sFunc); + NWNXPushFloat(value); + NWNXPushInt(position); + NWNXCall(NWNX_SQL, "PreparedFloat"); } void NWNX_SQL_PreparedObjectId(int position, object value) { - string sFunc = "PreparedObjectId"; - - NWNX_PushArgumentObject(value); - NWNX_PushArgumentInt(position); - NWNX_CallFunction(NWNX_SQL, sFunc); + NWNXPushObject(value); + NWNXPushInt(position); + NWNXCall(NWNX_SQL, "PreparedObjectId"); } void NWNX_SQL_PreparedObjectFull(int position, object value, int base64 = TRUE) { - string sFunc = "PreparedObjectFull"; - - NWNX_PushArgumentInt(base64); - NWNX_PushArgumentObject(value); - NWNX_PushArgumentInt(position); - NWNX_CallFunction(NWNX_SQL, sFunc); + NWNXPushInt(base64); + NWNXPushObject(value); + NWNXPushInt(position); + NWNXCall(NWNX_SQL, "PreparedObjectFull"); } void NWNX_SQL_PreparedNULL(int position) { - string sFunc = "PreparedNULL"; - - NWNX_PushArgumentInt(position); - NWNX_CallFunction(NWNX_SQL, sFunc); + NWNXPushInt(position); + NWNXCall(NWNX_SQL, "PreparedNULL"); } void NWNX_SQL_PreparedJson(int position, json value) { @@ -227,60 +204,46 @@ void NWNX_SQL_PreparedJson(int position, json value) object NWNX_SQL_ReadFullObjectInActiveRow(int column = 0, object owner = OBJECT_INVALID, float x = 0.0, float y = 0.0, float z = 0.0, int base64 = TRUE) { - string sFunc = "ReadFullObjectInActiveRow"; - - NWNX_PushArgumentInt(base64); - NWNX_PushArgumentFloat(z); - NWNX_PushArgumentFloat(y); - NWNX_PushArgumentFloat(x); - NWNX_PushArgumentObject(owner); - NWNX_PushArgumentInt(column); - NWNX_CallFunction(NWNX_SQL, sFunc); - return NWNX_GetReturnValueObject(); + NWNXPushInt(base64); + NWNXPushFloat(z); + NWNXPushFloat(y); + NWNXPushFloat(x); + NWNXPushObject(owner); + NWNXPushInt(column); + NWNXCall(NWNX_SQL, "ReadFullObjectInActiveRow"); + return NWNXPopObject(); } int NWNX_SQL_GetAffectedRows() { - string sFunc = "GetAffectedRows"; - - NWNX_CallFunction(NWNX_SQL, sFunc); - return NWNX_GetReturnValueInt(); + NWNXCall(NWNX_SQL, "GetAffectedRows"); + return NWNXPopInt(); } string NWNX_SQL_GetDatabaseType() { - string sFunc = "GetDatabaseType"; - - NWNX_CallFunction(NWNX_SQL, sFunc); - return NWNX_GetReturnValueString(); + NWNXCall(NWNX_SQL, "GetDatabaseType"); + return NWNXPopString(); } void NWNX_SQL_DestroyPreparedQuery() { - string sFunc = "DestroyPreparedQuery"; - - NWNX_CallFunction(NWNX_SQL, sFunc); + NWNXCall(NWNX_SQL, "DestroyPreparedQuery"); } string NWNX_SQL_GetLastError() { - string sFunc = "GetLastError"; - - NWNX_CallFunction(NWNX_SQL, sFunc); - return NWNX_GetReturnValueString(); + NWNXCall(NWNX_SQL, "GetLastError"); + return NWNXPopString(); } int NWNX_SQL_GetPreparedQueryParamCount() { - string sFunc = "GetPreparedQueryParamCount"; - - NWNX_CallFunction(NWNX_SQL, sFunc); - return NWNX_GetReturnValueInt(); + NWNXCall(NWNX_SQL, "GetPreparedQueryParamCount"); + return NWNXPopInt(); } void NWNX_SQL_PostgreSQL_SetNextQueryResultsBinaryMode() { - string sFunc = "PostgreSQL_SetNextQueryResultsBinaryMode"; - - NWNX_CallFunction(NWNX_SQL, sFunc); + NWNXCall(NWNX_SQL, "PostgreSQL_SetNextQueryResultsBinaryMode"); } diff --git a/_module/nss/nwnx_store.nss b/_module/nss/nwnx_store.nss index 00b2014d..8f6d2524 100644 --- a/_module/nss/nwnx_store.nss +++ b/_module/nss/nwnx_store.nss @@ -2,7 +2,6 @@ /// @brief Functions exposing additional store properties. /// @{ /// @file nwnx_store.nss -#include "nwnx" const string NWNX_Store = "NWNX_Store"; ///< @private @@ -51,81 +50,57 @@ int NWNX_Store_GetCurrentCustomersCount(object oStore); int NWNX_Store_GetIsRestrictedBuyItem(object oStore, int nBaseItem) { - string sFunc = "GetIsRestrictedBuyItem"; - - NWNX_PushArgumentInt(nBaseItem); - NWNX_PushArgumentObject(oStore); - - NWNX_CallFunction(NWNX_Store, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushInt(nBaseItem); + NWNXPushObject(oStore); + NWNXCall(NWNX_Store, "GetIsRestrictedBuyItem"); + return NWNXPopInt(); } int NWNX_Store_GetBlackMarketMarkDown(object oStore) { - string sFunc = "GetBlackMarketMarkDown"; - - NWNX_PushArgumentObject(oStore); - - NWNX_CallFunction(NWNX_Store, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushObject(oStore); + NWNXCall(NWNX_Store, "GetBlackMarketMarkDown"); + return NWNXPopInt(); } void NWNX_Store_SetBlackMarketMarkDown(object oStore, int nValue) { - string sFunc = "SetBlackMarketMarkDown"; - - NWNX_PushArgumentInt(nValue); - NWNX_PushArgumentObject(oStore); - - NWNX_CallFunction(NWNX_Store, sFunc); + NWNXPushInt(nValue); + NWNXPushObject(oStore); + NWNXCall(NWNX_Store, "SetBlackMarketMarkDown"); } int NWNX_Store_GetMarkDown(object oStore) { - string sFunc = "GetMarkDown"; - - NWNX_PushArgumentObject(oStore); - - NWNX_CallFunction(NWNX_Store, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushObject(oStore); + NWNXCall(NWNX_Store, "GetMarkDown"); + return NWNXPopInt(); } void NWNX_Store_SetMarkDown(object oStore, int nValue) { - string sFunc = "SetMarkDown"; - - NWNX_PushArgumentInt(nValue); - NWNX_PushArgumentObject(oStore); - - NWNX_CallFunction(NWNX_Store, sFunc); + NWNXPushInt(nValue); + NWNXPushObject(oStore); + NWNXCall(NWNX_Store, "SetMarkDown"); } int NWNX_Store_GetMarkUp(object oStore) { - string sFunc = "GetMarkUp"; - - NWNX_PushArgumentObject(oStore); - - NWNX_CallFunction(NWNX_Store, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushObject(oStore); + NWNXCall(NWNX_Store, "GetMarkUp"); + return NWNXPopInt(); } void NWNX_Store_SetMarkUp(object oStore, int nValue) { - string sFunc = "SetMarkUp"; - - NWNX_PushArgumentInt(nValue); - NWNX_PushArgumentObject(oStore); - - NWNX_CallFunction(NWNX_Store, sFunc); + NWNXPushInt(nValue); + NWNXPushObject(oStore); + NWNXCall(NWNX_Store, "SetMarkUp"); } int NWNX_Store_GetCurrentCustomersCount(object oStore) { - string sFunc = "GetCurrentCustomersCount"; - - NWNX_PushArgumentObject(oStore); - - NWNX_CallFunction(NWNX_Store, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushObject(oStore); + NWNXCall(NWNX_Store, "GetCurrentCustomersCount"); + return NWNXPopInt(); } diff --git a/_module/nss/nwnx_tileset.nss b/_module/nss/nwnx_tileset.nss index eab4e289..fa07a379 100644 --- a/_module/nss/nwnx_tileset.nss +++ b/_module/nss/nwnx_tileset.nss @@ -2,7 +2,6 @@ /// @brief An advanced plugin that exposes additional tileset and tile properties and allows builders to override the tiles of an area created with CreateArea(). /// @{ /// @file nwnx_tileset.nss -#include "nwnx" const string NWNX_Tileset = "NWNX_Tileset"; ///< @private @@ -166,174 +165,160 @@ void NWNX_Tileset_DeleteOverrideTileData(string sOverrideName, int nIndex); struct NWNX_Tileset_TilesetData NWNX_Tileset_GetTilesetData(string sTileset) { - NWNX_PushArgumentString(sTileset); - NWNX_CallFunction(NWNX_Tileset, "GetTilesetData"); - + NWNXPushString(sTileset); + NWNXCall(NWNX_Tileset, "GetTilesetData"); struct NWNX_Tileset_TilesetData str; - str.bHasHeightTransition = NWNX_GetReturnValueInt(); - str.bInterior = NWNX_GetReturnValueInt(); - str.sUnlocalizedName = NWNX_GetReturnValueString(); - str.nDisplayNameStrRef = NWNX_GetReturnValueInt(); - str.sFloorTerrain = NWNX_GetReturnValueString(); - str.sDefaultTerrain = NWNX_GetReturnValueString(); - str.sBorderTerrain = NWNX_GetReturnValueString(); - str.nNumGroups = NWNX_GetReturnValueInt(); - str.nNumCrossers = NWNX_GetReturnValueInt(); - str.nNumTerrain = NWNX_GetReturnValueInt(); - str.fHeightTransition = NWNX_GetReturnValueFloat(); - str.nNumTileData = NWNX_GetReturnValueInt(); - + str.bHasHeightTransition = NWNXPopInt(); + str.bInterior = NWNXPopInt(); + str.sUnlocalizedName = NWNXPopString(); + str.nDisplayNameStrRef = NWNXPopInt(); + str.sFloorTerrain = NWNXPopString(); + str.sDefaultTerrain = NWNXPopString(); + str.sBorderTerrain = NWNXPopString(); + str.nNumGroups = NWNXPopInt(); + str.nNumCrossers = NWNXPopInt(); + str.nNumTerrain = NWNXPopInt(); + str.fHeightTransition = NWNXPopFloat(); + str.nNumTileData = NWNXPopInt(); return str; } string NWNX_Tileset_GetTilesetTerrain(string sTileset, int nIndex) { - NWNX_PushArgumentInt(nIndex); - NWNX_PushArgumentString(sTileset); - NWNX_CallFunction(NWNX_Tileset, "GetTilesetTerrain"); - - return NWNX_GetReturnValueString(); + NWNXPushInt(nIndex); + NWNXPushString(sTileset); + NWNXCall(NWNX_Tileset, "GetTilesetTerrain"); + return NWNXPopString(); } string NWNX_Tileset_GetTilesetCrosser(string sTileset, int nIndex) { - NWNX_PushArgumentInt(nIndex); - NWNX_PushArgumentString(sTileset); - NWNX_CallFunction(NWNX_Tileset, "GetTilesetCrosser"); - - return NWNX_GetReturnValueString(); + NWNXPushInt(nIndex); + NWNXPushString(sTileset); + NWNXCall(NWNX_Tileset, "GetTilesetCrosser"); + return NWNXPopString(); } struct NWNX_Tileset_TilesetGroupData NWNX_Tileset_GetTilesetGroupData(string sTileset, int nIndex) { - NWNX_PushArgumentInt(nIndex); - NWNX_PushArgumentString(sTileset); - NWNX_CallFunction(NWNX_Tileset, "GetTilesetGroupData"); - + NWNXPushInt(nIndex); + NWNXPushString(sTileset); + NWNXCall(NWNX_Tileset, "GetTilesetGroupData"); struct NWNX_Tileset_TilesetGroupData str; - str.nColumns = NWNX_GetReturnValueInt(); - str.nRows = NWNX_GetReturnValueInt(); - str.nStrRef = NWNX_GetReturnValueInt(); - str.sName = NWNX_GetReturnValueString(); - + str.nColumns = NWNXPopInt(); + str.nRows = NWNXPopInt(); + str.nStrRef = NWNXPopInt(); + str.sName = NWNXPopString(); return str; } int NWNX_Tileset_GetTilesetGroupTile(string sTileset, int nGroupIndex, int nTileIndex) { - NWNX_PushArgumentInt(nTileIndex); - NWNX_PushArgumentInt(nGroupIndex); - NWNX_PushArgumentString(sTileset); - NWNX_CallFunction(NWNX_Tileset, "GetTilesetGroupTile"); - - return NWNX_GetReturnValueInt(); + NWNXPushInt(nTileIndex); + NWNXPushInt(nGroupIndex); + NWNXPushString(sTileset); + NWNXCall(NWNX_Tileset, "GetTilesetGroupTile"); + return NWNXPopInt(); } string NWNX_Tileset_GetTileModel(string sTileset, int nTileID) { - NWNX_PushArgumentInt(nTileID); - NWNX_PushArgumentString(sTileset); - NWNX_CallFunction(NWNX_Tileset, "GetTileModel"); - - return NWNX_GetReturnValueString(); + NWNXPushInt(nTileID); + NWNXPushString(sTileset); + NWNXCall(NWNX_Tileset, "GetTileModel"); + return NWNXPopString(); } string NWNX_Tileset_GetTileMinimapTexture(string sTileset, int nTileID) { - NWNX_PushArgumentInt(nTileID); - NWNX_PushArgumentString(sTileset); - NWNX_CallFunction(NWNX_Tileset, "GetTileMinimapTexture"); - - return NWNX_GetReturnValueString(); + NWNXPushInt(nTileID); + NWNXPushString(sTileset); + NWNXCall(NWNX_Tileset, "GetTileMinimapTexture"); + return NWNXPopString(); } struct NWNX_Tileset_TileEdgesAndCorners NWNX_Tileset_GetTileEdgesAndCorners(string sTileset, int nTileID) { - NWNX_PushArgumentInt(nTileID); - NWNX_PushArgumentString(sTileset); - NWNX_CallFunction(NWNX_Tileset, "GetTileEdgesAndCorners"); - + NWNXPushInt(nTileID); + NWNXPushString(sTileset); + NWNXCall(NWNX_Tileset, "GetTileEdgesAndCorners"); struct NWNX_Tileset_TileEdgesAndCorners str; - str.sLeft = NWNX_GetReturnValueString(); - str.sBottomLeft = NWNX_GetReturnValueString(); - str.sBottom = NWNX_GetReturnValueString(); - str.sBottomRight = NWNX_GetReturnValueString(); - str.sRight = NWNX_GetReturnValueString(); - str.sTopRight = NWNX_GetReturnValueString(); - str.sTop = NWNX_GetReturnValueString(); - str.sTopLeft = NWNX_GetReturnValueString(); - + str.sLeft = NWNXPopString(); + str.sBottomLeft = NWNXPopString(); + str.sBottom = NWNXPopString(); + str.sBottomRight = NWNXPopString(); + str.sRight = NWNXPopString(); + str.sTopRight = NWNXPopString(); + str.sTop = NWNXPopString(); + str.sTopLeft = NWNXPopString(); return str; } int NWNX_Tileset_GetTileNumDoors(string sTileset, int nTileID) { - NWNX_PushArgumentInt(nTileID); - NWNX_PushArgumentString(sTileset); - NWNX_CallFunction(NWNX_Tileset, "GetTileNumDoors"); - - return NWNX_GetReturnValueInt(); + NWNXPushInt(nTileID); + NWNXPushString(sTileset); + NWNXCall(NWNX_Tileset, "GetTileNumDoors"); + return NWNXPopInt(); } struct NWNX_Tileset_TileDoorData NWNX_Tileset_GetTileDoorData(string sTileset, int nTileID, int nIndex = 0) { - NWNX_PushArgumentInt(nIndex); - NWNX_PushArgumentInt(nTileID); - NWNX_PushArgumentString(sTileset); - NWNX_CallFunction(NWNX_Tileset, "GetTileDoorData"); - + NWNXPushInt(nIndex); + NWNXPushInt(nTileID); + NWNXPushString(sTileset); + NWNXCall(NWNX_Tileset, "GetTileDoorData"); struct NWNX_Tileset_TileDoorData str; - str.fOrientation = NWNX_GetReturnValueFloat(); - str.fZ = NWNX_GetReturnValueFloat(); - str.fY = NWNX_GetReturnValueFloat(); - str.fX = NWNX_GetReturnValueFloat(); - str.nType = NWNX_GetReturnValueInt(); - + str.fOrientation = NWNXPopFloat(); + str.fZ = NWNXPopFloat(); + str.fY = NWNXPopFloat(); + str.fX = NWNXPopFloat(); + str.nType = NWNXPopInt(); return str; } void NWNX_Tileset_SetAreaTileOverride(string sAreaResRef, string sOverrideName) { - NWNX_PushArgumentString(sOverrideName); - NWNX_PushArgumentString(sAreaResRef); - NWNX_CallFunction(NWNX_Tileset, "SetAreaTileOverride"); + NWNXPushString(sOverrideName); + NWNXPushString(sAreaResRef); + NWNXCall(NWNX_Tileset, "SetAreaTileOverride"); } void NWNX_Tileset_CreateTileOverride(string sOverrideName, string sTileSet, int nWidth, int nHeight) { - NWNX_PushArgumentInt(nHeight); - NWNX_PushArgumentInt(nWidth); - NWNX_PushArgumentString(sTileSet); - NWNX_PushArgumentString(sOverrideName); - NWNX_CallFunction(NWNX_Tileset, "CreateTileOverride"); + NWNXPushInt(nHeight); + NWNXPushInt(nWidth); + NWNXPushString(sTileSet); + NWNXPushString(sOverrideName); + NWNXCall(NWNX_Tileset, "CreateTileOverride"); } void NWNX_Tileset_DeleteTileOverride(string sOverrideName) { - NWNX_PushArgumentString(sOverrideName); - NWNX_CallFunction(NWNX_Tileset, "DeleteTileOverride"); + NWNXPushString(sOverrideName); + NWNXCall(NWNX_Tileset, "DeleteTileOverride"); } void NWNX_Tileset_SetOverrideTileData(string sOverrideName, int nIndex, struct NWNX_Tileset_CustomTileData strCustomTileData) { - NWNX_PushArgumentInt(strCustomTileData.bAnimLoop3); - NWNX_PushArgumentInt(strCustomTileData.bAnimLoop2); - NWNX_PushArgumentInt(strCustomTileData.bAnimLoop1); - NWNX_PushArgumentInt(strCustomTileData.nSourceLightColor2); - NWNX_PushArgumentInt(strCustomTileData.nSourceLightColor1); - NWNX_PushArgumentInt(strCustomTileData.nMainLightColor2); - NWNX_PushArgumentInt(strCustomTileData.nMainLightColor1); - NWNX_PushArgumentInt(strCustomTileData.nHeight); - NWNX_PushArgumentInt(strCustomTileData.nOrientation); - NWNX_PushArgumentInt(strCustomTileData.nTileID); - NWNX_PushArgumentInt(nIndex); - NWNX_PushArgumentString(sOverrideName); - NWNX_CallFunction(NWNX_Tileset, "SetOverrideTileData"); + NWNXPushInt(strCustomTileData.bAnimLoop3); + NWNXPushInt(strCustomTileData.bAnimLoop2); + NWNXPushInt(strCustomTileData.bAnimLoop1); + NWNXPushInt(strCustomTileData.nSourceLightColor2); + NWNXPushInt(strCustomTileData.nSourceLightColor1); + NWNXPushInt(strCustomTileData.nMainLightColor2); + NWNXPushInt(strCustomTileData.nMainLightColor1); + NWNXPushInt(strCustomTileData.nHeight); + NWNXPushInt(strCustomTileData.nOrientation); + NWNXPushInt(strCustomTileData.nTileID); + NWNXPushInt(nIndex); + NWNXPushString(sOverrideName); + NWNXCall(NWNX_Tileset, "SetOverrideTileData"); } void NWNX_Tileset_DeleteOverrideTileData(string sOverrideName, int nIndex) { - NWNX_PushArgumentInt(nIndex); - NWNX_PushArgumentString(sOverrideName); - NWNX_CallFunction(NWNX_Tileset, "DeleteOverrideTileData"); + NWNXPushInt(nIndex); + NWNXPushString(sOverrideName); + NWNXCall(NWNX_Tileset, "DeleteOverrideTileData"); } diff --git a/_module/nss/nwnx_time.nss b/_module/nss/nwnx_time.nss index 44d949e9..7b1788b7 100644 --- a/_module/nss/nwnx_time.nss +++ b/_module/nss/nwnx_time.nss @@ -2,7 +2,6 @@ /// @brief Provides various time related functions /// @{ /// @file nwnx_time.nss -#include "nwnx" #include "nwnx_util" #include "inc_sqlite_time" diff --git a/_module/nss/nwnx_util.nss b/_module/nss/nwnx_util.nss index ef32e355..1de3d14d 100644 --- a/_module/nss/nwnx_util.nss +++ b/_module/nss/nwnx_util.nss @@ -2,7 +2,6 @@ /// @brief Provides various utility functions that don't have a better home /// @{ /// @file nwnx_util.nss -#include "nwnx" const string NWNX_Util = "NWNX_Util"; ///< @private @@ -174,12 +173,6 @@ int NWNX_Util_RegisterServerConsoleCommand(string sCommand, string sScriptChunk) /// @param sCommand The name of the command. void NWNX_Util_UnregisterServerConsoleCommand(string sCommand); -/// @brief Determines if the given plugin exists and is enabled. -/// @param sPlugin The name of the plugin to check. This is the case sensitive plugin name as used by NWNX_CallFunction, NWNX_PushArgumentX -/// @note Example usage: NWNX_Util_PluginExists("NWNX_Creature"); -/// @return TRUE if the plugin exists and is enabled, otherwise FALSE. -int NWNX_Util_PluginExists(string sPlugin); - /// @brief Gets the server's current working user folder. /// @return The absolute path of the server's home directory (-userDirectory) string NWNX_Util_GetUserDirectory(); @@ -228,10 +221,18 @@ int NWNX_Util_GetScriptParamIsSet(string sParamName); /// @param nDawnHour The new dawn hour void NWNX_Util_SetDawnHour(int nDawnHour); +/// @brief Get the module dawn hour. +/// @return The dawn hour +int NWNX_Util_GetDawnHour(); + /// @brief Set the module dusk hour. /// @param nDuskHour The new dusk hour void NWNX_Util_SetDuskHour(int nDuskHour); +/// @brief Get the module dusk hour. +/// @return The dusk hour +int NWNX_Util_GetDuskHour(); + /// @return Returns the number of microseconds since midnight on January 1, 1970. struct NWNX_Util_HighResTimestamp NWNX_Util_GetHighResTimeStamp(); @@ -263,397 +264,327 @@ int NWNX_Util_CleanResourceDirectory(string sAlias, int nResType = 0xFFFF); /// @return The name string NWNX_Util_GetModuleTlkFile(); +/// @brief Update a resource directory by having ResMan reindex it. +/// @param sAlias A resource directory alias, eg: TEMP +/// @return TRUE if successful, FALSE on error. +int NWNX_Util_UpdateResourceDirectory(string sAlias); + /// @} string NWNX_Util_GetCurrentScriptName(int depth = 0) { - string sFunc = "GetCurrentScriptName"; - NWNX_PushArgumentInt(depth); - NWNX_CallFunction(NWNX_Util, sFunc); - return NWNX_GetReturnValueString(); + NWNXPushInt(depth); + NWNXCall(NWNX_Util, "GetCurrentScriptName"); + return NWNXPopString(); } string NWNX_Util_GetAsciiTableString() { - string sFunc = "GetAsciiTableString"; - NWNX_CallFunction(NWNX_Util, sFunc); - return NWNX_GetReturnValueString(); + NWNXCall(NWNX_Util, "GetAsciiTableString"); + return NWNXPopString(); } int NWNX_Util_Hash(string str) { - string sFunc = "Hash"; - NWNX_PushArgumentString(str); - NWNX_CallFunction(NWNX_Util, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushString(str); + NWNXCall(NWNX_Util, "Hash"); + return NWNXPopInt(); } int NWNX_Util_GetModuleMtime() { - NWNX_CallFunction(NWNX_Util, "GetModuleMtime"); - return NWNX_GetReturnValueInt(); + NWNXCall(NWNX_Util, "GetModuleMtime"); + return NWNXPopInt(); } string NWNX_Util_GetModuleFile() { - NWNX_CallFunction(NWNX_Util, "GetModuleFile"); - return NWNX_GetReturnValueString(); + NWNXCall(NWNX_Util, "GetModuleFile"); + return NWNXPopString(); } string NWNX_Util_GetCustomToken(int customTokenNumber) { - string sFunc = "GetCustomToken"; - NWNX_PushArgumentInt(customTokenNumber); - NWNX_CallFunction(NWNX_Util, sFunc); - return NWNX_GetReturnValueString(); + NWNXPushInt(customTokenNumber); + NWNXCall(NWNX_Util, "GetCustomToken"); + return NWNXPopString(); } itemproperty NWNX_Util_EffectToItemProperty(effect e) { - string sFunc = "EffectTypeCast"; - NWNX_PushArgumentEffect(e); - NWNX_CallFunction(NWNX_Util, sFunc); - return NWNX_GetReturnValueItemProperty(); + NWNXPushEffect(e); + NWNXCall(NWNX_Util, "EffectTypeCast"); + return NWNXPopItemProperty(); } effect NWNX_Util_ItemPropertyToEffect(itemproperty ip) { - string sFunc = "EffectTypeCast"; - NWNX_PushArgumentItemProperty(ip); - NWNX_CallFunction(NWNX_Util, sFunc); - return NWNX_GetReturnValueEffect(); + NWNXPushItemProperty(ip); + NWNXCall(NWNX_Util, "EffectTypeCast"); + return NWNXPopEffect(); } string NWNX_Util_StripColors(string str) { - string sFunc = "StripColors"; - NWNX_PushArgumentString(str); - NWNX_CallFunction(NWNX_Util, sFunc); - return NWNX_GetReturnValueString(); + NWNXPushString(str); + NWNXCall(NWNX_Util, "StripColors"); + return NWNXPopString(); } string NWNX_Util_GetEnvironmentVariable(string sVarname) { - string sFunc = "GetEnvironmentVariable"; - NWNX_PushArgumentString(sVarname); - NWNX_CallFunction(NWNX_Util, sFunc); - return NWNX_GetReturnValueString(); + NWNXPushString(sVarname); + NWNXCall(NWNX_Util, "GetEnvironmentVariable"); + return NWNXPopString(); } int NWNX_Util_GetMinutesPerHour() { - string sFunc = "GetMinutesPerHour"; - NWNX_CallFunction(NWNX_Util, sFunc); - return NWNX_GetReturnValueInt(); + NWNXCall(NWNX_Util, "GetMinutesPerHour"); + return NWNXPopInt(); } void NWNX_Util_SetMinutesPerHour(int minutes) { - string sFunc = "SetMinutesPerHour"; - NWNX_PushArgumentInt(minutes); - NWNX_CallFunction(NWNX_Util, sFunc); + NWNXPushInt(minutes); + NWNXCall(NWNX_Util, "SetMinutesPerHour"); } string NWNX_Util_EncodeStringForURL(string sURL) { - string sFunc = "EncodeStringForURL"; - - NWNX_PushArgumentString(sURL); - NWNX_CallFunction(NWNX_Util, sFunc); - - return NWNX_GetReturnValueString(); + NWNXPushString(sURL); + NWNXCall(NWNX_Util, "EncodeStringForURL"); + return NWNXPopString(); } string NWNX_Util_GetFirstResRef(int nType, string sRegexFilter = "", int bModuleResourcesOnly = TRUE) { - string sFunc = "GetFirstResRef"; - - NWNX_PushArgumentInt(bModuleResourcesOnly); - NWNX_PushArgumentString(sRegexFilter); - NWNX_PushArgumentInt(nType); - NWNX_CallFunction(NWNX_Util, sFunc); - - return NWNX_GetReturnValueString(); + NWNXPushInt(bModuleResourcesOnly); + NWNXPushString(sRegexFilter); + NWNXPushInt(nType); + NWNXCall(NWNX_Util, "GetFirstResRef"); + return NWNXPopString(); } string NWNX_Util_GetNextResRef() { - string sFunc = "GetNextResRef"; - - NWNX_CallFunction(NWNX_Util, sFunc); - - return NWNX_GetReturnValueString(); + NWNXCall(NWNX_Util, "GetNextResRef"); + return NWNXPopString(); } object NWNX_Util_GetLastCreatedObject(int nObjectType, int nNthLast = 1) { - string sFunc = "GetLastCreatedObject"; - - NWNX_PushArgumentInt(nNthLast); - NWNX_PushArgumentInt(nObjectType); - NWNX_CallFunction(NWNX_Util, sFunc); - - return NWNX_GetReturnValueObject(); + NWNXPushInt(nNthLast); + NWNXPushInt(nObjectType); + NWNXCall(NWNX_Util, "GetLastCreatedObject"); + return NWNXPopObject(); } string NWNX_Util_AddScript(string sFileName, string sScriptData, int bWrapIntoMain = FALSE, string sAlias = "NWNX") { - string sFunc = "AddScript"; - - NWNX_PushArgumentString(sAlias); - NWNX_PushArgumentInt(bWrapIntoMain); - NWNX_PushArgumentString(sScriptData); - NWNX_PushArgumentString(sFileName); - NWNX_CallFunction(NWNX_Util, sFunc); - - return NWNX_GetReturnValueString(); + NWNXPushString(sAlias); + NWNXPushInt(bWrapIntoMain); + NWNXPushString(sScriptData); + NWNXPushString(sFileName); + NWNXCall(NWNX_Util, "AddScript"); + return NWNXPopString(); } int NWNX_Util_AddNSSFile(string sFileName, string sContents, string sAlias = "NWNX") { - string sFunc = "AddNSSFile"; - - NWNX_PushArgumentString(sAlias); - NWNX_PushArgumentString(sContents); - NWNX_PushArgumentString(sFileName); - NWNX_CallFunction(NWNX_Util, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushString(sAlias); + NWNXPushString(sContents); + NWNXPushString(sFileName); + NWNXCall(NWNX_Util, "AddNSSFile"); + return NWNXPopInt(); } int NWNX_Util_RemoveNWNXResourceFile(string sFileName, int nType, string sAlias = "NWNX") { - string sFunc = "RemoveNWNXResourceFile"; - - NWNX_PushArgumentString(sAlias); - NWNX_PushArgumentInt(nType); - NWNX_PushArgumentString(sFileName); - NWNX_CallFunction(NWNX_Util, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushString(sAlias); + NWNXPushInt(nType); + NWNXPushString(sFileName); + NWNXCall(NWNX_Util, "RemoveNWNXResourceFile"); + return NWNXPopInt(); } void NWNX_Util_SetInstructionLimit(int nInstructionLimit) { - string sFunc = "SetInstructionLimit"; - - NWNX_PushArgumentInt(nInstructionLimit); - NWNX_CallFunction(NWNX_Util, sFunc); + NWNXPushInt(nInstructionLimit); + NWNXCall(NWNX_Util, "SetInstructionLimit"); } int NWNX_Util_GetInstructionLimit() { - string sFunc = "GetInstructionLimit"; - - NWNX_CallFunction(NWNX_Util, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXCall(NWNX_Util, "GetInstructionLimit"); + return NWNXPopInt(); } void NWNX_Util_SetInstructionsExecuted(int nInstructions) { - string sFunc = "SetInstructionsExecuted"; - - NWNX_PushArgumentInt(nInstructions); - NWNX_CallFunction(NWNX_Util, sFunc); + NWNXPushInt(nInstructions); + NWNXCall(NWNX_Util, "SetInstructionsExecuted"); } int NWNX_Util_GetInstructionsExecuted() { - string sFunc = "GetInstructionsExecuted"; - - NWNX_CallFunction(NWNX_Util, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXCall(NWNX_Util, "GetInstructionsExecuted"); + return NWNXPopInt(); } int NWNX_Util_RegisterServerConsoleCommand(string sCommand, string sScriptChunk) { - string sFunc = "RegisterServerConsoleCommand"; - - NWNX_PushArgumentString(sScriptChunk); - NWNX_PushArgumentString(sCommand); - NWNX_CallFunction(NWNX_Util, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushString(sScriptChunk); + NWNXPushString(sCommand); + NWNXCall(NWNX_Util, "RegisterServerConsoleCommand"); + return NWNXPopInt(); } void NWNX_Util_UnregisterServerConsoleCommand(string sCommand) { - string sFunc = "UnregisterServerConsoleCommand"; - - NWNX_PushArgumentString(sCommand); - NWNX_CallFunction(NWNX_Util, sFunc); -} - -int NWNX_Util_PluginExists(string sPlugin) -{ - WriteTimestampedLogEntry("WARNING: NWNX_Util_PluginExists is deprecated. You should migrate to NWNX_PluginExists."); - return NWNX_PluginExists(sPlugin); + NWNXPushString(sCommand); + NWNXCall(NWNX_Util, "UnregisterServerConsoleCommand"); } string NWNX_Util_GetUserDirectory() { - string sFunc = "GetUserDirectory"; - NWNX_CallFunction(NWNX_Util, sFunc); - return NWNX_GetReturnValueString(); + NWNXCall(NWNX_Util, "GetUserDirectory"); + return NWNXPopString(); } int NWNX_Util_GetScriptReturnValue() { - string sFunc = "GetScriptReturnValue"; - - NWNX_CallFunction(NWNX_Util, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXCall(NWNX_Util, "GetScriptReturnValue"); + return NWNXPopInt(); } object NWNX_Util_CreateDoor(string sResRef, location locLocation, string sNewTag = "", int nAppearanceType = -1) { - string sFunc = "CreateDoor"; - - vector vPosition = GetPositionFromLocation(locLocation); - - NWNX_PushArgumentInt(nAppearanceType); - NWNX_PushArgumentString(sNewTag); - NWNX_PushArgumentFloat(GetFacingFromLocation(locLocation)); - NWNX_PushArgumentFloat(vPosition.z); - NWNX_PushArgumentFloat(vPosition.y); - NWNX_PushArgumentFloat(vPosition.x); - NWNX_PushArgumentObject(GetAreaFromLocation(locLocation)); - NWNX_PushArgumentString(sResRef); - NWNX_CallFunction(NWNX_Util, sFunc); - - return NWNX_GetReturnValueObject(); + NWNXPushInt(nAppearanceType); + NWNXPushString(sNewTag); + NWNXPushLocation(locLocation); + NWNXPushString(sResRef); + NWNXCall(NWNX_Util, "CreateDoor"); + return NWNXPopObject(); } void NWNX_Util_SetItemActivator(object oObject) { - string sFunc = "SetItemActivator"; - - NWNX_PushArgumentObject(oObject); - NWNX_CallFunction(NWNX_Util, sFunc); + NWNXPushObject(oObject); + NWNXCall(NWNX_Util, "SetItemActivator"); } struct NWNX_Util_WorldTime NWNX_Util_GetWorldTime(float fAdjustment = 0.0f) { - string sFunc = "GetWorldTime"; - - NWNX_PushArgumentFloat(fAdjustment); - NWNX_CallFunction(NWNX_Util, sFunc); - + NWNXPushFloat(fAdjustment); + NWNXCall(NWNX_Util, "GetWorldTime"); struct NWNX_Util_WorldTime strWorldTime; - strWorldTime.nTimeOfDay = NWNX_GetReturnValueInt(); - strWorldTime.nCalendarDay = NWNX_GetReturnValueInt(); - + strWorldTime.nTimeOfDay = NWNXPopInt(); + strWorldTime.nCalendarDay = NWNXPopInt(); return strWorldTime; } void NWNX_Util_SetResourceOverride(int nResType, string sOldName, string sNewName) { - string sFunc = "SetResourceOverride"; - - NWNX_PushArgumentString(sNewName); - NWNX_PushArgumentString(sOldName); - NWNX_PushArgumentInt(nResType); - NWNX_CallFunction(NWNX_Util, sFunc); + NWNXPushString(sNewName); + NWNXPushString(sOldName); + NWNXPushInt(nResType); + NWNXCall(NWNX_Util, "SetResourceOverride"); } string NWNX_Util_GetResourceOverride(int nResType, string sName) { - string sFunc = "GetResourceOverride"; - - NWNX_PushArgumentString(sName); - NWNX_PushArgumentInt(nResType); - NWNX_CallFunction(NWNX_Util, sFunc); - - return NWNX_GetReturnValueString(); + NWNXPushString(sName); + NWNXPushInt(nResType); + NWNXCall(NWNX_Util, "GetResourceOverride"); + return NWNXPopString(); } int NWNX_Util_GetScriptParamIsSet(string sParamName) { - string sFunc = "GetScriptParamIsSet"; - - NWNX_PushArgumentString(sParamName); - NWNX_CallFunction(NWNX_Util, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushString(sParamName); + NWNXCall(NWNX_Util, "GetScriptParamIsSet"); + return NWNXPopInt(); } void NWNX_Util_SetDawnHour(int nDawnHour) { - string sFunc = "SetDawnHour"; + NWNXPushInt(nDawnHour); + NWNXCall(NWNX_Util, "SetDawnHour"); +} - NWNX_PushArgumentInt(nDawnHour); - NWNX_CallFunction(NWNX_Util, sFunc); +int NWNX_Util_GetDawnHour() +{ + NWNXCall(NWNX_Util, "GetDawnHour"); + return NWNXPopInt(); } void NWNX_Util_SetDuskHour(int nDuskHour) { - string sFunc = "SetDuskHour"; + NWNXPushInt(nDuskHour); + NWNXCall(NWNX_Util, "SetDuskHour"); +} - NWNX_PushArgumentInt(nDuskHour); - NWNX_CallFunction(NWNX_Util, sFunc); +int NWNX_Util_GetDuskHour() +{ + NWNXCall(NWNX_Util, "GetDuskHour"); + return NWNXPopInt(); } struct NWNX_Util_HighResTimestamp NWNX_Util_GetHighResTimeStamp() { struct NWNX_Util_HighResTimestamp t; - string sFunc = "GetHighResTimeStamp"; - - NWNX_CallFunction(NWNX_Util, sFunc); - t.microseconds = NWNX_GetReturnValueInt(); - t.seconds = NWNX_GetReturnValueInt(); + NWNXCall(NWNX_Util, "GetHighResTimeStamp"); + t.microseconds = NWNXPopInt(); + t.seconds = NWNXPopInt(); return t; } string NWNX_Util_GetTTY() { - string sFunc = "GetTTY"; - - NWNX_CallFunction(NWNX_Util, sFunc); - return NWNX_GetReturnValueString(); + NWNXCall(NWNX_Util, "GetTTY"); + return NWNXPopString(); } void NWNX_Util_SetCurrentlyRunningEvent(int nEventID) { - string sFunc = "SetCurrentlyRunningEvent"; - - NWNX_PushArgumentInt(nEventID); - NWNX_CallFunction(NWNX_Util, sFunc); + NWNXPushInt(nEventID); + NWNXCall(NWNX_Util, "SetCurrentlyRunningEvent"); } int NWNX_Util_GetStringLevenshteinDistance(string sString, string sCompareTo) { - string sFunc = "LevenshteinDistance"; - - NWNX_PushArgumentString(sCompareTo); - NWNX_PushArgumentString(sString); - NWNX_CallFunction(NWNX_Util, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushString(sCompareTo); + NWNXPushString(sString); + NWNXCall(NWNX_Util, "GetStringLevenshteinDistance"); + return NWNXPopInt(); } void NWNX_Util_UpdateClientObject(object oObjectToUpdate, object oPlayer = OBJECT_INVALID) { - string sFunc = "UpdateClientObject"; - - NWNX_PushArgumentObject(oPlayer); - NWNX_PushArgumentObject(oObjectToUpdate); - NWNX_CallFunction(NWNX_Util, sFunc); + NWNXPushObject(oPlayer); + NWNXPushObject(oObjectToUpdate); + NWNXCall(NWNX_Util, "UpdateClientObject"); } int NWNX_Util_CleanResourceDirectory(string sAlias, int nResType = 0xFFFF) { - string sFunc = "CleanResourceDirectory"; - NWNX_PushArgumentInt(nResType); - NWNX_PushArgumentString(sAlias); - NWNX_CallFunction(NWNX_Util, sFunc); - return NWNX_GetReturnValueInt(); + NWNXPushInt(nResType); + NWNXPushString(sAlias); + NWNXCall(NWNX_Util, "CleanResourceDirectory"); + return NWNXPopInt(); } string NWNX_Util_GetModuleTlkFile() { string sFunc = "GetModuleTlkFile"; - NWNX_CallFunction(NWNX_Util, sFunc); - return NWNX_GetReturnValueString(); + NWNXCall(NWNX_Util, sFunc); + return NWNXPopString(); +} + +int NWNX_Util_UpdateResourceDirectory(string sAlias) +{ + NWNXPushString(sAlias); + NWNXCall(NWNX_Util, "UpdateResourceDirectory"); + return NWNXPopInt(); } diff --git a/_module/nss/nwnx_visibility.nss b/_module/nss/nwnx_visibility.nss index 3ef03b1f..be70ed0c 100644 --- a/_module/nss/nwnx_visibility.nss +++ b/_module/nss/nwnx_visibility.nss @@ -2,7 +2,6 @@ /// @brief Functions to manipulate visibility of objects both globally or per observer /// @{ /// @file nwnx_visibility.nss -#include "nwnx" const string NWNX_Visibility = "NWNX_Visibility"; ///< @private @@ -57,21 +56,16 @@ void NWNX_Visibility_SetVisibilityOverride(object oPlayer, object oTarget, int n int NWNX_Visibility_GetVisibilityOverride(object oPlayer, object oTarget) { - string sFunc = "GetVisibilityOverride"; - - NWNX_PushArgumentObject(oTarget); - NWNX_PushArgumentObject(oPlayer); - NWNX_CallFunction(NWNX_Visibility, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(oTarget); + NWNXPushObject(oPlayer); + NWNXCall(NWNX_Visibility, "GetVisibilityOverride"); + return NWNXPopInt(); } void NWNX_Visibility_SetVisibilityOverride(object oPlayer, object oTarget, int nOverride) { - string sFunc = "SetVisibilityOverride"; - - NWNX_PushArgumentInt(nOverride); - NWNX_PushArgumentObject(oTarget); - NWNX_PushArgumentObject(oPlayer); - NWNX_CallFunction(NWNX_Visibility, sFunc); + NWNXPushInt(nOverride); + NWNXPushObject(oTarget); + NWNXPushObject(oPlayer); + NWNXCall(NWNX_Visibility, "SetVisibilityOverride"); } diff --git a/_module/nss/nwnx_weapon.nss b/_module/nss/nwnx_weapon.nss index 8470d9ff..eced73f0 100644 --- a/_module/nss/nwnx_weapon.nss +++ b/_module/nss/nwnx_weapon.nss @@ -2,7 +2,6 @@ /// @brief Functions exposing additional weapon properties. /// @{ /// @file nwnx_weapon.nss -#include "nwnx" const string NWNX_Weapon = "NWNX_Weapon"; ///< @private @@ -138,214 +137,152 @@ void NWNX_Weapon_SetMaxRangedAttackDistanceOverride(int nBaseItem, float fMax, f void NWNX_Weapon_SetWeaponFocusFeat(int nBaseItem, int nFeat) { - string sFunc = "SetWeaponFocusFeat"; - - NWNX_PushArgumentInt(nFeat); - NWNX_PushArgumentInt(nBaseItem); - - NWNX_CallFunction(NWNX_Weapon, sFunc); + NWNXPushInt(nFeat); + NWNXPushInt(nBaseItem); + NWNXCall(NWNX_Weapon, "SetWeaponFocusFeat"); } void NWNX_Weapon_SetEpicWeaponFocusFeat(int nBaseItem, int nFeat) { - string sFunc = "SetEpicWeaponFocusFeat"; - - NWNX_PushArgumentInt(nFeat); - NWNX_PushArgumentInt(nBaseItem); - - NWNX_CallFunction(NWNX_Weapon, sFunc); + NWNXPushInt(nFeat); + NWNXPushInt(nBaseItem); + NWNXCall(NWNX_Weapon, "SetEpicWeaponFocusFeat"); } void NWNX_Weapon_SetGreaterWeaponFocusFeat(int nBaseItem, int nFeat) { - string sFunc = "SetGreaterWeaponFocusFeat"; - - NWNX_PushArgumentInt(nFeat); - NWNX_PushArgumentInt(nBaseItem); - - NWNX_CallFunction(NWNX_Weapon, sFunc); + NWNXPushInt(nFeat); + NWNXPushInt(nBaseItem); + NWNXCall(NWNX_Weapon, "SetGreaterWeaponFocusFeat"); } void NWNX_Weapon_SetWeaponFinesseSize(int nBaseItem, int nSize) { - string sFunc = "SetWeaponFinesseSize"; - - NWNX_PushArgumentInt(nSize); - NWNX_PushArgumentInt(nBaseItem); - - NWNX_CallFunction(NWNX_Weapon, sFunc); + NWNXPushInt(nSize); + NWNXPushInt(nBaseItem); + NWNXCall(NWNX_Weapon, "SetWeaponFinesseSize"); } int NWNX_Weapon_GetWeaponFinesseSize(int nBaseItem) { - string sFunc = "GetWeaponFinesseSize"; - - NWNX_PushArgumentInt(nBaseItem); - - NWNX_CallFunction(NWNX_Weapon, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushInt(nBaseItem); + NWNXCall(NWNX_Weapon, "GetWeaponFinesseSize"); + return NWNXPopInt(); } void NWNX_Weapon_SetWeaponUnarmed(int nBaseItem) { - string sFunc = "SetWeaponUnarmed"; - - NWNX_PushArgumentInt(nBaseItem); - - NWNX_CallFunction(NWNX_Weapon, sFunc); + NWNXPushInt(nBaseItem); + NWNXCall(NWNX_Weapon, "SetWeaponUnarmed"); } void NWNX_Weapon_SetWeaponIsMonkWeapon(int nBaseItem) { WriteTimestampedLogEntry("NWNX_Weapon_SetWeaponIsMonkWeapon() is deprecated. Please use baseitems.2da instead."); - - string sFunc = "SetWeaponIsMonkWeapon"; - - NWNX_PushArgumentInt(nBaseItem); - - NWNX_CallFunction(NWNX_Weapon, sFunc); + NWNXPushInt(nBaseItem); + NWNXCall(NWNX_Weapon, "SetWeaponIsMonkWeapon"); } void NWNX_Weapon_SetWeaponImprovedCriticalFeat(int nBaseItem, int nFeat) { - string sFunc = "SetWeaponImprovedCriticalFeat"; - - NWNX_PushArgumentInt(nFeat); - NWNX_PushArgumentInt(nBaseItem); - - NWNX_CallFunction(NWNX_Weapon, sFunc); + NWNXPushInt(nFeat); + NWNXPushInt(nBaseItem); + NWNXCall(NWNX_Weapon, "SetWeaponImprovedCriticalFeat"); } void NWNX_Weapon_SetWeaponSpecializationFeat(int nBaseItem, int nFeat) { - string sFunc = "SetWeaponSpecializationFeat"; - - NWNX_PushArgumentInt(nFeat); - NWNX_PushArgumentInt(nBaseItem); - - NWNX_CallFunction(NWNX_Weapon, sFunc); + NWNXPushInt(nFeat); + NWNXPushInt(nBaseItem); + NWNXCall(NWNX_Weapon, "SetWeaponSpecializationFeat"); } void NWNX_Weapon_SetGreaterWeaponSpecializationFeat(int nBaseItem, int nFeat) { - string sFunc = "SetGreaterWeaponSpecializationFeat"; - - NWNX_PushArgumentInt(nFeat); - NWNX_PushArgumentInt(nBaseItem); - - NWNX_CallFunction(NWNX_Weapon, sFunc); + NWNXPushInt(nFeat); + NWNXPushInt(nBaseItem); + NWNXCall(NWNX_Weapon, "SetGreaterWeaponSpecializationFeat"); } void NWNX_Weapon_SetEpicWeaponSpecializationFeat(int nBaseItem, int nFeat) { - string sFunc = "SetEpicWeaponSpecializationFeat"; - - NWNX_PushArgumentInt(nFeat); - NWNX_PushArgumentInt(nBaseItem); - - NWNX_CallFunction(NWNX_Weapon, sFunc); + NWNXPushInt(nFeat); + NWNXPushInt(nBaseItem); + NWNXCall(NWNX_Weapon, "SetEpicWeaponSpecializationFeat"); } void NWNX_Weapon_SetEpicWeaponOverwhelmingCriticalFeat(int nBaseItem, int nFeat) { - string sFunc = "SetEpicWeaponOverwhelmingCriticalFeat"; - - NWNX_PushArgumentInt(nFeat); - NWNX_PushArgumentInt(nBaseItem); - - NWNX_CallFunction(NWNX_Weapon, sFunc); + NWNXPushInt(nFeat); + NWNXPushInt(nBaseItem); + NWNXCall(NWNX_Weapon, "SetEpicWeaponOverwhelmingCriticalFeat"); } void NWNX_Weapon_SetEpicWeaponDevastatingCriticalFeat(int nBaseItem, int nFeat) { - string sFunc = "SetEpicWeaponDevastatingCriticalFeat"; - - NWNX_PushArgumentInt(nFeat); - NWNX_PushArgumentInt(nBaseItem); - - NWNX_CallFunction(NWNX_Weapon, sFunc); + NWNXPushInt(nFeat); + NWNXPushInt(nBaseItem); + NWNXCall(NWNX_Weapon, "SetEpicWeaponDevastatingCriticalFeat"); } void NWNX_Weapon_SetWeaponOfChoiceFeat(int nBaseItem, int nFeat) { - string sFunc = "SetWeaponOfChoiceFeat"; - - NWNX_PushArgumentInt(nFeat); - NWNX_PushArgumentInt(nBaseItem); - - NWNX_CallFunction(NWNX_Weapon, sFunc); + NWNXPushInt(nFeat); + NWNXPushInt(nBaseItem); + NWNXCall(NWNX_Weapon, "SetWeaponOfChoiceFeat"); } void NWNX_Weapon_SetOption(int nOption, int nVal) { - string sFunc = "SetOption"; - - NWNX_PushArgumentInt(nVal); - NWNX_PushArgumentInt(nOption); - - NWNX_CallFunction(NWNX_Weapon, sFunc); + NWNXPushInt(nVal); + NWNXPushInt(nOption); + NWNXCall(NWNX_Weapon, "SetOption"); } void NWNX_Weapon_SetDevastatingCriticalEventScript(string sScript) { - string sFunc = "SetDevastatingCriticalEventScript"; - - NWNX_PushArgumentString(sScript); - - NWNX_CallFunction(NWNX_Weapon, sFunc); + NWNXPushString(sScript); + NWNXCall(NWNX_Weapon, "SetDevastatingCriticalEventScript"); } void NWNX_Weapon_BypassDevastatingCritical() { - string sFunc = "SetEventData"; - - NWNX_PushArgumentInt(1); - NWNX_PushArgumentInt(NWNX_WEAPON_SETDATA_DC_BYPASS); - - NWNX_CallFunction(NWNX_Weapon, sFunc); + NWNXPushInt(1); + NWNXPushInt(NWNX_WEAPON_SETDATA_DC_BYPASS); + NWNXCall(NWNX_Weapon, "SetEventData"); } struct NWNX_Weapon_DevastatingCriticalEvent_Data NWNX_Weapon_GetDevastatingCriticalEventData() { - string sFunc = "GetEventData"; struct NWNX_Weapon_DevastatingCriticalEvent_Data data; - - NWNX_PushArgumentInt(NWNX_WEAPON_GETDATA_DC); - NWNX_CallFunction(NWNX_Weapon, sFunc); - - data.oWeapon = NWNX_GetReturnValueObject(); - data.oTarget = NWNX_GetReturnValueObject(); - data.nDamage = NWNX_GetReturnValueInt(); - + NWNXPushInt(NWNX_WEAPON_GETDATA_DC); + NWNXCall(NWNX_Weapon, "GetEventData"); + data.oWeapon = NWNXPopObject(); + data.oTarget = NWNXPopObject(); + data.nDamage = NWNXPopInt(); return data; } void NWNX_Weapon_SetOneHalfStrength(object oWeapon, int nEnable, int bPersist = FALSE) { - string sFunc = "SetOneHalfStrength"; - NWNX_PushArgumentInt(bPersist); - NWNX_PushArgumentInt(nEnable); - NWNX_PushArgumentObject(oWeapon); - NWNX_CallFunction(NWNX_Weapon, sFunc); + NWNXPushInt(bPersist); + NWNXPushInt(nEnable); + NWNXPushObject(oWeapon); + NWNXCall(NWNX_Weapon, "SetOneHalfStrength"); } int NWNX_Weapon_GetOneHalfStrength(object oWeapon) { - string sFunc = "GetOneHalfStrength"; - NWNX_PushArgumentObject(oWeapon); - NWNX_CallFunction(NWNX_Weapon, sFunc); - - return NWNX_GetReturnValueInt(); + NWNXPushObject(oWeapon); + NWNXCall(NWNX_Weapon, "GetOneHalfStrength"); + return NWNXPopInt(); } void NWNX_Weapon_SetMaxRangedAttackDistanceOverride(int nBaseItem, float fMax, float fMaxPassive, float fPreferred) { - string sFunc = "SetMaxRangedAttackDistanceOverride"; - - NWNX_PushArgumentFloat(fPreferred); - NWNX_PushArgumentFloat(fMaxPassive); - NWNX_PushArgumentFloat(fMax); - NWNX_PushArgumentInt(nBaseItem); - NWNX_CallFunction(NWNX_Weapon, sFunc); + NWNXPushFloat(fPreferred); + NWNXPushFloat(fMaxPassive); + NWNXPushFloat(fMax); + NWNXPushInt(nBaseItem); + NWNXCall(NWNX_Weapon, "SetMaxRangedAttackDistanceOverride"); } diff --git a/_module/nss/nwnx_webhook.nss b/_module/nss/nwnx_webhook.nss index f1f2e82f..2d7e7ed0 100644 --- a/_module/nss/nwnx_webhook.nss +++ b/_module/nss/nwnx_webhook.nss @@ -2,7 +2,6 @@ /// @brief Send messages to external entities through web hooks. /// @{ /// @file nwnx_webhook.nss -#include "nwnx" const string NWNX_WebHook = "NWNX_WebHook"; ///< @private @@ -28,13 +27,12 @@ void NWNX_WebHook_ResendWebHookHTTPS(string host, string path, string sMessage, void NWNX_WebHook_SendWebHookHTTPS(string host, string path, string message, string username = "", int mrkdwn = 1) { - string sFunc = "SendWebHookHTTPS"; - NWNX_PushArgumentInt(mrkdwn); - NWNX_PushArgumentString(username); - NWNX_PushArgumentString(message); - NWNX_PushArgumentString(path); - NWNX_PushArgumentString(host); - NWNX_CallFunction(NWNX_WebHook, sFunc); + NWNXPushInt(mrkdwn); + NWNXPushString(username); + NWNXPushString(message); + NWNXPushString(path); + NWNXPushString(host); + NWNXCall(NWNX_WebHook, "SendWebHookHTTPS"); } void NWNX_WebHook_ResendWebHookHTTPS(string host, string path, string sMessage, float delay = 0.0f) diff --git a/_module/nss/x2_def_heartbeat.nss b/_module/nss/x2_def_heartbeat.nss index 69b87163..32a411b8 100644 --- a/_module/nss/x2_def_heartbeat.nss +++ b/_module/nss/x2_def_heartbeat.nss @@ -13,4 +13,4 @@ void main() { ExecuteScript("nw_c2_default1", OBJECT_SELF); -} +} \ No newline at end of file diff --git a/_release/Path of Ascension [PRC8-CEP3].7z b/_release/Path of Ascension [PRC8-CEP3].7z index 7bc99273..a5b9f2b5 100644 Binary files a/_release/Path of Ascension [PRC8-CEP3].7z and b/_release/Path of Ascension [PRC8-CEP3].7z differ