Elqpal Posted October 18, 2014 Group: Members Topic Count: 16 Topics Per Day: 0.00 Content Count: 66 Reputation: 2 Joined: 09/01/12 Last Seen: October 1, 2018 Share Posted October 18, 2014 Hi, I want to request a script every hour a monster in town will spawn randomly and drops an item. Quote Link to comment Share on other sites More sharing options...
Radian Posted October 18, 2014 Group: Members Topic Count: 162 Topics Per Day: 0.04 Content Count: 1546 Reputation: 192 Joined: 07/23/14 Last Seen: June 24, 2024 Share Posted October 18, 2014 (edited) Here's a script that i search on google and its similar to your request. credits goes to sanbox. - script TownInvasion -1,{ OnMinute00: if(gettime(3) % 2 == 1 && !agitcheck() && !agitcheck2()) { for(.@i = 0; .@i < 4; .@i++) { //Spawn on 4 towns .Town_Invade$ = .Town$[rand(getarraysize(.Town$))]; announce .Town_Invade$+" Guard: Help us! Our town is being invaded!",bc_blue|bc_all; for(.@ix = 0; .@ix < 5; .@ix++) { //MvP spawner monster .Town_Invade$,0,0,"--ja--",.MvP[rand(getarraysize(.MvP))],1,strnpcinfo(1)+"::OnInvadeDeath"; } for(.@iy = 0; .@iy < 100; .@iy++) { //Mob spawner monster .Town_Invade$,0,0,"--ja--",-1,1,strnpcinfo(1)+"::OnMobsDeath"; } } } end; OnInvadeDeath: .@RandMvP = rand(getarraysize(.Prize)); getitem .Prize[.@RandMvP],.PAmt[.@RandMvP]; end; OnMobsDeath: .@RandMob = rand(getarraysize(.Prize2)); getitem .Prize2[.@RandMob],.PAmt2[.@RandMob]; end; OnInit: //Towns to Invade setarray .Town$[0],"prontera","izlude","geffen","payon","alberta","aldebaran","yuno","lighthalzen","einbroch","einbech","comodo","umbala","amatsu","gonryun","ayothaya","louyang","hugel","rachel","veins"; //MvPs to summon setarray .MvP[0],1583,1832,1312; //Prize to give MVP setarray .Prize[0],7227,607,608,501,502,503,504,505,506,507,508,509,510,511,512; setarray .PAmt[0],1,1,1,1,1,1,1,1,1,1,1,1,1,1,1; //Prize to give Mobs setarray .Prize2[0],7227,607,608,501,502,503,504,505,506,507,508,509,510,511,512; setarray .PAmt2[0],1,1,1,1,1,1,1,1,1,1,1,1,1,1,1; end; } how to run this everyhour? just change this part OnMinute00: into this OnMinute60: its easy and user friendly script that you can understand. it contains (maps), (mvp's ID#),(prizes) //Towns to Invade setarray .Town$[0],"prontera","izlude","geffen","payon","alberta","aldebaran","yuno","lighthalzen","einbroch","einbech","comodo","umbala","amatsu","gonryun","ayothaya","louyang","hugel","rachel","veins"; //MvPs to summon setarray .MvP[0],1583,1832,1312; //Prize to give MVP setarray .Prize[0],7227,607,608,501,502,503,504,505,506,507,508,509,510,511,512; setarray .PAmt[0],1,1,1,1,1,1,1,1,1,1,1,1,1,1,1; //Prize to give Mobs setarray .Prize2[0],7227,607,608,501,502,503,504,505,506,507,508,509,510,511,512; setarray .PAmt2[0],1,1,1,1,1,1,1,1,1,1,1,1,1,1,1; end; Edited October 18, 2014 by Ginji Quote Link to comment Share on other sites More sharing options...
Elqpal Posted October 19, 2014 Group: Members Topic Count: 16 Topics Per Day: 0.00 Content Count: 66 Reputation: 2 Joined: 09/01/12 Last Seen: October 1, 2018 Author Share Posted October 19, 2014 Hi, Thanks for your reply! if(gettime(3) % 2 == 1 && !agitcheck() && !agitcheck2()) { In this line the event will not work when WoE is active right? //Prize to give Mobs setarray .Prize2[0],7227,607,608,501,502,503,504,505,506,507,508,509,510,511,512; setarray .PAmt2[0],1,1,1,1,1,1,1,1,1,1,1,1,1,1,1; And in this line the prize is random? - script TownInvasion -1,{ OnMinute60: if(gettime(3) % 2 == 1 && !agitcheck() && !agitcheck2()) { for(.@i = 0; .@i < 4; .@i++) { //Spawn on 4 towns .Town_Invade$ = .Town$[rand(getarraysize(.Town$))]; announce .Town_Invade$+" Guard: Help us! Our town is being invaded!",bc_blue|bc_all; for(.@iy = 0; .@iy < 100; .@iy++) { //Mob spawner monster .Town_Invade$,0,0,"--ja--",-1,1,strnpcinfo(1)+"::OnMobsDeath"; } } } end; OnMobsDeath: .@RandMob = rand(getarraysize(.Prize2)); getitem .Prize2[.@RandMob],.PAmt2[.@RandMob]; end; OnInit: //Towns to Invade setarray .Town$[0],"prontera","izlude","geffen","payon","alberta","aldebaran","yuno","lighthalzen","einbroch","einbech","comodo","umbala","amatsu","gonryun","ayothaya","louyang","hugel","rachel","veins"; //Prize to give Mobs setarray .Prize2[0],7227,607,608,501,502,503,504,505,506,507,508,509,510,511,512; setarray .PAmt2[0],1,1,1,1,1,1,1,1,1,1,1,1,1,1,1; end; } What monsters will be spawn here? I deleted the MvP spawn. Quote Link to comment Share on other sites More sharing options...
Question
Elqpal
Hi,
I want to request a script every hour a monster in town will spawn randomly and drops an item.
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.