public int ApplyStoreInfo(BlackStoreManager _this, ref List <StoneItem> info) { var storeData = _this.mDbData.BlackStoreInfo; if (null == storeData || storeData.Count == 0) { return((int)ErrorCodes.Unknow); } foreach (var data in storeData) { var item = new StoneItem(); item.itemid = data.StoreItemId; item.itemcount = data.StoreItemCount; info.Add(item); } return((int)ErrorCodes.OK); }
public void GetItemList(StoneManager _this, int type, List <StoneItem> items) { var roleType = _this.mCharacter.GetRole(); foreach (var item in _this.GroupDatas) { if (type == item.Value.tbStore.Type) { if (BitFlag.GetLow(item.Value.tbStore.SeeCharacterID, roleType) == false) { continue; } if (item.Value.tbStore.FuBenCount >= 0) { continue; } // if (item.Value.tbStore.DisplayCondition != -1) // { // var cc = _this.mCharacter.CheckCondition(item.Value.tbStore.DisplayCondition); // if (cc != -2) // { // continue; // } // } var tempItem = new StoneItem(); tempItem.itemid = item.Value.Id; tempItem.itemcount = -1; items.Add(tempItem); } //if (type == -1 || type == item.Value.tbStore.Type) //{ // items.Add(item.Value.Id); //} } List <StoreItem> tempList; if (StoneManager.StoneNoGroup.TryGetValue(type, out tempList)) { foreach (var item in tempList) { if (BitFlag.GetLow(item.tbStore.SeeCharacterID, roleType) == false) { continue; } if (item.tbStore.FuBenCount >= 0) { continue; } // if (item.tbStore.DisplayCondition != -1) // { // var cc = _this.mCharacter.CheckCondition(item.tbStore.DisplayCondition); // if (cc != -2) // { // continue; // } // } var tempItem = new StoneItem(); tempItem.itemid = item.Id; tempItem.itemcount = -1; items.Add(tempItem); } } }
private void Stone_OnTick(object state) { object[] states = (object[])state; Mobile from = (Mobile)states[0]; Point3D loc = (Point3D)states[1]; Map map = (Map)states[2]; if (from == null || from.Deleted) return; Item stoneCenter = new StoneItem(Utility.RandomList(4963, 4967, 4970, 4973)); stoneCenter.MoveToWorld(loc, map); Effects.SendLocationEffect(loc, map, 0x3728, 20); int stoneCount = 0; for (int i = -3; i <= 3; ++i) for (int j = -3; j <= 3; ++j) { if (i == 0 && j == 0) continue; if (Utility.Random(49) < 4 && stoneCount < 5) { Point3D loc1 = new Point3D(loc.X + i, loc.Y + j, loc.Z); bool canFit = SpellHelper.AdjustField(ref loc1, map, 12, false); if (canFit) { new StoneItem(Utility.RandomList(4964, 4965, 4966, 4968, 4969, 4971, 4972)).MoveToWorld(loc1, map); stoneCount++; } } } List<Mobile> list = new List<Mobile>(); foreach (Mobile m in stoneCenter.GetMobilesInRange(15)) { if (m == from || !from.CanBeHarmful(m)) continue; if (m.AccessLevel > AccessLevel.Player) continue; if (m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned || ((BaseCreature)m).Team != this.Team)) list.Add(m); if (m.Player) list.Add(m); } foreach (Mobile m in list) { m.SendMessage("The cyclops hurls a boulder, stunning you!"); m.PlaySound(0x2F3); // sound effect from earthquake spell from.DoHarmful(m); AOS.Damage(m, from, 50, 100, 0, 0, 0, 0); m.Animate(21, 6, 1, true, false, 0); Timer.DelayCall(TimeSpan.FromSeconds(0.7), new TimerStateCallback(OnGround_CallBack), m); if (m.Alive) { m.Frozen = true; m.Combatant = null; Timer.DelayCall(TimeSpan.FromSeconds(5.0), new TimerStateCallback(Recover_Callback), m); } } }
private void Stone_OnTick(object state) { object[] states = (object[])state; Mobile from = (Mobile)states[0]; Point3D loc = (Point3D)states[1]; Map map = (Map)states[2]; if (from == null || from.Deleted) { return; } Item stoneCenter = new StoneItem(Utility.RandomList(4963, 4967, 4970, 4973)); stoneCenter.MoveToWorld(loc, map); Effects.SendLocationEffect(loc, map, 0x3728, 20); int stoneCount = 0; for (int i = -3; i <= 3; ++i) { for (int j = -3; j <= 3; ++j) { if (i == 0 && j == 0) { continue; } if (Utility.Random(49) < 4 && stoneCount < 5) { Point3D loc1 = new Point3D(loc.X + i, loc.Y + j, loc.Z); bool canFit = SpellHelper.AdjustField(ref loc1, map, 12, false); if (canFit) { new StoneItem(Utility.RandomList(4964, 4965, 4966, 4968, 4969, 4971, 4972)).MoveToWorld(loc1, map); stoneCount++; } } } } List <Mobile> list = new List <Mobile>(); foreach (Mobile m in stoneCenter.GetMobilesInRange(15)) { if (m == from || !from.CanBeHarmful(m)) { continue; } if (m.AccessLevel > AccessLevel.Player) { continue; } if (m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned || ((BaseCreature)m).Team != this.Team)) { list.Add(m); } if (m.Player) { list.Add(m); } } foreach (Mobile m in list) { m.SendMessage("The cyclops hurls a boulder, stunning you!"); m.PlaySound(0x2F3); // sound effect from earthquake spell from.DoHarmful(m); AOS.Damage(m, from, 50, 100, 0, 0, 0, 0); m.Animate(21, 6, 1, true, false, 0); Timer.DelayCall(TimeSpan.FromSeconds(0.7), new TimerStateCallback(OnGround_CallBack), m); if (m.Alive) { m.Frozen = true; m.Combatant = null; Timer.DelayCall(TimeSpan.FromSeconds(5.0), new TimerStateCallback(Recover_Callback), m); } } }