/** * 5118 You received %s from %s. * @param SR_RealNPC $npc * @param array $args */ public function ai_msg_5118(SR_RealNPC $npc, array $args) { $item = self::getInvItem($npc, $args[0]); $player = self::getHuman(); SR_AIGoal::addGoal($npc, 'giveback', $goal); ${$npc}->ai_give($player, $item); $npc->ai_say_message('No thanks.'); }
public function ai_goal(SR_RealNPC $npc) { if (self::isDropOverweight($npc)) { foreach (self::getUnwantedItems(5000) as $item) { $item instanceof SR_Item; SR_AIGoal::addGoal($npc, 'cleanup', new SR_AIGoal('drop ' . $item->getItemName(), $item->getVar('urgengy'))); break; } } }
public function ai_goal(SR_RealNPC $npc) { echo __CLASS__ . __FUNCTION__ . ': ' . $npc->getClassName(); $cityname = $this->getCityname(); $currcity = $npc->getParty(false)->getCity(); if ($currcity === $cityname) { if (self::canExplore($cityname)) { SR_AIGoal::addGoal($npc, 'explore', new SR_AIGoal('exp')); } } }