Jump to content
  • 0

Need advice with my script


DJFUNK

Question


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  115
  • Reputation:   4
  • Joined:  10/25/12
  • Last Seen:  

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 by DJFUNK
Link to comment
Share on other sites

8 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  46
  • Topics Per Day:  0.01
  • Content Count:  228
  • Reputation:   33
  • Joined:  11/15/12
  • Last Seen:  


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;
}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  43
  • Reputation:   15
  • Joined:  06/24/12
  • Last Seen:  

Why don't you use

warp "SavePoint",0,0;

Instead of and atcommand?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  48
  • Reputation:   4
  • Joined:  11/27/11
  • Last Seen:  

Add OnTouch

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  43
  • Reputation:   15
  • Joined:  06/24/12
  • Last Seen:  

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 by Schrwaizer
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

I guess it needs Ontouch... because if the players clicks the portal, the effects will trigger. x_x
really ? o.o

in my test server, if you click on warp portal npc ID 45, you will walk to the portal instead of triggering it from clicking

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  43
  • Reputation:   15
  • Joined:  06/24/12
  • Last Seen:  

I see... so, forget that. I thought it would be treated like a normal NPC. xD

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  115
  • Reputation:   4
  • Joined:  10/25/12
  • Last Seen:  

thank's a lot :D

have any idea, to write this script :)

http://rathena.org/board/topic/77115-request-auto-game-warp-event/

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