Example #1
0
 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;
         }
     }
 }
Example #2
0
 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'));
         }
     }
 }
Example #3
0
 public function ai_init()
 {
     echo "ai_init!\n";
     $this->ai_init_extensions();
     SR_AIGoal::resetGoals($this);
     $this->realnpcfunc('before_init');
     $this->realnpcfunc('goals');
     $this->realnpcfunc('after_init');
 }
Example #4
0
 public function ai_check_goal(SR_RealNPC $npc)
 {
     SR_AIGoal::removeGoal($npc, $key);
 }