Jump to content
  • 0
raPalooza~

pc_readglobalreg with array

Question

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 by raPalooza~

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

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

Share this post


Link to post
Share on other sites
  • 0

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()

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.