Multiple reward

mrlongshen

Noobies
Messages
1,126
Points
0
Age
36
Location
localhost 127.0.0.1
Emulator
//===== Hercules Script ======================================//= Find the Mushroom//===== By: ==================================================//= Mysterious//===== Current Version: =====================================//= 3.6a//===== Description: =========================================//= Find the Mushroom - random amount of Mushrooms spawns in random maps.//= Players need to find these mushrooms and kill them to gain prizes!//===== Additional Comments: =================================//= 3.0 Fully Functional with Rewritten script. [Mysterious]//= 3.6a Slightly edited. [Euphy]//============================================================new_4-4,131,169,4 script Find the Mushroom BLACK_MUSHROOM,{ mes "[ Find The Mushroom ]"; if (!.Status) mes "There is no event at the moment!"; else { mes "There are "+.Spawn+" Mushrooms left in "+.Map$+"!"; mes "Find and kill the mushrooms to gain "+getitemname(.Prize)+"!"; } if (.Status || getgmlevel() < .GM) close; mes "Start the event?"; next; if(select("- No:- Yes") == 1) close; donpcevent strnpcinfo(0)+"::OnMinute55"; mes "[ Find The Mushroom ]"; mes "Event started!"; close;OnInit: set .Prize,674; // Reward item ID set .amount,1; // Reward item amount set .GM,60; // GM level required to access NPC setarray .maps$[0],"izlude","geffen","morocc","prontera"; // Possible maps end;OnMinute55: // Start time (every hour) if (.Status) end; set .Status,1; set .Spawn,rand(1,10); // How many Mushrooms should spawn? set .Map$,.maps$[rand(getarraysize(.maps$))]; killmonster .Map$,"All"; monster .Map$,0,0,"Please don't kill me!",1084,.Spawn,strnpcinfo(0)+"::OnMobKilled"; announce "Find the Mushroom : Total of "+.Spawn+" Mushrooms have been spawned in "+.Map$+"!",0; sleep 2500; announce "Find the Mushroom : Every Mushroom you kill will give you "+getitemname(.Prize)+"!",0; end;OnMobKilled: set .Spawn, .Spawn - 1; getitem .Prize, .amount; if (.Spawn) announce "[ "+strcharinfo(0)+" ] has killed a Mushroom. There are now "+.Spawn+" Mushroom(s) left.",bc_map; else { announce "The Find the Mushroom Event has ended. All the Mushrooms have been killed.",0; set .Status,0; } end;}
How to insert multiple prize ? I want to insert event ticket, For now my player will get the mithril coins.

set .Prize,674,7711;

can it be like this ?

 
Last edited by a moderator:
The edit you'll want is a simple function Global_Functions.txt contains inside the Hercules folder npc folder.

 

.RandomItemAmount = 10;.RandomItemList = callfunc("F_Rand",1129,1222,1163,1357,1360,1522,1811,1410);getitem .RandomItemList, .RandomItemAmount;

Would give you the items of ID's listed after "F_Rand"

PS: You can always message me on Skype instead of making new topic for simple request. I'm more than glad to help with easy solutions like this personally with you.

 
Last edited by a moderator:
@@Aeromesi

Thanks for your response. I want fix value. not random. huhu 
default_happy.png


Later will online skype 
default_tongue.png


 
just change

Code:
getitem .Prize, .amount;
into
Code:
getitem 501, 10;getitem 502, 10;getitem 503, 10;getitem 504, 10;
then will get multiple prize
 
another method is

for( set .@i,0; .@i < getarraysize( .Items ) - 1; set .@i,.@i + 2 ) {

getitem .Items[.@i],.Items[.@i + 1];

}

OnInit:

setarray .Items,501,10,502,10,503,10;
or

for( set .@i,0; .@i < getarraysize( .Items ) - 1; set .@i,.@i + 1 ) {

getitem .Items[.@i],.Amount[.@i + 1];

}

OnInit:

setarray .Items,501,502,503;

setarray .Amount,10,10,10;
 
Back
Top