Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 12-23-2007, 12:08 PM
projectigi projectigi is offline
Registered User
Join Date: Jan 2004
Posts: 403
projectigi is an unknown quantity at this point
replacing functions
(now we replace a already existing function)

a) replacing an npcs functions

(note that -HolyAddHere is an existant weapon that i have got on my char )

<script of any npc>
PHP Code:
//#CLIENTSIDE
function onCreated()
  {
  (
"-HolyAddHere").cTest = function()
    {
    
player.chat "a";
    };
  (
"-HolyAddHere").callFunction"cTest" );
  } 
<script of -HolyAddHere>
PHP Code:
//#CLIENTSIDE
public function callFunctionfuncN )
  {
  (@ 
funcN)();
  }
  
function 
cTest()
  {
  
player.chat "b";
  } 
works with servside npcs too

b) replacing a standard graal function

k, lets say if you do setani( "meh", "" ); the player will say "meh"... impossible? nooo

<script of some npc>
PHP Code:
//#CLIENTSIDE
function onCreated()
  {
  
this.setani = function( anianiparams )
    {
    
player.chat ani;
    };
  
setani"meh""" );
  } 
or from servside:
<script of some npcs>
PHP Code:
function onCreated()
  {
  
this.sendtorc = function( msg )
    {
    echo( 
"NPC-Serv wants to say:" msg );
    };
  
sendtorc"meh" );
  } 
Reply With Quote
 


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 12:59 AM.


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