Jump to content
  • 0

Need help with mapwarp on my hide on/off npc script pls thanks


BabaVoss

Question


  • Group:  Members
  • Topic Count:  37
  • Topics Per Day:  0.03
  • Content Count:  79
  • Reputation:   0
  • Joined:  06/17/20
  • Last Seen:  

Hello guys i made this hide on and off npc script, it works fine. but i need to inside mapwarp to the script, so when the event is done. all players in the map will be teleported. can anyone help me?

 

-	script	diatrigger	-1,{

OnInit:
disablenpc "Diamond Tower#diaroom";


bindatcmd "diatower", strnpcinfo(0)+"::OnCommand",99,100;
	end;
OnCommand:
	if ( compare( .@atcmd_parameters$, "on" ) ) goto Ondiatrigger;
	else {
		dispbottom "type - '@diatower on' to start the dia tower";
	}
	end;

end;

OnClock0300:
OnClock0600:
OnClock0900:
Ondiatrigger:
if(agitcheck() == 1) end;
enablenpc "Diamond Tower#diaroom";
announce "Diagate Keeper: Diamond Tower is NOW OPEN! ",bc_all,0xFFFF00;
sleep 1000;
announce "Diagate Keeper: For those who want to hunt ORES for Safe refine, now is the time!",bc_all,0xFFFF00;
sleep 1000;
announce "Diagate Keeper: Diamont Tower would be open for 1 Hour!",bc_all,0xFFFF00;
sleep 30000;
announce "Diagate Keeper: Diamond Tower is NOW OPEN!",bc_all,0xFFFF00;
sleep 30000;
announce "Diagate Keeper: Diamond Tower will only be open for 1 Hour every 4hrs.",bc_all,0xFFFF00;
sleep ( 60 * 60000 ); // How long before hide again.
announce "Diagate Keeper: Diamond Tower is now close, Dia Tower will be open after 4hrs.",bc_all,0xFFFF00;
disablenpc "Diamond Tower#diaroom";
end;
}

 

Edited by BabaVoss
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Donators
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  23
  • Reputation:   2
  • Joined:  10/31/12
  • Last Seen:  

did you try this?
 

*getmapusers("<map name>")

This function will return the number of users currently located on the specified
map.

This is used officially in PVP scripts to check whether a room is filled to capacity.

*mapwarp "<from map>","<to map>",<x>,<y>{,<type>,<ID>};

This command will collect all characters located on the From map and warp them
wholesale to the same point on the To map, or randomly distribute them there if
the coordinates are zero. "Random" is understood as a special To map name and
will mean randomly shuffling everyone on the same map.

Optionally, a type and ID can be specified. Available types are:

 0 - Everyone
 1 - Guild
 2 - Party

Example:

// Will warp all members of guild with ID 63 on map prontera to map alberta.
    mapwarp "prontera","alberta",150,150,1,63;



-- JUST THE ADDED SCRIPT---

.@event_map$ = "morocc";
if(getmapusers(.@event_map$) > 0){
    mapwarp(.@event_map$,"prontera",190,160,0;
}

--- THE WHOLE SCRIPT ---

 

-	script	diatrigger	-1,{

OnInit:
disablenpc "Diamond Tower#diaroom";
.@event_map$ = "morocc"; // event map

bindatcmd "diatower", strnpcinfo(0)+"::OnCommand",99,100;
	end;
OnCommand:
	if ( compare( .@atcmd_parameters$, "on" ) ) goto Ondiatrigger;
	else {
		dispbottom "type - '@diatower on' to start the dia tower";
	}
	end;

end;

OnClock0300:
OnClock0600:
OnClock0900:
Ondiatrigger:
if(agitcheck() == 1) end;
enablenpc "Diamond Tower#diaroom";
announce "Diagate Keeper: Diamond Tower is NOW OPEN! ",bc_all,0xFFFF00;
sleep 1000;
announce "Diagate Keeper: For those who want to hunt ORES for Safe refine, now is the time!",bc_all,0xFFFF00;
sleep 1000;
announce "Diagate Keeper: Diamont Tower would be open for 1 Hour!",bc_all,0xFFFF00;
sleep 30000;
announce "Diagate Keeper: Diamond Tower is NOW OPEN!",bc_all,0xFFFF00;
sleep 30000;
announce "Diagate Keeper: Diamond Tower will only be open for 1 Hour every 4hrs.",bc_all,0xFFFF00;
sleep ( 60 * 60000 ); // How long before hide again.
announce "Diagate Keeper: Diamond Tower is now close, Dia Tower will be open after 4hrs.",bc_all,0xFFFF00;
disablenpc "Diamond Tower#diaroom";

if(getmapusers(.@event_map$) > 0){
	mapwarp(.@event_map$,"prontera",190,160,0;
}

end;
}


if this don't work just change the .@event_map$ to $@event_map$ <-- [ Temporary Global String Variable ]

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