raPalooza~ 101 Posted June 4, 2017 (edited) Is it possible to get an array with pc_readglobalreg? if so, is it possible to getarraysize of an array from pc_readglobalreg? Trying to create a plugin to set an effect on mobs from an array ( like mobs to kill in a quest ) Simple but haven't found it anywhere ;] EDIT: this doesn't work :[ for (i = 0; i <= 10; ++i) { sprintf(output,"mob2kill[%d]",i); mob = pc_readglobalreg(sd, script->add_str(output)); Edited June 4, 2017 by raPalooza~ Quote Share this post Link to post Share on other sites
0 meko 170 Posted June 4, 2017 Trying to set an effect on mobs as in using specialeffect() on them? well good news, because this commands now works on any kind of unit (including mobs), so you don't need to do this from plugins See http://herc.ws/board/topic/14848-deprecation-specialeffect2-misceffect/ Quote Share this post Link to post Share on other sites
0 raPalooza~ 101 Posted June 4, 2017 Heard of this awesome thing! But what i want is specialeffect a range of mob_ids from a players array. ( mobs2kill[0] for example ) I'm doing this by post plugin hooking at clif_getareachar_unit but as i mention pc_readglobalreg seems to not handle array functions. x_X Quote Share this post Link to post Share on other sites
0 meko 170 Posted June 5, 2017 I still don't understand why you have to do it from plugin... You do know you can iterate over an array from scripts, right? .@size = getarraysize(mob2kill[0]); for (.@i = 0; .@i < .@size; ++.@i) { specialeffect(EF_HIT1, SELF, mob2kill[.@i], playerattached()); } If you insist on using a plugin, look at the source of copyarray() Quote Share this post Link to post Share on other sites
Is it possible to get an array with pc_readglobalreg? if so, is it possible to getarraysize of an array from pc_readglobalreg?
Trying to create a plugin to set an effect on mobs from an array ( like mobs to kill in a quest )
Simple but haven't found it anywhere ;]
EDIT: this doesn't work :[
Edited by raPalooza~Share this post
Link to post
Share on other sites