Location: PHPKode > projects > PhpBlock > A9.8/modules/dungeon/unit/trap.class.php
<?php
include_once $PATH_TO_CODE."/modules/dungeon/unit/dungeonrealobject.class.php";

class Trap extends DungeonRealObject
{

    public function getObjectInfoValueImage() {
        return DungeonConstante::$REAL_OBJECT_INFO_VALUE_TRAP_IMAGE;
    }
	public function isAvailableToFindTrap() {
		return false;
	}
    public static function create($parZone, $parPlayerId, $parIsLobotomize=false)
    {
        global $gloObjectManager;
        $locPlayer = $gloObjectManager->getPlayer($parPlayerId);
        $locObjectId = DungeonRealObject::createObject(DungeonConstante::$REAL_OBJECT_TYPE_TRAP,
        	$locPlayer, $parZone, DungeonConstante::$REAL_OBJECT_CATEGORY_TRAP, $parIsLobotomize,
        	Constante::$DISPLAY_PRIORITY_LOW, RealObject::$REAL_OBJECT_VISIBLE_STATE_VISIBLE_BY_ALLIANCE, 0);
        
		DungeonRealObject::insertInfo($locObjectId, 1, 1, 0,
				Constante::$REF_MAX_ACTION_POINT, Constante::$REF_MAX_ACTION_POINT, 
        		Constante::$REF_MAX_ACTION_POINT*2, Constante::$REF_MAX_ACTION_POINT*2,
        		Constante::$REF_MAX_ACTION_POINT*2, Constante::$REF_MAX_ACTION_POINT/2,
        		DungeonConstante::$ACTION_BUY_TRAP_COST*DungeonConstante::$UPKEEP_PRICE_MUX,
        		($parIsLobotomize?20:0));

        DungeonRealObject::insertWeapon($locObjectId, 0, 0, 0, 
        		Weapon::$WEAPON_RANGE_HAND_TO_HAND, Weapon::$WEAPON_TYPE_TRAP,
        		15);

        return $locObjectId;
    }
    public function addXP($parXP) {
    	//No XP for Trap
    }
    public function kill($parKiller) {
    	if($parKiller) {
    		$this->sendMessageHasBeenKilled($parKiller);
    	}
        $this->deleteObject();
    }
    public function move($parTargetZoneId, &$parResultMessage) {
        $parResultMessage=$this->getName()." can't move";
        return false;
    }
    public static function staticGetName() {
    	return "trap";
    }
    public function getName() {
      return Trap::staticGetName();
    }
}
?>
Return current item: PhpBlock