public PlayerXEffect getSavedEffect() { if (RestoredEffect) { PlayerXEffect eff = new PlayerXEffect(); eff.Duration = RemainingTime; eff.IsHandler = true; eff.Var1 = RestoreVars[0]; eff.Var2 = RestoreVars[1]; eff.Var3 = RestoreVars[2]; eff.Var4 = RestoreVars[3]; eff.Var5 = RestoreVars[4]; eff.Var6 = RestoreVars[5]; eff.SpellLine = SpellHandler.SpellLine.KeyName; return(eff); } if (m_handler != null) { PlayerXEffect eff = m_handler.GetSavedEffect(this); return(eff); } return(null); }
/// <summary> /// Save All Effect to PlayerXEffect Data Table /// </summary> public virtual void SaveAllEffects() { GamePlayer player = m_owner as GamePlayer; if (player == null || m_effects == null) { return; } lock (m_lockObject) { if (m_effects.Count < 1) { return; } foreach (IGameEffect eff in m_effects) { try { var gse = eff as GameSpellEffect; if (gse != null) { // No concentration Effect from Other Caster if (gse.Concentration > 0 && gse.SpellHandler.Caster != player) { continue; } } PlayerXEffect effx = eff.getSavedEffect(); if (effx == null) { continue; } if (effx.SpellLine == GlobalSpellsLines.Reserved_Spells) { continue; } effx.ChardID = player.ObjectId; GameServer.Database.AddObject(effx); } catch (Exception e) { if (log.IsWarnEnabled) { log.WarnFormat("Could not save effect ({0}) on player: {1}, {2}", eff, player, e); } } } } }
public override PlayerXEffect GetSavedEffect(GameSpellEffect e) { PlayerXEffect eff = new PlayerXEffect(); eff.Var1 = Spell.ID; eff.Duration = e.RemainingTime; eff.IsHandler = true; eff.SpellLine = SpellLine.KeyName; return(eff); }
public override PlayerXEffect GetSavedEffect(GameSpellEffect e) { PlayerXEffect eff = new PlayerXEffect { Var1 = Spell.ID, Duration = e.RemainingTime, IsHandler = true, SpellLine = SpellLine.KeyName }; return(eff); }
public override PlayerXEffect GetSavedEffect(GameSpellEffect e) { if ( //VaNaTiC-> this cannot work, cause PulsingSpellEffect is derived from object and only implements IConcEffect //e is PulsingSpellEffect || //VaNaTiC<- Spell.Pulse != 0 || Spell.Concentration != 0 || e.RemainingTime < 1) return null; PlayerXEffect eff = new PlayerXEffect(); eff.Var1 = Spell.ID; eff.Duration = e.RemainingTime; eff.IsHandler = true; eff.SpellLine = SpellLine.KeyName; return eff; }
public override PlayerXEffect GetSavedEffect(GameSpellEffect e) { if ( //VaNaTiC-> this cannot work, cause PulsingSpellEffect is derived from object and only implements IConcEffect //e is PulsingSpellEffect || //VaNaTiC<- Spell.Pulse != 0 || Spell.Concentration != 0 || e.RemainingTime < 1) { return(null); } PlayerXEffect eff = new PlayerXEffect(); eff.Var1 = Spell.ID; eff.Duration = e.RemainingTime; eff.IsHandler = true; eff.SpellLine = SpellLine.KeyName; return(eff); }
public virtual void SaveAllEffects() { GamePlayer player = m_owner as GamePlayer; if (player == null) { return; } if (m_effects == null) { return; } lock (m_effects) { if (m_effects.Count < 1) { return; } foreach (IGameEffect eff in m_effects) { if (eff is GameSpellEffect) { GameSpellEffect gse = eff as GameSpellEffect; if (gse.Concentration > 0 && gse.SpellHandler.Caster != player) { continue; } } PlayerXEffect effx = eff.getSavedEffect(); if (effx == null) { continue; } if (effx.SpellLine == GlobalSpellsLines.Reserved_Spells) { continue; } effx.ChardID = player.DBCharacter.ObjectId; GameServer.Database.AddObject(effx); } } }
public override PlayerXEffect GetSavedEffect(GameSpellEffect e) { PlayerXEffect eff = new PlayerXEffect(); eff.Var1 = Spell.ID; eff.Duration = e.RemainingTime; eff.IsHandler = true; eff.SpellLine = SpellLine.KeyName; return eff; }
public PlayerXEffect getSavedEffect() { if (this.RestoredEffect) { PlayerXEffect eff = new PlayerXEffect(); eff.Duration = this.RemainingTime; eff.IsHandler = true; eff.Var1 = this.RestoreVars[0]; eff.Var2 = this.RestoreVars[1]; eff.Var3 = this.RestoreVars[2]; eff.Var4 = this.RestoreVars[3]; eff.Var5 = this.RestoreVars[4]; eff.Var6 = this.RestoreVars[5]; eff.SpellLine = this.SpellHandler.SpellLine.KeyName; return eff; } if (m_handler != null) { PlayerXEffect eff = m_handler.GetSavedEffect(this); return eff; } return null; }