DJFUNK Posted January 8, 2013 Posted January 8, 2013 (edited) I have a portal NPC, and I got a problem. prontera,72,226,1 script portal::portal1 45,2,2,{ set @Prize,rand(3); if (@Prize==1) goto: sidji; if (@Prize==2) goto: loeroe; if (@Prize==3) goto: teloe; sidji: getitem 606,10; atcommand "@load"; close; loeroe: getitem 608,20; atcommand "@load"; close; teloe: getitem 607,20; atcommand "@load"; close; } if player enter that portal, get random price. but, it doesn't work... thank's for advance:) Edited January 11, 2013 by DJFUNK Quote
ICEROCK Posted January 8, 2013 Posted January 8, 2013 prontera,72,226,1 script portal::portal1 45,2,2,{ set @Prize,rand(1,3); if (@Prize==1) goto sidji; if (@Prize==2) goto loeroe; if (@Prize==3) goto teloe; sidji: getitem 606,10; atcommand "@load"; close; loeroe: getitem 608,20; atcommand "@load"; close; teloe: getitem 607,20; atcommand "@load"; close; } Quote
Schrwaizer Posted January 8, 2013 Posted January 8, 2013 Why don't you use warp "SavePoint",0,0; Instead of and atcommand? Quote
AnnieRuru Posted January 9, 2013 Posted January 9, 2013 prontera,156,172,1 script portal1 45,2,2,{ switch ( rand(3) ) { default: getitem 606,10; break; case 1: getitem 608,20; break; case 2: getitem 607,20; } warp "Save", 0,0; end; } no need OnTouch, if the npc already has 2,2 ... defined the radius, it automatically trigger as it is having an OnTouch Quote
Schrwaizer Posted January 10, 2013 Posted January 10, 2013 (edited) prontera,156,172,1 script portal1 45,2,2,{ switch ( rand(3) ) { default: getitem 606,10; break; case 1: getitem 608,20; break; case 2: getitem 607,20; } warp "Save", 0,0; end; } no need OnTouch, if the npc already has 2,2 ... defined the radius, it automatically trigger as it is having an OnTouch I guess it needs Ontouch... because if the players clicks the portal, the effects will trigger. x_x I don't think that it is the point of a portal anw, just for semantic reasons. So, you can just add this to Annie's awesome script: prontera,156,172,1 script portal1 45,2,2,{ end; // Do nothing when the player clicks OnTouch: // Execute script when the player approaches switch ( rand(3) ) { default: getitem 606,10; break; case 1: getitem 608,20; break; case 2: getitem 607,20; } warp "Save", 0,0; end; } @edit: fixed typo at my bbcode Edited January 10, 2013 by Schrwaizer Quote
AnnieRuru Posted January 10, 2013 Posted January 10, 2013 I guess it needs Ontouch... because if the players clicks the portal, the effects will trigger. x_xreally ? o.oin my test server, if you click on warp portal npc ID 45, you will walk to the portal instead of triggering it from clicking Quote
Schrwaizer Posted January 10, 2013 Posted January 10, 2013 I see... so, forget that. I thought it would be treated like a normal NPC. xD Quote
DJFUNK Posted January 11, 2013 Author Posted January 11, 2013 thank's a lot have any idea, to write this script http://rathena.org/board/topic/77115-request-auto-game-warp-event/ Quote
Question
DJFUNK
I have a portal NPC, and I got a problem.
if player enter that portal, get random price.
but, it doesn't work...
thank's for advance:)
Edited by DJFUNK8 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.