Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-06-2005, 04:07 PM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Attributes Finder

Well, I was kinda bored so I figured I'd post a fun NPC that anybody can feel free to use, as long as you dont take out the credit to me.
Take note that this is in GS2, I will post a GS1 version later.
PHP Code:
//Made by Vash-Aniki(*coreys)
function onserverside() {
  if (
strequals(params[0],attribs)) {
    
with (getplayer(params[1])) {
      
body player.body;
      
head player.head;
      
sword player.sword;
      
shield player.shield;
      
acct player.account;
  }
 }
}

//#CLIENTSIDE
if (playerchats&&startswith(getattribs,player.chat)) {
  
tokenize player.chat;
  
triggeraction(0,0,serverside,Attributes Finder,attribs,tokens[1]);
  
say2 ("Attributes of "@acct#b"Head:"@head#b"Body:"@body#b"Sword:"@sword#b"Shield:"@shield);

__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #2  
Old 05-06-2005, 09:24 PM
Ajira Ajira is offline
Poont.
Join Date: Oct 2004
Location: NY, USA
Posts: 477
Ajira is on a distinguished road
Did you actually test this? Becuase I highly doubt it works. You should also learn to use GScript2 to it's full advantage.
__________________
Liek omigosh.

Reply With Quote
  #3  
Old 05-06-2005, 11:45 PM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
I was at school when i made it. And I dont feel like finding graal3 to test it >.>

Here's a GS1 version that works:
PHP Code:
//Made by Vash-Aniki(*coreys)
if (actionserverside) {
 if (
strequals(#p(0),attrib)) {
   
with (getplayer(#p(1))) {
     
setstring this.sw,#1;
     
setstring this.sh,#2;
     
setstring this.h,#3;
     
setstring this.b,#8;
  
}
  
say2 Head#s(this.h)#bBody:#s(this.b)#bSword:#s(this.sw)#bShield:#s(this.sh);
 
}
}
//#CLIENTSIDE
if (playerchats&&startswith(/attrib ,#c)) {
  
tokenize #c;
  
triggeraction 0,0,serverside,Attributes Finder,attrib,#t(1);

__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #4  
Old 05-07-2005, 01:43 AM
Rick Rick is offline
PipBoy Extraordinaire!
Rick's Avatar
Join Date: Jul 2004
Location: Long Beach, California.
Posts: 831
Rick is on a distinguished road
HTML Code:
// Rewritten from scratch. Public domain goodness.
// You need not credit me for this exceedingly useless utility.
function onActionServerSide()
{
  if (params[0] == "attribs")
  {
    p = findplayer(params[1]);
    
    if (p == null)
    {
      triggerAction(0, 0, "clientside", "Attributes Finder", "attribs", "null", params[1]);
    }
    else
    {
      triggerAction(0, 0, "clientside", "Attributes Finder", "attribs", p.account, p.body, p.head, p.sword, p.shield);
    }
  }
}

//#CLIENTSIDE
function onActionClientside()
{
  if (params[0] == "attribs")
  {
    if (params[1] == "null")
    {
      say2("Player '" @ params[2] @ "' not found.");
    }
    else
    {
      say2
      (
        "Attributes of '" @ params[1] @ "':\n" @
        "Body: " @ params[2] @ "\n" @
        "Head: " @ params[3] @ "\n" @
        "Sword: " @ params[4] @ "\n" @
        "Shield: " @ params[5] @ "\n"
      );
    }
  }
}

function onPlayerChats()
{
  toks = player.chat.trim().tokenize();
  
  if (toks[0] == "/getattribs" && toks[1] != null)
  {
    triggeraction(0, 0, "serverside", "Attributes Finder", "attribs", toks[1]);
  }
}
Now, this likely does not work offhand but it is much better than that horrible code at the beginning of this thread.
Reply With Quote
  #5  
Old 05-07-2005, 10:09 PM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Yeah...I'm still learning ^-^'
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:51 PM.


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