Jump to content
  • 0

Spawn a monster on n no. of maps on hourly basis if they die


Xtremist

Question


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  196
  • Reputation:   20
  • Joined:  11/20/11
  • Last Seen:  

Hey guyz,

as the topic says,

I want to have monster on every map on hourly basis if they die.

Permanent monster spawn will have too much of redundant code as we will have to copy paste all the things for all maps.

This is what I tried but it aint worked!

http://pastebin.com/aWjUWGe2

Link to comment
Share on other sites

6 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  399
  • Reputation:   198
  • Joined:  11/09/11
  • Last Seen:  

Simply a copy/paste from the IRC log:

[07:52] <%jTynne|Busy> Ah, here we are

[07:52] <%jTynne|Busy> monster $motwmap$,0,0,"--ja--",$motw,1;

[07:53] <%jTynne|Busy> You can modify that to work with what you wrote earlier

[07:53] <%jTynne|Busy> Instead of a permanent global string variable, just use an array, and fill the sucker up. Replace the $motw at the end of the line with the monster ID you'd like spawned

[07:53] <Xtremist> http://rathena.org/board/topic/54340-spawn-a-monster-on-n-no-of-maps-on-hourly-basis-if-they-die/

[07:54] <%jTynne|Busy> the --ja-- makes the name found in the japanese_name field display when spawned

[07:54] <%jTynne|Busy> I'll copy/paste this to that thread

So, using your example from earlier in the IRC chat, it would look something along the lines of,

monster $maps$[$i],0,0,"--ja--",$spawn,1;

Set the variables accordingly. I don't have much experience with arrays, so I wish you the best of luck with that.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  967
  • Reputation:   53
  • Joined:  11/13/11
  • Last Seen:  

Hey guyz,

as the topic says,

I want to have monster on every map on hourly basis if they die.

Permanent monster spawn will have too much of redundant code as we will have to copy paste all the things for all maps.

This is what I tried but it aint worked!

http://pastebin.com/aWjUWGe2

Well if your problem is fixed

lets dance @ IRC right now

ROFL!

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

This is what I tried but it aint worked!

http://pastebin.com/aWjUWGe2

i guess,..the problem is here

.@maps$[.i],0,0,0,0 monster Poring 1963,50,0,0,0

that is Permanent Spawn Monster script...but i dont think it will works in a "NPC Script" or "Function"

However, based on this script....it will Work....

monster $maps$[$i],0,0,"--ja--",$spawn,1;

but it wont summon upon it died....and why use ( Global Variable "$i" ) ??

so, based on your script, i have made another one...

- script Sample -1,{
OnInit:
OnMinute00:
setarray .Maps$,
  "prontera",
  "veins",
  "xmas",
  "yuno";

for(set .@i,0; .@i < getarraysize( .Maps$ ); set .@i,.@i + 1 ){
if( !mobcount( .Maps$[.@i],strnpcinfo(0)+"::OnMobKilled" ){
 monster .Maps$[.@i],0,0,"--ja--",1963,1,strnpcinfo(0)+"::OnMobKilled";
}
}
end;
OnMobKilled:
dispbottom "You have killed the Monster, and it will spawn back at next Hours.";
end;
}

In this script, the monster will spawn Hourly, it will check for the Monster before they spawn...

it the monster is already exists, it wont spawn another new 1...

just some flaw i think might have...

if the player killed the monster at XX:59 ( 59 Minutes , 1 Minutes for next Hours ) , it will spawn the monster after the "Next" Hours is reached.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  399
  • Reputation:   198
  • Joined:  11/09/11
  • Last Seen:  

Lol, go Emistry. Sneak posting before I can! xP Anyway, glad you got a good solution now. Goodnight!

Try this for the 60 minute delay on spawn after being killed. Just put it together off the top of my head. As I said in IRC, I'm going to sleep now. Good luck!

set $mobnum,1002;

OnNPCKillEvent:

if(killedrid == $mobnum) {

getmapxy .@map$,.@x,.@y,0;

sleep2 3600000;

monster .@map$,0,0,"--ja--",$mobnum,1;}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  196
  • Reputation:   20
  • Joined:  11/20/11
  • Last Seen:  

- script Monster -1,{

OnSpawn:

setarray $@maps$,"alberta","aldebaran","amatsu","ayothaya","brasilis","brasilis","dicastes01","einbroch","geffen","gonryun","hugel","izlude","jawaii","lighthalzen","louyang","manuk","moscovia","morocc","niflheim","payon","prontera","rachel","umbala","veins","xmas","yuno";

for(set .i,0; .i<=getarraysize(.@maps$)-1; set .i,.i+1)

{

monster $@maps$[$i],0,0,"--ja--",1247,1,"Monster::OnDead";

}

}

end;

OnDead:

initnpctimer;

end;

OnTimer600000:

stopnpctimer;

goto OnSpawn;

}

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

OnDead:

initnpctimer;

end;

OnTimer600000:

stopnpctimer;

goto OnSpawn;

this will keep override the current time counting upon the same monster in killed in other map.....

still...the best way is using the normal Permanent Monster Spawn way....

mapnam,0,0,0,0 monster Poring 1963,50,0,0,0

Edited by Emistry
Link to comment
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.   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.

×
×
  • Create New...