Page 1 of 1

Kill Tile...

Posted: Wed Jul 09, 2008 9:01 am
by Poi
I'm making a kill tile, but only for monsters(so monsters can't enter a certain area)

But, I need to be able to check to see if the thing that stepped on the tile is a monster or a person...
So far I have a check that sees if a tamed animal steps on it...

now I need a check to see if its a human stepping on it and/or a check to see if its a monster/animal

something like this

Code: Select all

if (who == monster)
ApplyRawDamage( who, GetHp(who) );
endif

Posted: Wed Jul 09, 2008 10:18 am
by Austin

Code: Select all

use uo;

program WalkOnTile(mobile, tile, prev_x, prev_y, prev_z)
     if ( !mobile.IsA(POLCLASS_NPC) )
          // Mobile wasn't an NPC - So therefore it was a player.
          return 0;
     endif

     //.... handle monster killing code here.
     //ApplyRawDamage(mobile, 10000);

     return 1;
endprogram
[/code]

Posted: Wed Jul 09, 2008 11:12 am
by Poi
That worked, thanks