Jump to content
  • 0

Hide and Enable NPC


myieee

Question


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  83
  • Reputation:   0
  • Joined:  12/07/11
  • Last Seen:  

Hi rathena. im using an event warper from eathena. so i'd like to suggest if its possible to hide the npc when the gm announced like Event Warps is now closed . so to prevent abusing by some players (they wont go to the event) and also if the gm announce that RFYL warps is now opened and the Event Warper NPC will be enable so the players will join to that event

//===== eAthena Unofficial Script ===========================================
//= Event Warper
//===== By: =================================================================
//= rad417
//===== Current Version: ====================================================
//= 2.2
//===== Tested With: ====================================================
//= Trunk, SVN 13366+
//===== Description: ========================================================
//= Warps players to event place
//===== Additional Comments: ================================================
//= For revisions, see the change log!
//= 1.0 Script created
//= 1.1 Added Test Warp for GMs
//= 1.2 Added status PUB.
//= 2.0 Implemented an ON and OFF system and an indicator(PUB and npc),
//=	 also started with remote funtions, but failed to implement
//=2.1 Added the line "sc_end SC_ALL;" for debuff upon warping  (tnx ~AnnieRuru~, i read one of your post about this  )
//=2.2 Finally implemented the remote function 
//===========================================================================
prontera,156,170,5 script Event Warper 811,{
if (getgmlevel()>=1){
check:
if($state==0){
goto off;
}
else{
goto on;
}
close;
//--------------STATE: OFF----------------------------------------------------
off:
mes "[^3333FFEvent Warper^000000]";
mes "Event NPC State: ^FF0000OFF^000000";
mes "^221122--------Current Settings:--------^000000";
mes "Map: "+$map$+" "+$x+" "+$y;
mes "Event: "+$event$;
//mes "For remote commands:"; not yet implemented
//mes "PM ^FF0000NPC:Event Warper^000000";
menu "Nothing",noon,"Turn ON",yeson,"Set Event Warp.",setplace,"Warp",yeswarp;
yeson:
set $state,1;
next;
mes "[^3333FFEvent Warper^000000]";
mes "Ok it is now turned ^009900ON^000000.";
next;
goto check;
noon:
next;
mes "[^3333FFEvent Warper^000000]";
mes "Ok bye!";
close;
//--------------STATE: ON----------------------------------------------------
on:
mes "[^3333FFEvent Warper^000000]";
mes "Event NPC State: ^009900ON^000000";
mes "^221122--------Current Settings:--------^000000";
mes "Map: "+$map$+" "+$x+" "+$y;
mes "Event: "+$event$;
//mes "For remote commands:";
//mes "PM ^FF0000NPC:Event Warper^000000";
menu "Nothing",nooff,"Turn OFF",yesoff,"Set Event Warp.",setplace,"Warp",yeswarp;
yesoff:
set $state,0;
next;
mes "[^3333FFFULLRO Event Warper^000000]";
mes "Ok it is now turned ^FF0000OFF^000000.";
next;
goto check;
nooff:
next;
mes "[^3333FFEvent Warper^000000]";
mes "Ok bye!";
close;
setplace:
next;
mes "[^3333FFEvent Warper^000000]";
mes "You can set the event place here for easy access to players.";
mes "Set it?";
menu "Yes",yes,"No.",no;
yes:
next;
mes "[^3333FFEvent Warper^000000]";
mes "Just make sure you have the right coordinates.";
mes "It should be map x-coordinate y coordinate";
next;
change:
mes "[^3333FFEvent Warper^000000]";
mes "Enter map name";
mes "example: prontera";
input $map$;
next;
mes "[^3333FFEvent Warper^000000]";
mes "Enter the x-coordinate:";
mes "example: 150";
input $x;
next;
mes "[^3333FFEvent Warper^000000]";
mes "Enter the y-coordinate:";
mes "example: 150";
input $y;
next;
mes "That is "+$map$+" "+$x+" "+$y+" right?";
menu "Yes.",-,"Let me change it.",change;
mes "[^3333FFEvent Warper^000000]";
mes "Enter the Name of the EVENT:";
mes "example: RFYL";
input $event$;
next;
mes "[^3333FFEvent Warper^000000]";
mes "Ok, I will warp the contestants there.";
close;
no:
mes "[^3333FFEvent Warper^000000]";
mes "Ok. Bye.";
close;
}
//----------------------Normal Player---------------------------------
else{
if($state<=0){
mes "[^3333FFEvent Warper^000000]";
mes "Sorry. No events at this time.";
emotion 17;
close;
}
else{
emotion 21;
mes "[^3333FFEvent Warper^000000]";
mes "There is an active event!";
mes "Do you want to go to the event place?";
menu "Yes, please.",yeswarp,"No, thanks.",nowarp;
yeswarp:
atcommand "@warp "+$map$+" "+$x+" "+$y;
sc_end SC_ALL;
end;
nowarp:
close;
}}
//---------------------remote functions-------------------------NOTE: Not yet functional------------------------------
OnWhisperGlobal:
if (@whispervar0$=="|00On") {goto remoteon; close;}
if (@whispervar0$=="|00Off"){goto remoteoff; close;}
else dispbottom "Invalid syntax, you typed '"+@whispervar0+"'? you can only type On or Off.";
end;
remoteon:
set $state,1;
dispbottom "Ok it is now turned ON.";
end;
remoteoff:
set $state,0;
dispbottom "Ok it is now turned OFF.";
end;
OnInit:
set $state,0;
end;
}

