Beispiel #1
0
 /**
  * @method boolean forceRegisterSkill(Skill $skill) registers an Skill to SkillManager regardless of whether id of skill is already registered.
  * @param Skill $skill The skill to register.
  */
 public static function forceRegisterSkill(Skill $skill)
 {
     self::$skills[$skill->getId()] = $skill;
     $skill->__init();
 }
Beispiel #2
0
 public function acquireSkill(Skill $skill)
 {
     $skillAcquireEvent = new SkillAcquireEvent(ToAruPG::getInstance(), $skill, $this);
     Server::getInstance()->getPluginManager()->callEvent($skillAcquireEvent);
     $skill->setPlayer($this);
     if (!$skillAcquireEvent->isCancelled()) {
         $item = $skill->getItem();
         $item->setCustomName(ToAruPG::getTranslation($skill->getName()));
         $this->skills[$item->getId() . ";" . $item->getDamage()] = $skill;
         if (!$this->player->getInventory()->contains($item)) {
             $this->player->getInventory()->addItem($item);
         }
     }
     $skill->onPassiveInit();
 }