public override void OnEnter(Mobile m) { if (!Controller.InUse) return; m.Delta(MobileDelta.Noto); m.InvalidateProperties(); }
public override void OnEnter(Mobile m) { if (!Controller.InUse) return; m.SendMessage("Your mana is being regenerated faster!"); if (m is PlayerMobile) { HealManaTimer timer = new HealManaTimer( m ); PlayerTimers.Add(timer); timer.Start(); } m.Delta(MobileDelta.Noto); m.InvalidateProperties(); }
public override void OnEnter(Mobile m) { if (!Controller.InUse) return; if (m is EnergyVortex) { EnergyVortex ev = (EnergyVortex) m; Controller.EVsAndBSsAdd(ev); } else if( m is BladeSpirits ) { BladeSpirits bs = (BladeSpirits) m; Controller.EVsAndBSsAdd(bs); } m.Delta(MobileDelta.Noto); m.InvalidateProperties(); }
public void OnLokaiSkillChange(LokaiSkill lokaiSkill, double oldValue) { if (lokaiSkill == m_Highest) { m_Highest = null; } else if (m_Highest != null && lokaiSkill.BaseFixedPoint > m_Highest.BaseFixedPoint) { m_Highest = lokaiSkill; } double change = lokaiSkill.Value - oldValue; if (change != 0.0) { m_Owner.SendMessage(string.Format("Your {0} skill has changed by {1}. It is now {2}.", lokaiSkill.Name, change.ToString("F1"), lokaiSkill.Base.ToString("F1"))); } m_Owner.InvalidateProperties(); }
private static void UpdateRanking(Mobile m, XmlPoints attachment) { if(RankList == null) RankList = new ArrayList(); // flag the rank list for updating on the next attempt to retrieve a rank needsupdate = true; bool found = false; // rank the entries for(int i= 0; i<RankList.Count;i++) { RankEntry p = RankList[i] as RankEntry; // found a match if(p != null && p.Killer == m) { // update the entry with the new points value p.PointsAttachment = attachment; found = true; break; } } // a new entry so add it if(!found) { RankList.Add(new RankEntry(m, attachment)); } // if points statistics are being displayed in player name properties, then update them if(m != null) m.InvalidateProperties(); }
/// <summary> /// Remove all ill effects from a player. /// </summary> /// <param name="pm"></param> public void CleanPlayer(Mobile pm) { //Cure Poison pm.CurePoison(pm); //Reset Hit Points pm.Hits = pm.HitsMax; //Rest Mana pm.Mana = pm.ManaMax; //Reset Stam pm.Stam = pm.StamMax; //Cancel any targeting Targeting.Target.Cancel(pm); //remove abosorption for magic pm.MagicDamageAbsorb = 0; //remove absorption for melee pm.MeleeDamageAbsorb = 0; //clear protection spell Spells.Second.ProtectionSpell.Registry.Remove(pm); //clear curse effect Spells.Fourth.CurseSpell.RemoveEffect(pm); //clear corpseskin Server.Spells.Necromancy.CorpseSkinSpell.RemoveCurse(pm); //clear blodd oath Server.Spells.Necromancy.BloodOathSpell.RemoveCurse(pm); //clear evil omen //Server.Spells.Necromancy.EvilOmenSpell.RemoveCurse(pm); //remove strangle Server.Spells.Necromancy.StrangleSpell.RemoveCurse(pm); //clear Paralyzed pm.Paralyzed = false; //clear defensive spell DefensiveSpell.Nullify(pm); //remove any combatant pm.Combatant = null; //remove war mode pm.Warmode = false; //remove criminal pm.Criminal = false; //clear agressed list pm.Aggressed.Clear(); //clear agressor list pm.Aggressors.Clear(); //clear delta notoriety pm.Delta(MobileDelta.Noto); //invalidate any properties due to the previous changes pm.InvalidateProperties(); }
public void RemoveMember( Mobile mob ) { PlayerState pl = PlayerState.Find( mob ); if ( pl == null || !Members.Contains( pl ) ) return; int killPoints = pl.KillPoints; if( mob.Backpack != null ) { //Ordinarily, through normal faction removal, this will never find any sigils. //Only with a leave delay less than the ReturnPeriod or a Faction Kick/Ban, will this ever do anything Item[] sigils = mob.Backpack.FindItemsByType( typeof( Sigil ) ); for ( int i = 0; i < sigils.Length; ++i ) ((Sigil)sigils[i]).ReturnHome(); } if ( pl.RankIndex != -1 ) { while ( ( pl.RankIndex + 1 ) < ZeroRankOffset ) { PlayerState pNext = Members[pl.RankIndex+1]; Members[pl.RankIndex+1] = pl; Members[pl.RankIndex] = pNext; pl.RankIndex++; pNext.RankIndex--; } ZeroRankOffset--; } Members.Remove( pl ); if ( mob is PlayerMobile ) ((PlayerMobile)mob).FactionPlayerState = null; mob.InvalidateProperties(); mob.Delta( MobileDelta.Noto ); if ( Election.IsCandidate( mob ) ) Election.RemoveCandidate( mob ); Election.RemoveVoter( mob ); if ( pl.Finance != null ) pl.Finance.Finance = null; if ( pl.Sheriff != null ) pl.Sheriff.Sheriff = null; if ( Commander == mob ) Commander = null; if ( mob is PlayerMobile ) ((PlayerMobile)mob).ValidateEquipment(); if ( killPoints > 0 ) DistributePoints( killPoints ); }
public virtual void AddMember( Mobile mob ) { Members.Insert( ZeroRankOffset, new PlayerState( mob, this, Members ) ); mob.AddToBackpack( FactionItem.Imbue( new Robe(), this, false, Definition.HuePrimary ) ); mob.SendLocalizedMessage( 1010374 ); // You have been granted a robe which signifies your faction mob.InvalidateProperties(); mob.Delta( MobileDelta.Noto ); mob.FixedEffect( 0x373A, 10, 30 ); mob.PlaySound( 0x209 ); }
public void AddMember( Mobile mob ) { Members.Add( new PlayerState( mob, this, Members ) ); mob.AddToBackpack( FactionItem.Imbue( new Robe(), this, false, Definition.HuePrimary ) ); mob.SendLocalizedMessage( 1010374 ); // You have been granted a robe which signifies your faction mob.InvalidateProperties(); mob.Delta( MobileDelta.Noto ); var followers = World.Instance.Mobiles .OfType<BaseCreature>() .Where( bc => bc.Controlled && bc.ControlMaster == mob ); foreach ( Mobile follower in followers ) { follower.InvalidateProperties(); follower.Delta( MobileDelta.Noto ); } mob.FixedEffect( 0x373A, 10, 30 ); mob.PlaySound( 0x209 ); }
public void RemoveMember( Mobile mob ) { PlayerState pl = PlayerState.Find( mob ); if ( pl == null || !Members.Contains( pl ) ) return; Members.Remove( pl ); if ( mob is PlayerMobile ) ( (PlayerMobile) mob ).FactionPlayerState = null; mob.InvalidateProperties(); mob.Delta( MobileDelta.Noto ); // TODO: refactor this, maybe a Mobile.GetFollowers() ? var followers = World.Instance.Mobiles .OfType<BaseCreature>() .Where( bc => bc.Controlled && bc.ControlMaster == mob ); foreach ( Mobile follower in followers ) { follower.InvalidateProperties(); follower.Delta( MobileDelta.Noto ); } if ( Election.IsCandidate( mob ) ) Election.RemoveCandidate( mob ); Election.RemoveVoter( mob ); if ( pl.Finance != null ) pl.Finance.Finance = null; if ( pl.Sheriff != null ) pl.Sheriff.Sheriff = null; if ( Commander == mob ) Commander = null; if ( mob is PlayerMobile ) ( (PlayerMobile) mob ).ValidateEquipment(); }
/// <summary> /// Will remove the player from the game. /// </summary> /// <param name="m"></param> public static void LeaveGame(Mobile m) { if (!CTFGame.Running) return; CTFPlayerGameData pgd = GameData.GetPlayerData(m); if (pgd != null) { pgd.InGame = false; RemoveItems(m); SunnySystem.DisArmPlayer(m); m.Criminal = false; m.InvalidateProperties(); m.Warmode = false; m.Aggressed.Clear(); m.Aggressors.Clear(); EventSystem.RemoveToRandomLoc(m); SunnySystem.ReDress(m); m.Delta(MobileDelta.Noto); m.InvalidateProperties(); } else if (PlayerJoinList.Contains(m)) { try { PlayerJoinList.Remove(m); EventSystem.RemoveToRandomLoc(m); SunnySystem.ReDress(m); } catch {} } else EventSystem.RemoveToRandomLoc(m); }
public void AddMember( Mobile mob ) { Members.Add( new PlayerState( mob, this, Members ) ); Item item = mob.FindItemOnLayer( Layer.OuterTorso ) as Item; if( item != null ) { if ( item.Movable == false ) { mob.AddToBackpack( FactionItem.Imbue( new Robe(), this, false, Definition.HuePrimary ) ); mob.SendAsciiMessage( "You have been granted a robe which signifies your faction." ); } if ( item.Movable == true ) { mob.AddToBackpack( item ); mob.EquipItem( FactionItem.Imbue( new Robe(), this, false, Definition.HuePrimary ) ); mob.SendAsciiMessage( "You have been granted a robe which signifies your faction." ); } } else { mob.EquipItem( FactionItem.Imbue( new Robe(), this, false, Definition.HuePrimary ) ); mob.SendAsciiMessage( "You have been granted a robe which signifies your faction." ); } mob.InvalidateProperties(); mob.Delta( MobileDelta.Noto ); }
public void RemoveMember( Mobile mob ) { PlayerState pl = PlayerState.Find( mob ); if ( pl == null || !Members.Contains( pl ) ) return; Members.Remove( pl ); if ( mob is PlayerMobile ) ((PlayerMobile)mob).FactionPlayerState = null; mob.InvalidateProperties(); mob.Delta( MobileDelta.Noto ); if ( Election.IsCandidate( mob ) ) Election.RemoveCandidate( mob ); Election.RemoveVoter( mob ); if ( pl.Finance != null ) pl.Finance.Finance = null; if ( pl.Sheriff != null ) pl.Sheriff.Sheriff = null; if ( Commander == mob ) Commander = null; if ( mob is PlayerMobile ) ((PlayerMobile)mob).ValidateEquipment(); }
private void CleanPlayer(Mobile pm) { pm.CurePoison(pm); pm.Hits = pm.HitsMax; pm.Mana = pm.ManaMax; pm.Stam = pm.StamMax; Targeting.Target.Cancel(pm); pm.MagicDamageAbsorb = 0; pm.MeleeDamageAbsorb = 0; Spells.Second.ProtectionSpell.Registry.Remove(pm); Spells.Fourth.CurseSpell.RemoveEffect(pm); Server.Spells.Necromancy.CorpseSkinSpell.RemoveCurse(pm); Server.Spells.Necromancy.BloodOathSpell.RemoveCurse(pm); Server.Spells.Necromancy.StrangleSpell.RemoveCurse(pm); pm.Blessed = false; pm.Paralyzed = false; pm.Hidden = false; DefensiveSpell.Nullify(pm); pm.Combatant = null; pm.Warmode = false; pm.Criminal = false; pm.Blessed = false; pm.Aggressed.Clear(); pm.Aggressors.Clear(); pm.Delta(MobileDelta.Noto); pm.InvalidateProperties(); }
public void AddMember( Mobile mob ) { Members.Add( new PlayerState( mob, this, Members ) ); mob.AddToBackpack( FactionItem.Imbue( new Robe(), this, false, Definition.HuePrimary ) ); mob.SendLocalizedMessage( 1010374 ); // You have been granted a robe which signifies your faction mob.InvalidateProperties(); mob.Delta( MobileDelta.Noto ); }