Jump to content
  • 0
Sign in to follow this  
brosss241

help incorrect monster spawn.

Question

i downloaded this code here in hercules and edit it a bit. but i have a problem in spawning the three monster ..when the event starts and it choose "izlude"  the monster are in there correct position.. but if the map is different it will spawn the monster randomly..and i want the final boss to spawn randomly in the map also after defeating all the first three...can anyone help me..

-	script	invasion	-1,{OnInit://MapListssetarray.Map$[0],"izlude","geffen","morocc","alberta","payon","prontera";//CashReward(Normal|Boss)setarray.Cash[0],1,25;//NormalMobID+Countsetarray.MobCount[0],1901,1,1902,1,1900,1;//BOSSMobID+Count//setarray.BossCount[0],1900,1;setarray.MVP[0],1903;//,1901,1902,1903,1904,1905,1906,1907,1908,1909,1910,1911,1912;//InvasionDuration(Minutes)set.Duration,60;end;OnWhisperGlobal:OnMinute00://OnPCLoginEvent:awake	strnpcinfo(0);set.RandomMap$,.Map$[rand(getarraysize(.Map$))];killmonster.RandomMap$,"All";announce"INVASION has started at "+.RandomMap$+".",0;//for(set.@i,0;.@i<getarraysize(.MobCount)-1;set.@i,.@i+1)if(.Map$[.@i]==.Map$[.@i]){monster.RandomMap$,107,162,"Final Boss Minion",.MobCount[.@i],.MobCount[.@i+1],strnpcinfo(0)+"::OnKilled";monster.RandomMap$,147,162,"Final Boss Minion",.MobCount[.@i+2],.MobCount[.@i+3],strnpcinfo(0)+"::OnKilled";monster.RandomMap$,128,181,"Final Boss Minion",.MobCount[.@i+4],.MobCount[.@i+5],strnpcinfo(0)+"::OnKilled";}else if(.Map$[.@i]==.Map$[.@i+1]){monster.RandomMap$,99,120,"Final Boss Minion",.MobCount[.@i],.MobCount[.@i+1],strnpcinfo(0)+"::OnKilled";monster.RandomMap$,139,120,"Final Boss Minion",.MobCount[.@i+2],.MobCount[.@i+3],strnpcinfo(0)+"::OnKilled";monster.RandomMap$,119,142,"Final Boss Minion",.MobCount[.@i+4],.MobCount[.@i+5],strnpcinfo(0)+"::OnKilled";}else if(.Map$[.@i]==.Map$[.@i+2]){monster.RandomMap$,63,166,"Final Boss Minion",.MobCount[.@i],.MobCount[.@i+1],strnpcinfo(0)+"::OnKilled";monster.RandomMap$,261,166,"Final Boss Minion",.MobCount[.@i+2],.MobCount[.@i+3],strnpcinfo(0)+"::OnKilled";monster.RandomMap$,160,248,"Final Boss Minion",.MobCount[.@i+4],.MobCount[.@i+5],strnpcinfo(0)+"::OnKilled";}else if(.Map$[.@i]==.Map$[.@i+3]){monster.RandomMap$,95,57,"Final Boss Minion",.MobCount[.@i],.MobCount[.@i+1],strnpcinfo(0)+"::OnKilled";monster.RandomMap$,146,57,"Final Boss Minion",.MobCount[.@i+2],.MobCount[.@i+3],strnpcinfo(0)+"::OnKilled";monster.RandomMap$,117,73,"Final Boss Minion",.MobCount[.@i+4],.MobCount[.@i+5],strnpcinfo(0)+"::OnKilled";}else if(.Map$[.@i]==.Map$[.@i+3]){monster.RandomMap$,129,217,"Final Boss Minion",.MobCount[.@i],.MobCount[.@i+1],strnpcinfo(0)+"::OnKilled";monster.RandomMap$,186,217,"Final Boss Minion",.MobCount[.@i+2],.MobCount[.@i+3],strnpcinfo(0)+"::OnKilled";monster.RandomMap$,156,239,"Final Boss Minion",.MobCount[.@i+4],.MobCount[.@i+5],strnpcinfo(0)+"::OnKilled";}else if(.Map$[.@i]==.Map$[.@i+4]){monster.RandomMap$,133,203,"Final Boss Minion",.MobCount[.@i],.MobCount[.@i+1],strnpcinfo(0)+"::OnKilled";monster.RandomMap$,172,203,"Final Boss Minion",.MobCount[.@i+2],.MobCount[.@i+3],strnpcinfo(0)+"::OnKilled";monster.RandomMap$,155,224,"Final Boss Minion",.MobCount[.@i+4],.MobCount[.@i+5],strnpcinfo(0)+"::OnKilled";}sleep(.Duration*10000);killmonster.RandomMap$,"All";announce"The Invasion conquered "+.RandomMap$+".",0;end;OnKilled:if(!mobcount(.RandomMap$,strnpcinfo(0)+"::OnKilled")){announce"ALERT:Final Boss Arrived.",0;set.RandMVP,rand(getarraysize(.MVP));monster.RandomMap$,0,0,"Final Boss",.MVP[.RandMVP],1,strnpcinfo(0)+"::OnBossKilled";}elseannounce"Monster Remaining:"+mobcount(.RandomMap$,strnpcinfo(0)+"::OnKilled"),0;end;OnBossKilled:getitem 32328,1;announce	strcharinfo(0)+" killed Invasion Boss",0;if(!mobcount(.RandomMap$,strnpcinfo(0)+"::OnBossKilled")){announce"INVASION has ended.",0;awake	strnpcinfo(0);}end;}

 

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

try?

 

 

-    script    invasion    -1,{OnWhisperGlobal://OnPCLoginEvent:    set .@ran, rand(1,6);    if (.@ran == 6) { set .Map$,"izlude";        setarray .@coord[0],107,162,147,162,128,181;    }    if (.@ran == 5) { set .Map$,"geffen";        setarray .@coord[0],99,120,139,120,119,142;    }    if (.@ran == 4) { set .Map$,"morocc";        setarray .@coord[0],63,166,261,166,160,248;    }    if (.@ran == 3) { set .Map$,"alberta";    setarray .@coord[0],95,57,146,57,117,73;        }    if (.@ran == 2) { set .Map$,"payon";        setarray .@coord[0],129,217,186,217,156,239;    }    if (.@ran == 1) { set .Map$,"prontera";     setarray .@coord[0],133,203,172,203,155,224;    }        awake strnpcinfo(0);    killmonster .Map$[0],"All";    announce"INVASION has started at "+.Map$[0]+".",0;    monster .Map$[0],.@coord[0],.@coord[1],"Final Boss Minion",.MobCount[0],.MobCount[1],strnpcinfo(0)+"::OnKilled";    monster .Map$[0],.@coord[2],.@coord[3],"Final Boss Minion",.MobCount[2],.MobCount[3],strnpcinfo(0)+"::OnKilled";    monster .Map$[0],.@coord[4],.@coord[5],"Final Boss Minion",.MobCount[4],.MobCount[5],strnpcinfo(0)+"::OnKilled";sleep(.Duration*10000);    killmonster .Map$[0],"All";    announce"The Invasion conquered "+.Map$[0]+".",0;    end;    OnKilled:    if(!mobcount(.Map$[0],strnpcinfo(0)+"::OnKilled")) {        announce"ALERT:Final Boss Arrived.",0;        monster .Map$[0],0,0,"Final Boss",.MVP[rand(getarraysize(.MVP))],1,strnpcinfo(0)+"::OnBossKilled";    } else        announce"Monster Remaining: "+mobcount(.Map$[0],strnpcinfo(0)+"::OnKilled"),0;    end;OnBossKilled:    getitem 501,1;    announce    strcharinfo(0)+" killed Invasion Boss",0;        if(!mobcount(.Map$[0],strnpcinfo(0)+"::OnBossKilled")) {            announce"INVASION has ended.",0;            awake    strnpcinfo(0);        }    end;OnInit:    //CashReward(Normal|Boss)    setarray .Cash[0],1,25;    //NormalMobID+Count    setarray .MobCount[0],1792,1,1792,1,1792,1;    //BOSSMobID+Count    //setarray.BossCount[0],1900,1;    setarray .MVP[0],1907;//,1901,1902,1903,1904,1905,1906,1907,1908,1909,1910,1911,1912;    //InvasionDuration(Minutes)    set .Duration,60;    end;}

 

 

Edited by quesoph

Share this post


Link to post
Share on other sites

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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

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