Jump to content

Question

Posted

 

prontera,155,155,5 shop tooldealer 811

setarray .@items 501,502,503,504

setarray .@amount 10,20,30,40

 .@maps prontera,izlude,morocc,aldebaran,alberta,payon,geffen

Onbuyitem: Announce: "getcharname" has bought "getitemname" from the tool dealer on Prontera "get coordinates"

@jumpnpc "tooldealer" rand(.@maps) random coordinates

A Shop NPC that when a player buys an item after the transaction the NPC will jump on a random map with random coordinates

5 answers to this question

Recommended Posts

  • 1
Posted
On 6/17/2017 at 0:33 AM, celeron0134 said:

 

prontera,155,155,5 shop tooldealer 811

setarray .@items 501,502,503,504

setarray .@amount 10,20,30,40

 .@maps prontera,izlude,morocc,aldebaran,alberta,payon,geffen

Onbuyitem: Announce: "getcharname" has bought "getitemname" from the tool dealer on Prontera "get coordinates"

@jumpnpc "tooldealer" rand(.@maps) random coordinates

A Shop NPC that when a player buys an item after the transaction the NPC will jump on a random map with random coordinates

 
 

 

Hi, please try this. :D

prontera.gat, 155, 185, 4	script	Jumping Jack	757,{
	setarray .@map_List$[0], "hugel", "yuno", "comodo", "xmas", "aldebaran", "izlude", "payon", "geffen", "morocc", "prontera";	

	mes "[ Jumping Jack ]";
	mes "Hello";
	close2;
	.@map$ = .@map_List$[ rand( getarraysize( .@map_List$ )) ];
	do {
		.@x = rand(1,400);
		.@y = rand(1,400);
	} while( !checkcell(.@map$, .@x, .@y, cell_chkpass ) );
	unitwarp getnpcid(0), .@map$, .@x, .@y;
	end;
}

 

 

  • Upvote 1
  • 0
Posted (edited)

I don't think it's possible to move NPC one map to other 

But you can teleport it in the same map, 

*movenpc "<NPC name>",<x>,<y>{,<dir>};

This command looks like the NPCWalkToxy function,but is a little different.

While NPCWalkToXY just makes the NPC 'walk' to the coordinates given (which 
sometimes gives problems if the path isn't a straight line without objects), 
this command just moves the NPC. It basically warps out and in on the current 
and given spot. Direction can be used to change the NPC's facing direction.

Example:

// This will move Bugga from it's old coordinates to the new coordinates at 100,20 (if those coordinates are legit).
	moveNPC "Bugga",100,20;

 

 

Something like

Onbuyitem:

while( !checkcell( strnpcinfo(4),( .@x = rand( 1,300 ) ),( .@y = rand( 1,300 ) ),cell_chkpass ) );

movenpc strnpcinfo(0),.@x,.@y;

 

Edited by Cyro
  • 0
Posted

i remember a event which is similar to my request.. if my memory serves me right.. i think its called hide and seek event that is automated.. the name of the NPC is jumper.. when a player finds the NPC.. the NPC will reward the player then jumps on other locations..

 

or maybe someting like enebling and disabling the npc..

prontera,155,155,5 shop bugga #1 757

alberta,155,155,5 shop bugga#2 757

izlude,155,155,5 shop bugga#3 757

onbuyitem announce player

then npc will be disabled and then enable albera's bugga

and then player buys on alberta's bugga..

the npc will disable and enable izlude's bugga

and then disable,izlude's bugga and enable prontera's bugga

pls help me thanks

 

  • 0
Posted

like this one?

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 Event : Go Find me!! I'm here in "+$@jmpmap$+"!!!",bc_blue;

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...