Seiro Posted December 13, 2012 Group: Members Topic Count: 20 Topics Per Day: 0.00 Content Count: 42 Reputation: 0 Joined: 10/24/12 Last Seen: August 11, 2014 Share Posted December 13, 2012 When a player steps on an area cell, it will summon a monster. It will not summon another one while the current monster is alive. delay for 30mins before it can summon again. (to prevent accident summoning) - you can use a Crystal monster (1952) - you can do any area/coordinate, but please try and explain how it works so I can edit it If possible: monster will die if not killed/attacked in 10 minutes. Quote Link to comment Share on other sites More sharing options...
Ryokem Posted December 13, 2012 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 205 Reputation: 19 Joined: 10/12/12 Last Seen: November 7, 2013 Share Posted December 13, 2012 (edited) The area is based on where the npc is located. prontera,100,150,0 script Summoner -1,2,2,{ OnTouch: the "2,2" after -1 script means that you're gonna trigger the OnTouch even label when a player walks into a 5x5 square centred at prontera 100 150. So basically, X: 98~102, Y: 148~152. Changing the "2,2", will increase/decrease the area. 1,1 -> 3x3 area around where the npc is located. 2,2 -> 5x5 3,3 -> 7x7 And so on. OnTouch: //Prevent to summon if a monster is already summoned or before 30 minutes if( .isSummoned ) end; .isSummoned = 1; getmapxy .map$, .@x, .@y, 0; monster .map$, .@x, .@y, "Summoned Monster", 1952, 1, strnpcinfo(0) + "::OnMonsterDead"; initnpctimer; end; //10 minutes... OnTimer600000: killmonster .map$, strnpcinfo(0) + "::OnMonsterDead"; end; //Reopening the event after 30 minutes OnTimer1800000: stopnpctimer; .isSummoned = 0; end; Note that the part of not being able to summon in 30 minutes can be easily done with gettimetick() as well, but as I started a timer for killing it, I prefered to keep using that timer. Edited December 13, 2012 by Ryokem Quote Link to comment Share on other sites More sharing options...
AnnieRuru Posted December 13, 2012 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted December 13, 2012 prontera,155,177,5 script kjdhfksdjf 100,2,2,{ if ( .summon_timetick + 10 > gettimetick(2) // 10 seconds delay to summon again || mobcount( "this", strnpcinfo(0)+"::Onaa" ) ) end; monster "this", -1,-1, "--ja--", 1952,1, strnpcinfo(0)+"::Onaa"; .summon_timetick = gettimetick(2); sleep 5000; // 5 seconds auto-kill this mob killmonster .map$, strnpcinfo(0) +"::Onaa"; end; OnInit: getmapxy .map$, .@x, .@y, 1; // wtf ... killmonster script command doesn't allow "this" variable Onaa: // prevent server spam error end; } Quote Link to comment Share on other sites More sharing options...
Seiro Posted December 14, 2012 Group: Members Topic Count: 20 Topics Per Day: 0.00 Content Count: 42 Reputation: 0 Joined: 10/24/12 Last Seen: August 11, 2014 Author Share Posted December 14, 2012 (edited) The area is based on where the npc is located. prontera,100,150,0 script Summoner -1,2,2,{ OnTouch: the "2,2" after -1 script means that you're gonna trigger the OnTouch even label when a player walks into a 5x5 square centred at prontera 100 150. So basically, X: 98~102, Y: 148~152. Changing the "2,2", will increase/decrease the area. 1,1 -> 3x3 area around where the npc is located. 2,2 -> 5x5 3,3 -> 7x7 And so on. I know about the "2,2,{" I just thought you're going to use something like if( (.@map$ == "prontera") && (.@x < 135) && (.@x > 129) && (.@y < 40) && (.@y > 34) ) which is a little confusing, but I know now how it works. prontera,155,177,5 script kjdhfksdjf 100,2,2,{ if ( .summon_timetick + 10 > gettimetick(2) // 10 seconds delay to summon again || mobcount( "this", strnpcinfo(0)+"::Onaa" ) ) end; monster "this", -1,-1, "--ja--", 1952,1, strnpcinfo(0)+"::Onaa"; .summon_timetick = gettimetick(2); sleep 5000; // 5 seconds auto-kill this mob killmonster .map$, strnpcinfo(0) +"::Onaa"; end; OnInit: getmapxy .map$, .@x, .@y, 1; // wtf ... killmonster script command doesn't allow "this" variable Onaa: // prevent server spam error end; } More easier to configure! I just added OnTouch: Since I want the NPC hiding *Thanks! I learned from both script* Edited December 14, 2012 by Seiro Quote Link to comment Share on other sites More sharing options...
Question
Seiro
When a player steps on an area cell, it will summon a monster.
- you can use a Crystal monster (1952)
- you can do any area/coordinate, but please try and explain how it works so I can edit it
If possible:
monster will die if not killed/attacked in 10 minutes.
Link to comment
Share on other sites
3 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.