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 override void OnGiveReward(PlayerMobile to, Item item, IComunityCollection collection, int hue) { if (this.Faction != null) { FactionEquipment.CheckProperties(item); FactionItem.Imbue(item, Faction, false, -1, MinRank); if (!(item is Spellbook || item is ShrineGem)) { item.LootType = LootType.Regular; } if (item is IWearableDurability) { ((IWearableDurability)item).MaxHitPoints = 255; ((IWearableDurability)item).HitPoints = 255; } if (item is IOwnerRestricted) { ((IOwnerRestricted)item).Owner = to; to.SendLocalizedMessage(1094803); // This faction reward is bound to you, and cannot be traded. } item.InvalidateProperties(); } base.OnGiveReward(to, item, collection, hue); }
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); }
public override void OnResponse(NetState sender, RelayInfo info) { if (info.ButtonID == 1) { var pack = m_Mobile.Backpack; if (pack != null && m_Item.IsChildOf(pack)) { if (pack.ConsumeTotal(typeof(Silver), m_Definition.SilverCost)) { int hue; if (m_Item is SpellScroll) { hue = 0; } else if (info.IsSwitched(1)) { hue = m_Faction.Definition.HuePrimary; } else { hue = m_Faction.Definition.HueSecondary; } FactionItem.Imbue(m_Item, m_Faction, true, hue); } else { m_Mobile.SendLocalizedMessage(1042204); // You do not have enough silver. } } } if (m_Tool?.Deleted == false && m_Tool.UsesRemaining > 0) { m_Mobile.SendGump(new CraftGump(m_Mobile, m_CraftSystem, m_Tool, m_Notice)); } else if (m_Notice != null) { if (m_Notice.Number > 0) { m_Mobile.SendLocalizedMessage(m_Notice.Number); } else { m_Mobile.SendMessage(m_Notice.String); } } }
public virtual void AddMember( Mobile mob ) { PlayerState ps = new PlayerState( mob, this, Members ); Members.Add( ps ); 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 ); OnRankUpdate( ps ); }
public override void OnResponse(NetState sender, RelayInfo info) { if (info.ButtonID == 1) { Container pack = m_Mobile.Backpack; if (pack != null && m_Item.IsChildOf(pack)) { if (pack.ConsumeTotal(typeof(Silver), m_Definition.SilverCost)) { int hue; if (m_Item is SpellScroll) { hue = 0; } else if (info.IsSwitched(1)) { hue = m_Faction.Definition.HuePrimary; } else { hue = m_Faction.Definition.HueSecondary; } FactionItem.Imbue(m_Item, m_Faction, true, hue); } else { m_Mobile.SendAsciiMessage("You do not have enough silver."); } } } if (m_Tool != null && !m_Tool.Deleted && m_Tool.UsesRemaining > 0) { m_Mobile.SendGump(new CraftGump(m_Mobile, m_CraftSystem, m_Tool, m_Notice)); } else if (m_Notice is string) { m_Mobile.SendAsciiMessage((string)m_Notice); } else if (m_Notice is int && ((int)m_Notice) > 0) { m_Mobile.SendLocalizedMessage((int)m_Notice); } }