Location: PHPKode > projects > PhpBlock > A9.8/modules/dungeon/unit/undead/undeadrealobject.class.php
<?php
include_once $PATH_TO_CODE."/modules/dungeon/unit/dungeonrealobject.class.php";
include_once $PATH_TO_CODE."/script/zone.class.php";
include_once $PATH_TO_CODE."/script/imagemanager.class.php";
include_once $PATH_TO_CODE."/script/weapon.class.php";

include_once $PATH_TO_CODE."/script/log.class.php";

abstract class UndeadRealObject extends DungeonRealObject
{
	/**Create a skeleton if killed unit is not undead. Delete killed unit, so no tomb*/
	public function doAfterKill($parKilledUnit) {
		parent::doAfterKill($parKilledUnit);
		if($parKilledUnit->realObjectType != DungeonConstante::$REAL_OBJECT_TYPE_DEADWORM &&
		$parKilledUnit->realObjectType != DungeonConstante::$REAL_OBJECT_TYPE_SPECTRE &&
		$parKilledUnit->realObjectType != DungeonConstante::$REAL_OBJECT_TYPE_SKELETON &&
		$parKilledUnit->realObjectType != DungeonConstante::$REAL_OBJECT_TYPE_TRAP) {
			global $gloObjectManager;
			$parKilledUnit->deleteObject();

			$locTargetZone = $gloObjectManager->getZone($parKilledUnit->zoneId);
			$locNewObjectId = Skeleton::create($locTargetZone, $this->playerId, false);
			$locNewObject = $gloObjectManager->getRealObject($locNewObjectId);
			$locNewObject->setActionPoint(0);
			$locNewObject->setFightPoint(0);
			$locNewObject->addXP($parKilledUnit->getLevel());
			$locNewObject->setLife($locNewObject->getMaxLife()/2);
			$locNewObject->setIAMode(RealObject::$IA_MODE_MEDIUM);
		}
	}

}
?>
Return current item: PhpBlock