Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Level Warper (https://forums.graalonline.com/forums/showthread.php?t=13085)

nyghtGT 09-27-2001 09:52 AM

Level Warper
 
here is a warper I made its pretty basic and can work 2 ways first of all you could say 'warpto newx newy levelname.graal' and you'll warp to that exact point or 'warpto levelname.graal' I haven't tested it yet but it seems like it would work. Uhh anyone can use it. I made it for people who dont script well to learn something about tokens from .... anyway here it is .... ohh also for it to work you need to have the flag 'staff'.
NPC Code:

// NPC made by Nyght v3.5
if (playerenters) {
toweapons *Staff Warper
}
while (created && !staff) {
destroy;
}
if (playerchats && staff && startswith(warpto,#c)) {
tokenize #c;
if (strtofloat(#t(1))>=0) {
this.warpcommand=0;
}else setlevel #t(1);
}
}
if (this.warpcommand=0) {
setlevel2 #t(3),#t(1),#t(2);
timeout=0.5;
}
if (timeout) {
this.warpcommand=1;
}


Tell me if it dont work ....

Merlin 09-27-2001 10:36 AM

i will post mine let me find it..

Merlin 09-27-2001 10:39 AM

i was making things for fun like two days ago here is mine which involves another npc on duty...


Warper
Quote:

// NPC made by Merlin
//level warper
if (playerenters) {
toweapons Warper;
setgif shadoworb.gif;
}
if (weaponfired) {
say2 Say,#b
warpto x y levelname.graal#b
to warp.#b
-Merlin;
}
if (playerchats) {
tokenize #c;
if (tokenscount==4) {
if (onduty) {
this.x=strtofloat(#t(1));
this.y=strtofloat(#t(2));
setstring local.level,#t(3);
timeout = .5;
}
else{
setplayerprop #c,Go on duty before warping!;
}
}
}
if (timeout) {
setlevel2 #s(local.level),this.x,this.y;
}
On - duty

Quote:

// NPC made by Merlin
if (playertouchsme) {
toweapons Staff - Duty;
say2 This is the staff duty,#b
to use the staff weapons here#b
you must be 'on duty'#b
which means you need to have#b
your tag on and fire this weapon;
timeout = .5;
this.on = true;
}
if (weaponfired) {
if (strequals(#g,GP)||strequals(#g,Admin)||strequals( #g,SM)||strequals(#g,GP_Chief)||strequals(#a,Merli n)||strequals(#g,NPC_Admin)) {
if (this.on==false) {
setplayerprop #c, You are now on duty;
this.on = true;
set onduty;
}
else{
this.on = false;
setplayerprop #c,You are now off duty;
unset onduty;
}
}
}
if (timeout) {
timeout = 1;
if (this.on==true) {
if (!strequals(#g,GP)||!strequals(#g,Admin)||!strequa ls(#g,SM)||!strequals(#g,GP_Chief)||!strequals(#a, Merlin)||!strequals(#g,NPC_Admin)) {
this.on = false;
}
}
}

ownerofbabylon 09-27-2001 11:26 AM

wow those are nice guys :)

James 09-27-2001 11:32 AM

I just right click on the map

ownerofbabylon 09-27-2001 11:37 AM

Quote:

Originally posted by James
I just right click on the map
what?

Sep3kP2P 09-27-2001 10:50 PM

hes staff, on 2001 if u right click on the map u warp places =/ here, ill post my warping one, doesn't use as much code as your guys does...
PHP Code:

//NPC made by Sephiroth2k
if(playertouchsme){
  
toweapons -Staff-Warper;
  
hidelocal;
}
if(
playerchats&&strequals(#g,Admin)&&startswith(warpto,#c)){
  
tokenize #c;
  
if(tokenscount=2){
    
setlevel #s(#t(1));
  
}
  if(
tokenscount=4){
    
setlevel2 #s(#t(1)),#v(#t(2)),#v(#t3));
  
}


i just made that in the message =/ does it work?

Sep3kP2P 09-27-2001 11:07 PM

this i now know, i changed them to strtofloat, but it still didn't work

Riot-Starter 09-27-2001 11:24 PM

Here is my level warper:
NPC Code:

if (playertouchsme) {
toweapons -Warper;
}
if (playerchats&&startswith(warpto,#c)){
tokenize #c;
if (tokenscount==3){
playerx=strtofloat(#t(1));
playery=strtofloat(#t(2));
}
if (tokenscount==4)
setlevel2 #t(3),strtofloat(#t(1)),strtofloat(#t(2));
}


Sep3kP2P 09-27-2001 11:28 PM

=)
 
thats what mines like (fixed) except u have warping to coordinates instead of blank level, with the both it would be better

Riot-Starter 09-27-2001 11:33 PM

Well i made that off the top of my head so i donno if it works right

Sep3kP2P 09-27-2001 11:53 PM

it should

fireball_dolphonia 09-28-2001 08:33 AM

My level warper
if (weaponfired)setlevel #c;

mystic_pheonix 09-28-2001 10:33 AM

Quote:

Originally posted by James
I just right click on the map
how exactly does that work?!?

SagaTCN 09-28-2001 11:24 AM

Quote:

Originally posted by mystic_pheonix


how exactly does that work?!?

built into graal =/


All times are GMT +2. The time now is 11:44 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.