Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   sparring zone (https://forums.graalonline.com/forums/showthread.php?t=74500)

ff7chocoboknight 06-10-2007 03:28 AM

sparring zone
 
What is the command for sparring? And could a see an example of setting an area in the middle of a level as a sparring zone?

DustyPorViva 06-10-2007 03:34 AM

I always thought the way they did sparringzones was really awkward. I don't know how they do it in GS2, but it used to be I think, issparringzone, in an NPC with nothing else at all, no if's, functions, checks or such.

ff7chocoboknight 06-10-2007 03:46 AM

oh.... well then...

ff7chocoboknight 06-10-2007 03:49 AM

ok someone sent me a pm on graal with this in it...
PHP Code:

if (createdsetshape 1,32,32
if (
actionwarp) { 
  
with(getplayer(#p(0))) "levelname,x,y;" 

//#CLIENTSIDE 
if (created || timeout) { 
  
setstring this.player_1-online,false
  
setstring this.player_2-online,false
  for(
this.i=0this.i<playerscountthis.i++) { 
    if (
players[this.i].x in |"x,y"| && players[this.i].y in |"x,y"|) { 
      if (
strequals(#a(this.i),#s(this.player_1))) { 
        
setstring this.player_1-online,true
      }elseif (
strequals(#a(this.i),#s(this.player_2))) { 
        
setstring this.player_2-online,true
      } 
    } 
  } 
  if (
strequals(#s(this.player_1-online),false)) setstring this.player_1,; 
  
if (strequals(#s(this.player_2-online),false)) setstring this.player_2,; 
  
setstring this.players,; 
  for(
this.i=0this.i<playerscountthis.i++) { 
    if (
players[this.i].x in |"x,y"| && players[this.i].y in |"x,y"|) { 
      if (
strequals(#s(this.player_1),) && !strequals(#a(this.i),#s(this.player_1))) { 
        
setstring this.player_1,#a(this.i); 
      
}elseif (strequals(#s(this.player_2),) && !strequals(#a(this.i),#s(this.player_1))) { 
        
setstring this.player_2,#a(this.i); 
      
}elseif (!strequals(#a(this.i),#s(this.player_1)) && !strequals(#a(this.i),#s(this.player_2))) addstring this.players,#a(this.i); 
    

  } 
  for(
this.i=0this.i<sarraylen(this.players); this.i++) { 
    
triggeraction x+1,y+1,warp,#I(this.players,this.i); 
  

  
timeout .05


This script is sscaring me... :megaeek:

Angel_Light 06-10-2007 03:58 AM

levels are sparring zones by default I thought, to turn it off one would use noplayerkilling(); and if (noPKzone) {

gah, bloody GS1 in a GS2 area :O Anyways I think the script is either so sort of spar door, or spar area, Too tired to fully look at though z.z

DustyPorViva 06-10-2007 04:01 AM

Well, there's a difference between PKing and Sparring. Levels are PK by default, but they aren't sparringzones by default. Sparringzones don't effect alignment, don't drop your stuff, and other effects that I can't remember.

Angel_Light 06-10-2007 04:05 AM

Ah, thanks for the correction :]

Grey 06-10-2007 04:08 AM

issparringzone is only to check if the level is a sparring zone.

if (issparringzone) {
//dostuff
}

Sparring zones are set as Dusty says, but with just 'sparringzone' on its own in an NPC instead. As far as I know there is no way of setting a partial sparringzone in a level (such as inside the sparring area) though you can do something like checking the player's x and y and if it is in a certain area then enabling weapons, otherwise disabling them instead.

ff7chocoboknight 06-10-2007 04:17 AM

How about a command for resetting pking

godofwarares 06-12-2007 07:11 PM

Quote:

Originally Posted by ff7chocoboknight (Post 1316761)
How about a command for resetting pking

You can't :[

Evil_Trunks 06-22-2007 08:21 PM

NPC Code:

//#CLIENTSIDE
sparringzone



Should look like that in an NPC by itself.


All times are GMT +2. The time now is 08:24 AM.

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