예제 #1
0
        /// <summary>
        /// Resurrects target if it accepts
        /// </summary>
        /// <param name="player"></param>
        /// <param name="response"></param>
        protected virtual void ResurrectResponceHandler(GamePlayer player, byte response)
        {
            //DOLConsole.WriteLine("resurrect responce: " + response);
            GameTimer resurrectExpiredTimer = null;

            lock (m_resTimersByLiving.SyncRoot)
            {
                resurrectExpiredTimer = (GameTimer)m_resTimersByLiving[player];
                m_resTimersByLiving.Remove(player);
            }
            if (resurrectExpiredTimer != null)
            {
                resurrectExpiredTimer.Stop();
            }

            GameLiving rezzer = (GameLiving)player.TempProperties.getProperty <object>(RESURRECT_CASTER_PROPERTY, null);

            if (!player.IsAlive)
            {
                if (rezzer == null)
                {
                    player.Out.SendMessage("No one is currently trying to resurrect you.", eChatType.CT_System, eChatLoc.CL_SystemWindow);
                }
                else
                {
                    if (response == 1)
                    {
                        ResurrectLiving(player);                         //accepted
                        //VaNaTiC->
                        //#warning VaNaTiC: add this in GamePlayer.OnRevive with my RevivedEventArgs
                        // Patch 1.56: Resurrection sickness now goes from 100% to 50% when doing a "full rez" on another player.
                        // We have do to this here, cause we dont have any other chance to get
                        // an object-relation between the casted spell of the rezzer (here) and
                        // the produced illness for the player (OnRevive()).
                        // -> any better solution -> post :)
                        if (Spell.ResurrectHealth == 100)
                        {
                            GameSpellEffect effect = SpellHandler.FindEffectOnTarget(player, "PveResurrectionIllness");
                            if (effect != null)
                            {
                                effect.Overwrite(new GameSpellEffect(effect.SpellHandler, effect.Duration / 2, effect.PulseFreq));
                            }
                            GameSpellEffect effecttwo = SpellHandler.FindEffectOnTarget(player, "RvrResurrectionIllness");
                            if (effecttwo != null)
                            {
                                effecttwo.Overwrite(new GameSpellEffect(effecttwo.SpellHandler, effecttwo.Duration / 2, effecttwo.PulseFreq));
                            }
                        }
                        //VaNaTiC<-
                    }
                    else
                    {
                        player.Out.SendMessage("You decline to be resurrected.", eChatType.CT_System, eChatLoc.CL_SystemWindow);
                        //refund mana
                        m_caster.Mana += PowerCost(player);
                    }
                }
            }
            player.TempProperties.removeProperty(RESURRECT_CASTER_PROPERTY);
        }