Jump to content
  • 0

Array mistake.


Question

Posted

Hi, I would need some support on my script.

I'm only getting the last reward ID from the reward item list, I don't understand why.

I assume I don't need $ after the variable here.

setarray .RewardList[0],969,607,7539;
setarray .RewardAmount[0],2,5,15;

OnKilled:
getitem .RewardList[.Reward],.RewardAmount[.Reward];
announce strcharinfo(0)+" a croisé la route d'un Gold Poring.",0;

2 answers to this question

Recommended Posts

Posted

I think he's referring to his own script earlier on a recent topic anyways I rescripted it for him.

- script goldporing -1,{
OnClock0000:
goto spawn_gp;

//This is if you want to just whisper npc:goldporing instead of clicking an NPC
//Change 99 to your desired GM level that will be able to access the NPC by whisper

OnWhisperGlobal:
if(getgmlevel() < 99) end;
menu "Start Event",-,"Exit",exit_gp;

spawn_gp:
setarray .MapList$[0],"payon","prontera","izlude","geffen";
setarray .RewardList[0],969,607,739;
setarray .RewardAmount[0],2,5,15;
set .Map, rand(getarraysize(.MapList$));
set .randpicklist, rand(getarraysize(.RewardList));
set .randpickamount, rand(getarraysize(.RewardAmount));
announce "Un nouveau Gold Poring est apparu quelque part dans "+.Maplist$[.Map]+"!",0;
monster .MapList$[.Map],0,0,"Gold Poring",2248,1,strnpcinfo(0)+"::OnGPKilled";
end;

exit_gp:
mes "[Gold Poring Event]";
mes "Adios, "+strcharinfo(0)+"!";
close;

OnGPKilled:
getitem .RewardList[.randpicklist],rand(.randpickamount);
announce strcharinfo(0)+" a trouvé le Gold Poring à "+.MapList$[.Map]+".",0;
end;
}

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...