View Single Post
  #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