Exemplo n.º 1
0
        protected static void PlayerLeftWorld(DOLEvent e, object sender, EventArgs args)
        {
            GamePlayer player = sender as GamePlayer;

            if (player == null)
            {
                return;
            }

            TraitorInMularn quest = player.IsDoingQuest(typeof(TraitorInMularn)) as TraitorInMularn;

            if (quest != null)
            {
                GameEventMgr.RemoveHandler(player, GamePlayerEvent.UseSlot, new DOLEventHandler(PlayerUseSlot));
                GameEventMgr.RemoveHandler(player, GamePlayerEvent.Quit, new DOLEventHandler(PlayerLeftWorld));

                // remorph player back...
                if (player.Model == ladyHinda.Model)
                {
                    GameClient client = player.Client;
                    player.Model = (ushort)client.Account.Characters[client.ActiveCharIndex].CreationModel;
                    SendSystemMessage(player, "You change back to your normal form!");
                }

                if (quest.Step == 3)
                {
                    if (ladyHinda != null)
                    {
                        ladyHinda.Delete();
                    }
                }
            }
        }
Exemplo n.º 2
0
 public override int OnEffectExpires(GameSpellEffect effect, bool noMessages)
 {
     if (Npc != null)
     {
         Npc.Delete();
     }
     return(base.OnEffectExpires(effect, noMessages));
 }
Exemplo n.º 3
0
 /// <summary>
 /// When an applied effect expires.
 /// Duration spells only.
 /// </summary>
 /// <param name="effect">The expired effect</param>
 /// <param name="noMessages">true, when no messages should be sent to player and surrounding</param>
 /// <returns>immunity duration in milliseconds</returns>
 public override int OnEffectExpires(GameSpellEffect effect, bool noMessages)
 {
     if (summoned != null)
     {
         summoned.Health = 0; // to send proper remove packet
         summoned.Delete();
     }
     return(base.OnEffectExpires(effect, noMessages));
 }
Exemplo n.º 4
0
 /// <summary>
 /// Release the pet
 /// </summary>
 protected virtual void ReleasePet()
 {
     if (m_pet != null)
     {
         m_pet.RemoveFromWorld();
         m_pet.Delete();
         m_pet = null;
     }
 }
Exemplo n.º 5
0
 protected void deleteGrifflet()
 {
     if (grifflet != null)
     {
         GameEventMgr.RemoveHandler(grifflet, GameLivingEvent.Interact, new DOLEventHandler(TalkToGrifflet));
         grifflet.Delete();
         grifflet = null;
     }
 }
Exemplo n.º 6
0
 /// <summary>
 /// Called on every timer tick.
 /// </summary>
 protected override void OnTick()
 {
     // Remove the NPC from the world.
     if (m_npc != null)
     {
         m_npc.Delete();
         m_npc = null;
     }
 }
Exemplo n.º 7
0
 protected void deleteDragonflyHatchling()
 {
     if (dragonflyHatchling != null)
     {
         GameEventMgr.RemoveHandler(dragonflyHatchling, GameLivingEvent.Interact, new DOLEventHandler(TalkToDragonflyHatchling));
         dragonflyHatchling.Delete();
         dragonflyHatchling = null;
     }
 }
Exemplo n.º 8
0
        protected void OnRemovePigHerder(DOLEvent e, object n, EventArgs args)
        {
            GameNPC pigHerderWyatt = n as GameNPC;

            if (pigHerderWyatt != null)
            {
                GameEventMgr.RemoveHandler(pigHerderWyatt, GameNPCEvent.CloseToTarget, new DOLEventHandler(OnRemovePigHerder));
//				pigHerderWyatt.RemoveFromWorld();
                pigHerderWyatt.Delete();
            }
        }
Exemplo n.º 9
0
        /// <summary>
        /// Called when the Bomber reaches his target
        /// </summary>
        private void BomberArriveAtTarget(DOLEvent e, object sender, EventArgs args)
        {
            GameNPC bomber = sender as GameNPC;

            //[Ganrod] Nidel: Prevent NPE
            if (bomber == null || m_pet == null || bomber != m_pet)
            {
                return;
            }

            //[Ganrod] Nidel: Abort and delete bomber if Spell or Target is NULL
            Spell      subspell = SkillBase.GetSpellByID(m_spell.SubSpellID);
            GameLiving living   = m_pet.TempProperties.getProperty <object>(BOMBERTARGET, null) as GameLiving;

            if (subspell == null || living == null)
            {
                if (log.IsErrorEnabled && subspell == null)
                {
                    log.Error("Bomber SubspellID for Bomber SpellID: " + m_spell.ID + " is not implemented yet");
                }
                bomber.Health = 0;
                bomber.Delete();
                return;
            }

            //Andraste
            subspell.Level = m_spell.Level;
            if (living.IsWithinRadius(bomber, 350))
            {
                ISpellHandler spellhandler = ScriptMgr.CreateSpellHandler(Caster, subspell, SkillBase.GetSpellLine(SpellLine.KeyName));
                spellhandler.StartSpell(living);
            }

            //[Ganrod] Nidel: Delete Bomber after all actions.
            bomber.Health = 0;
            bomber.Delete();
        }
Exemplo n.º 10
0
 public override int OnEffectExpires(GameSpellEffect effect, bool noMessages)
 {
     if (warder != null)
     {
         GameEventMgr.RemoveHandler(warder, GameLivingEvent.Dying, new DOLEventHandler(BattleWarderDie));
         warder.RemoveBrain(warder.Brain);
         warder.Health = 0;
         warder.Delete();
     }
     if ((effect.Owner is GamePlayer))
     {
         GamePlayer casterPlayer = effect.Owner as GamePlayer;
         GameEventMgr.RemoveHandler(casterPlayer, GamePlayerEvent.Moving, new DOLEventHandler(PlayerMoves));
         GameEventMgr.RemoveHandler(casterPlayer, GamePlayerEvent.CastStarting, new DOLEventHandler(PlayerMoves));
         GameEventMgr.RemoveHandler(casterPlayer, GamePlayerEvent.AttackFinished, new DOLEventHandler(PlayerMoves));
     }
     effect.Owner.EffectList.Remove(effect);
     return(base.OnEffectExpires(effect, noMessages));
 }
Exemplo n.º 11
0
 protected virtual int DeleteAskefruer(RegionTimer callingTimer)
 {
     askefruer.Delete();
     askefruer = null;
     return(0);
 }
Exemplo n.º 12
0
 protected virtual int DeleteSluagh(RegionTimer callingTimer)
 {
     sluagh.Delete();
     sluagh = null;
     return(0);
 }
Exemplo n.º 13
0
 protected virtual int DeleteFairy(RegionTimer callingTimer)
 {
     ireFairy.Delete();
     ireFairy = null;
     return(0);
 }