morocc,155,90,5 duplicate(Event Warper) Event Warper#h1-1 811

Edited by myieee
Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  83
  • Reputation:   0
  • Joined:  12/07/11
  • Last Seen:  

@edit : your script is working. but they can still join / enter to the event even tho the warper is disabled/

1 more thing i tried to duplicate the npc . when i typed the eventname,map,x,y . my duplicate warper didnt show up .

Edited by myieee
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  17
  • Reputation:   2
  • Joined:  02/27/12
  • Last Seen:  

i tried your script. this is good

Edited by Dream
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  222
  • Reputation:   35
  • Joined:  12/13/11
  • Last Seen:  

//===== eAthena Unofficial Script ===========================================
//= Event Warper
//===== By: =================================================================
//= rad417
//===== Current Version: ====================================================
//= 2.2
//===== Tested With: ====================================================
//= Trunk, SVN 13366+
//===== Description: ========================================================
//= Warps players to event place
//===== Additional Comments: ================================================
//= For revisions, see the change log!
//= 1.0 Script created
//= 1.1 Added Test Warp for GMs
//= 1.2 Added status PUB.
//= 2.0 Implemented an ON and OFF system and an indicator(PUB and npc),
//=  also started with remote funtions, but failed to implement
//=2.1 Added the line "sc_end SC_ALL;" for debuff upon warping  (tnx ~AnnieRuru~, i read one of your post about this  )
//=2.2 Finally implemented the remote function 
//===========================================================================
prontera,156,170,5 script Event Warper 811,{
if (getgmlevel()>=1){
check:
if($state==0){
goto off;
}
else{
goto on;
}
close;
//--------------STATE: OFF----------------------------------------------------
off:
mes "[^3333FFEvent Warper^000000]";
mes "Event NPC State: ^FF0000OFF^000000";
mes "^221122--------Current Settings:--------^000000";
mes "Map: "+$map$+" "+$x+" "+$y;
mes "Event: "+$event$;
//mes "For remote commands:"; not yet implemented
//mes "PM ^FF0000NPC:Event Warper^000000";
menu "Nothing",noon,"Turn ON",yeson,"Set Event Warp.",setplace,"Warp",yeswarp;
yeson:
set $state,1;
next;
mes "[^3333FFEvent Warper^000000]";
mes "Ok it is now turned ^009900ON^000000.";
next;
goto check;
noon:
next;
mes "[^3333FFEvent Warper^000000]";
mes "Ok bye!";
close;
//--------------STATE: ON----------------------------------------------------
on:
mes "[^3333FFEvent Warper^000000]";
mes "Event NPC State: ^009900ON^000000";
mes "^221122--------Current Settings:--------^000000";
mes "Map: "+$map$+" "+$x+" "+$y;
mes "Event: "+$event$;
//mes "For remote commands:";
//mes "PM ^FF0000NPC:Event Warper^000000";
menu "Nothing",nooff,"Turn OFF",yesoff,"Set Event Warp.",setplace,"Warp",yeswarp;
yesoff:
set $state,0;
next;
mes "[^3333FFFULLRO Event Warper^000000]";
mes "Ok it is now turned ^FF0000OFF^000000.";
next;
goto check;
nooff:
next;
mes "[^3333FFEvent Warper^000000]";
mes "Ok bye!";
close;
setplace:
next;
mes "[^3333FFEvent Warper^000000]";
mes "You can set the event place here for easy access to players.";
mes "Set it?";
menu "Yes",yes,"No.",no;
yes:
next;
mes "[^3333FFEvent Warper^000000]";
mes "Just make sure you have the right coordinates.";
mes "It should be map x-coordinate y coordinate";
next;
change:
mes "[^3333FFEvent Warper^000000]";
mes "Enter map name";
mes "example: prontera";
input $map$;
next;
mes "[^3333FFEvent Warper^000000]";
mes "Enter the x-coordinate:";
mes "example: 150";
input $x;
next;
mes "[^3333FFEvent Warper^000000]";
mes "Enter the y-coordinate:";
mes "example: 150";
input $y;
next;
mes "That is "+$map$+" "+$x+" "+$y+" right?";
menu "Yes.",-,"Let me change it.",change;
mes "[^3333FFEvent Warper^000000]";
mes "Enter the Name of the EVENT:";
mes "example: RFYL";
input $event$;
next;
mes "[^3333FFEvent Warper^000000]";
mes "Ok, I will warp the contestants there.";
close;
no:
mes "[^3333FFEvent Warper^000000]";
mes "Ok. Bye.";
close;
}
//----------------------Normal Player---------------------------------
else{
if($state<=0){
mes "[^3333FFEvent Warper^000000]";
mes "Sorry. No events at this time.";
emotion 17;
close;
}
else{
emotion 21;
mes "[^3333FFEvent Warper^000000]";
mes "There is an active event!";
mes "Do you want to go to the event place?";
menu "Yes, please.",yeswarp,"No, thanks.",nowarp;
yeswarp:
atcommand "@warp "+$map$+" "+$x+" "+$y;
sc_end SC_ALL;
end;
nowarp:
close;
}}
//---------------------remote functions-------------------------NOTE: Not yet functional------------------------------
OnWhisperGlobal:
if (@whispervar0$=="|00On") {goto remoteon; close;}
if (@whispervar0$=="|00Off"){goto remoteoff; close;}
else dispbottom "Invalid syntax, you typed '"+@whispervar0+"'? you can only type On or Off.";
end;
remoteon:
set $state,1;
dispbottom "Ok it is now turned ON.";
enablenpc "Event Warper";
end;
remoteoff:
set $state,0;
dispbottom "Ok it is now turned OFF.";
disablenpc "Event Warper";
end;
OnInit:
set $state,0;
end;
}

morocc,155,90,5 duplicate(Event Warper) Event Warper#h1-1 811

Try this :o, it should hide him when u whisper to it. but only when u whisper :X

Edited by lilcooldude69
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  83
  • Reputation:   0
  • Joined:  12/07/11
  • Last Seen:  

when i whisper the NPC. it says There is no such character name or users is offline

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

you can try this

[ Pastebin ] Event Warper

to Setup the Warp

[npc:Sample] : EventName#Map#X#Y

to Disable the Warp

[npc:Sample] : disable

For Example :

[npc:Sample] : Hide & Seek#prontera#150#181

Results :

Event Name :  Hide & Seek
Location :  prontera,150,181

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  83
  • Reputation:   0
  • Joined:  12/07/11
  • Last Seen:  

thanks emistry. problem solved

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