Manny Posted August 13, 2014 Group: Members Topic Count: 4 Topics Per Day: 0.00 Content Count: 6 Reputation: 1 Joined: 08/01/14 Last Seen: August 15, 2014 Share Posted August 13, 2014 (edited) Hello guys, I would like to know if there is a way to spawn an npc on a random map. I'll show you my attempt: - script Test#Ro -1,{ end; OnInit: movenpc(strnpcinfo(0), callfunc("GetRandMap"), 0, 0); // <- Something like this end; } But the command movenpc allow only to movenpc on the same map. How can I do this ? Thanks for the answer. Edited August 13, 2014 by Manny Quote Link to comment Share on other sites More sharing options...
Emistry Posted August 13, 2014 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Sunday at 05:32 PM Share Posted August 13, 2014 getnpcid + unitwarp Quote Link to comment Share on other sites More sharing options...
Norm Hmuryj Posted August 13, 2014 Group: Members Topic Count: 11 Topics Per Day: 0.00 Content Count: 48 Reputation: 6 Joined: 07/03/13 Last Seen: June 28, 2024 Share Posted August 13, 2014 Try this //==========================================================// //========= Script by RyCHIRO =========// //========= http://ro-crew.rpgboard.net/ =========// //===Updated with new Towns and monsters by Norm Hmuryj (Melbou) //==========================================================// poring_c01,1,1,3 script jumpevent 95,{ OnClock0400: OnClock1600: announce "[Jumper] Эвент начнётся через 1 минуту!",bc_blue; sleep2 60000; set $@ran, rand(1,10); if ($@ran == 10) set $@jmpmap$,"hugel"; if ($@ran == 9) set $@jmpmap$,"yuno"; if ($@ran == 8) set $@jmpmap$,"comodo"; if ($@ran == 7) set $@jmpmap$,"xmas"; if ($@ran == 6) set $@jmpmap$,"aldebaran"; if ($@ran == 5) set $@jmpmap$,"izlude"; if ($@ran == 4) set $@jmpmap$,"payon"; if ($@ran == 3) set $@jmpmap$,"geffen"; if ($@ran == 2) set $@jmpmap$,"morocc"; if ($@ran == 1) set $@jmpmap$,"prontera"; announce "[Jumper] Ищите меня в городе: "+$@jmpmap$+"!!!",bc_blue; set $@JmpRnd,10; goto OnStart; OnStart: if ($@JmpRnd == 0){ stopnpctimer; set $@JumpStart,0; sleep2 3000; announce "[Jumper] Спасибо за игру. Конец!",bc_blue; sleep2 15000; movenpc "Jumper"+$@ran+"",1,1; //move the NPC setnpcdisplay "Jumper"+$@ran+"",1002; end; } if ($@JmpRnd == 10){ goto OnStart2; } stopnpctimer; sleep2 3000; announce "[Jumper] Следующий раунд через 15 секунд.",bc_blue; sleep2 15000; setnpcdisplay "Jumper"+$@ran+"",1002; movenpc "Jumper"+$@ran+"",1,1; //move the NPC set $@ran, rand(1,10); if ($@ran == 10) set $@jmpmap$,"hugel"; if ($@ran == 9) set $@jmpmap$,"yuno"; if ($@ran == 8) set $@jmpmap$,"comodo"; if ($@ran == 7) set $@jmpmap$,"xmas"; if ($@ran == 6) set $@jmpmap$,"aldebaran"; if ($@ran == 5) set $@jmpmap$,"izlude"; if ($@ran == 4) set $@jmpmap$,"payon"; if ($@ran == 3) set $@jmpmap$,"geffen"; if ($@ran == 2) set $@jmpmap$,"morocc"; if ($@ran == 1) set $@jmpmap$,"prontera"; announce "[Jumper] Ищите меня в городе: "+$@jmpmap$+"",bc_blue; goto OnStart2; OnStart2: set $monster, rand(1001,1995); if($monster == 1003 || $monster == 1218 || $monster == 1006 || $monster == 1017 || $monster == 1021 || $monster == 1022 || $monster == 1027 || $monster == 1043 || $monster == 1006 || $monster == 1136 || $monster == 1137 || $monster == 1168 || $monster == 1171 || $monster == 1172 || $monster == 1173 || $monster == 1181 || $monster == 1210 || $monster == 1223 || $monster == 1284 || ($monster >= 1324 && $monster <= 1363) || $monster == 1006 || $monster == 1407 || $monster == 1411 || $monster == 1414 || $monster == 1496 || $monster == 1501 || $monster == 1900){ goto OnStart2; end; } while(1) { //Initiate an infinite loop set $@jx,rand(0,300); //Set a randon X coordinate set $@jy,rand(0,300); //Set a random Y coordinate if(checkcell(""+$@jmpmap$+"",$@jx,$@jy,cell_chkpass)) break; //If cell is walkable break out of the loop } initnpctimer; set $@JumpStart,1; movenpc "Jumper"+$@ran+"",$@jx,$@jy; //move the NPC setnpcdisplay "Jumper"+$@ran+"",$monster; set $@JmpRnd,$@JmpRnd-1; end; OnTimer60000: set $@JumpStart,0; announce "[Jumper] Вы не смогли найти меня. Я был в "+$@jmpmap$+" "+$@jx+" "+$@jy+"!!",bc_blue; sleep2 3000; donpcevent "jumpevent::OnStart"; end; }//End Script - script Jumper -1,{ if( $@JumpStart == 0 ){ mes "[Jumper]"; mes "Вы опоздали."; close; } set $@prize, rand(1,100); if ( $@prize <= 50 ){ set $@JumpStart,0; getitem 12103,1; announce "[Jumper] Я был найден "+strcharinfo(0)+" ! Поздравляю! Моё местоположение: "+$@jmpmap$+" "+$@jx+" "+$@jy+"!!",bc_blue; donpcevent "jumpevent::OnStart"; mes "[Jumper]"; mes "Поздравляю! Вы нашли меня!"; getitem 2709,1; close; end; } set $@prize, rand(1,100); if ( $@prize <= 49 ){ set $@JumpStart,0; getitem 607,1; announce "[Jumper] Я был найден "+strcharinfo(0)+" ! Поздравляю! Моё местоположение: "+$@jmpmap$+" "+$@jx+" "+$@jy+"!!",bc_blue; donpcevent "jumpevent::OnStart"; mes "[Jumper]"; mes "Поздравляю! Вы нашли меня!"; getitem 607,1; close; end; } set $@prize, rand(1,100); if ( $@prize <= 48 ){ set $@JumpStart,0; getitem 607,1; announce "[Jumper] Я был найден "+strcharinfo(0)+" ! Поздравляю! Моё местоположение: "+$@jmpmap$+" "+$@jx+" "+$@jy+"!!",bc_blue; donpcevent "jumpevent::OnStart"; mes "[Jumper]"; mes "Поздравляю! Вы нашли меня!"; mes "Вы получаете ^008000"+ $jmp_item_amount3 +" "+ getitemname($jmp_item_id3) +"^000000"; close; end; } } //End Script prontera,1,1,1 duplicate(Jumper) Jumper1 1002 morocc,1,1,1 duplicate(Jumper) Jumper2 1002 geffen,1,1,1 duplicate(Jumper) Jumper3 1002 payon,1,1,1 duplicate(Jumper) Jumper4 1002 izlude,1,1,1 duplicate(Jumper) Jumper5 1002 aldebaran,1,1,1 duplicate(Jumper) Jumper6 1002 xmas,1,1,1 duplicate(Jumper) Jumper7 1002 comodo,1,1,1 duplicate(Jumper) Jumper8 1002 yuno,1,1,1 duplicate(Jumper) Jumper9 1002 hugel,1,1,1 duplicate(Jumper) Jumper10 1002 Quote Link to comment Share on other sites More sharing options...
Manny Posted August 13, 2014 Group: Members Topic Count: 4 Topics Per Day: 0.00 Content Count: 6 Reputation: 1 Joined: 08/01/14 Last Seen: August 15, 2014 Author Share Posted August 13, 2014 getnpcid + unitwarp Perfect ! Thanks a lot ! Manny. Quote Link to comment Share on other sites More sharing options...
Question
Manny
Hello guys,
I would like to know if there is a way to spawn an npc on a random map.
I'll show you my attempt:
But the command movenpc allow only to movenpc on the same map.
How can I do this ?
Thanks for the answer.
Edited by MannyLink 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.