Location: PHPKode > projects > PhpBlock > A9.8/modules/dungeon/action/buildrallypoint.class.php
<?php
include_once $PATH_TO_CODE."/modules/dungeon/action/abstractrecruitaction.class.php";

class BuildRallyPointAction extends DungeonAbstractRecruitAction {
	function __construct($parActionType) {
		parent::__construct($parActionType, 0, false, false);
		$this->rallyPointLevel = $parActionType-DungeonConstante::$ACTION_BUILD_RALLY_POINT_1+1;
	}

	public function create($locZone, $locPlayer) {
		$locManageAction = ManageAction::getInstance();
		$locObjectId = RallyPoint::create($locZone, $locPlayer->playerId, $this->rallyPointLevel);
		global $gloObjectManager;
		$locObject = $gloObjectManager->getRealObject($locObjectId);
		$locObject->setIAMode(RealObject::$IA_MODE_NO);
		$locManageAction->addPlayerInfo("rally point level $this->rallyPointLevel is installed");
	}
	
	public function isBlockMustBeOwnByPlayer() {
		return false;
	}
	
	public function isOkToRecruit($locBlock, $locZone, $locPlayer) {
		$locManageAction = ManageAction::getInstance();
		$locPlayer = $locManageAction->getPlayer();

		if(count($locZone->getObjectsDisplayPriority(Constante::$DISPLAY_PRIORITY_LOW, $locPlayer->allianceId)) > 0) {
			$locManageAction->addPlayerInfo("Already a low display unit here");
			return false;
		}
		return parent::isOkToRecruit($locBlock, $locZone, $locPlayer);
	}
}
?>
Return current item: PhpBlock