public override void OnReceive(Creature creature) { creature.GiveItem(ItemEntity.CreatePattern(60800, 30005, 15)); // Part-Time Job Blacksmithing Manual - Cuirassier Helm creature.GiveItem(60424, 4); // Common Leather (Part-Time Job) creature.GiveItem(60815, 20); // Iron Ingot (Part-Time Job) creature.GiveItem(60815, 20); // Iron Ingot (Part-Time Job) }
public override void OnReceive(Creature creature) { creature.GiveItem(ItemEntity.CreatePattern(60800, 30003, 15)); // Part-Time Job Blacksmithing Manual - Round Shield creature.GiveItem(60812, 4); // Firewood (Part-Time Job) creature.GiveItem(60428, 2); // Common Leather Strap (Part-Time Job) creature.GiveItem(60815, 20); // Iron Ingot (Part-Time Job) creature.GiveItem(60815, 20); // Iron Ingot (Part-Time Job) creature.GiveItem(60815, 20); // Iron Ingot (Part-Time Job) }
public override void OnReceive(Creature creature) { creature.GiveItem(ItemEntity.CreatePattern(60800, 30011, 10)); // Part-Time Job Blacksmithing Manual - Giant Half Guard Leather Armor (F) creature.GiveItem(60426, 1); // Finest Leather (Part-Time Job) creature.GiveItem(60814, 2); // Tough String (Part-Time Job) creature.GiveItem(60815, 10); // Iron Ingot (Part-Time Job) creature.GiveItem(60424, 10); // Common Leather (Part-Time Job) creature.GiveItem(60404, 5); // Braid (Part-Time Job) creature.GiveItem(60404, 5); // Braid (Part-Time Job) }
public override void OnReceive(Creature creature) { creature.GiveItem(ItemEntity.CreatePattern(60800, 30006, 10)); // Part-Time Job Blacksmithing Manual - Arish Ashuvain Gauntlets creature.GiveItem(60411, 2); // Cheap Silk (Part-Time Job) creature.GiveItem(60815, 20); // Iron Ingot (Part-Time Job) creature.GiveItem(60815, 5); // Iron Ingot (Part-Time Job) creature.GiveItem(60428, 10); // Common Leather Strap (Part-Time Job) creature.GiveItem(60428, 10); // Common Leather Strap (Part-Time Job) creature.GiveItem(60428, 5); // Common Leather Strap (Part-Time Job) }
public override void OnReceive(Creature creature) { creature.GiveItem(ItemEntity.CreatePattern(60800, 30010, 15)); // Part-Time Job Blacksmithing Manual - Scale Armor creature.GiveItem(60420, 1); // Common Fabric (Part-Time Job) creature.GiveItem(60813, 1); // Fomor Token (Part-Time Job) creature.GiveItem(60815, 20); // Iron Ingot (Part-Time Job) creature.GiveItem(60815, 20); // Iron Ingot (Part-Time Job) creature.GiveItem(60429, 10); // Fine Leather Strap (Part-Time Job) creature.GiveItem(60429, 10); // Fine Leather Strap (Part-Time Job) creature.GiveItem(60429, 10); // Fine Leather Strap (Part-Time Job) }
public override void OnReceive(Creature creature) { creature.GiveItem(ItemEntity.CreatePattern(60800, 30009, 10)); // Part-Time Job Blacksmithing Manual - Arish Ashuvain Boots (M) creature.GiveItem(60413, 2); // Fine Silk (Part-Time Job) creature.GiveItem(60815, 20); // Iron Ingot (Part-Time Job) creature.GiveItem(60815, 20); // Iron Ingot (Part-Time Job) creature.GiveItem(60428, 10); // Common Leather Strap (Part-Time Job) creature.GiveItem(60428, 10); // Common Leather Strap (Part-Time Job) creature.GiveItem(60428, 10); // Common Leather Strap (Part-Time Job) creature.GiveItem(60428, 10); // Common Leather Strap (Part-Time Job) }
public override void OnReceive(Creature creature) { creature.GiveItem(ItemEntity.CreatePattern(60800, 30007, 20)); // Part-Time Job Blacksmithing Manual - Plate Gauntlets creature.GiveItem(60425, 2); // Fine Leather (Part-Time Job) creature.GiveItem(60406, 2); // Thick Thread Ball (Part-Time Job) creature.GiveItem(60815, 20); // Iron Ingot (Part-Time Job) creature.GiveItem(60815, 20); // Iron Ingot (Part-Time Job) creature.GiveItem(60815, 20); // Iron Ingot (Part-Time Job) creature.GiveItem(60815, 20); // Iron Ingot (Part-Time Job) creature.GiveItem(60815, 20); // Iron Ingot (Part-Time Job) }
public override void OnReceive(Creature creature) { creature.GiveItem(ItemEntity.CreatePattern(60800, 30008, 15)); // Part-Time Job Blacksmithing Manual - Vito Crux Greaves creature.GiveItem(60425, 2); // Fine Leather (Part-Time Job) creature.GiveItem(60404, 5); // Braid (Part-Time Job) creature.GiveItem(60404, 5); // Braid (Part-Time Job) creature.GiveItem(60815, 20); // Iron Ingot (Part-Time Job) creature.GiveItem(60815, 5); // Iron Ingot (Part-Time Job) creature.GiveItem(60816, 20); // Copper Ingot (Part-Time Job) creature.GiveItem(60816, 20); // Copper Ingot (Part-Time Job) creature.GiveItem(60816, 10); // Copper Ingot (Part-Time Job) }
public override void OnReceive(Creature creature) { creature.GiveItem(ItemEntity.CreatePattern(60800, 30004, 20)); // Part-Time Job Blacksmithing Manual - Evil Dying Crown creature.GiveItem(60420, 2); // Common Fabric (Part-Time Job) creature.GiveItem(60412, 2); // Common Silk (Part-Time Job) creature.GiveItem(60428, 10); // Common Leather Strap (Part-Time Job) creature.GiveItem(60428, 10); // Common Leather Strap (Part-Time Job) creature.GiveItem(60815, 20); // Iron Ingot (Part-Time Job) creature.GiveItem(60815, 20); // Iron Ingot (Part-Time Job) creature.GiveItem(60815, 20); // Iron Ingot (Part-Time Job) creature.GiveItem(60815, 20); // Iron Ingot (Part-Time Job) creature.GiveItem(60815, 10); // Iron Ingot (Part-Time Job) }
public override void OnReceive(Creature creature) { creature.GiveItem(ItemEntity.CreatePattern(60800, 30002, 10)); // Part-Time Job Blacksmithing Manual - Sickle creature.GiveItem(60812, 5); // Firewood (Part-Time Job) creature.GiveItem(60815, 10); // Iron Ingot (Part-Time Job) }
/// <summary> /// Creates new NPC and loads defaults for race. /// </summary> /// <param name="raceId"></param> public NPC(int raceId) : this() { this.RaceId = raceId; this.LoadDefault(); // Technically the following would belong in LoadDefault, // but NPCs in NPC scripts are loaded a little weird, // so we only load the following for NPCs who's race id // we get in advance. var rnd = RandomProvider.Get(); // Set some base information this.Name = this.RaceData.Name; this.Color1 = this.RaceData.Color1; this.Color2 = this.RaceData.Color2; this.Color3 = this.RaceData.Color3; this.Height = (float)(this.RaceData.SizeMin + rnd.NextDouble() * (this.RaceData.SizeMax - this.RaceData.SizeMin)); this.Life = this.LifeMaxBase = this.RaceData.Life; this.Mana = this.ManaMaxBase = this.RaceData.Mana; this.Stamina = this.StaminaMaxBase = this.RaceData.Stamina; this.State = (CreatureStates)this.RaceData.DefaultState; this.Direction = (byte)rnd.Next(256); // Set drops this.Drops.GoldMin = this.RaceData.GoldMin; this.Drops.GoldMax = this.RaceData.GoldMax; this.Drops.Add(this.RaceData.Drops); // Give skills foreach (var skill in this.RaceData.Skills) this.Skills.Add((SkillId)skill.SkillId, (SkillRank)skill.Rank, this.RaceId); // Equipment foreach (var itemData in this.RaceData.Equip) { var item = new Item(itemData.GetRandomId(rnd)); if (itemData.Color1s.Count > 0) item.Info.Color1 = itemData.GetRandomColor1(rnd); if (itemData.Color2s.Count > 0) item.Info.Color2 = itemData.GetRandomColor2(rnd); if (itemData.Color3s.Count > 0) item.Info.Color3 = itemData.GetRandomColor3(rnd); var pocket = (Pocket)itemData.Pocket; if (pocket != Pocket.None) this.Inventory.Add(item, pocket); } // Face if (this.RaceData.Face.EyeColors.Count > 0) this.EyeColor = (byte)this.RaceData.Face.GetRandomEyeColor(rnd); if (this.RaceData.Face.EyeTypes.Count > 0) this.EyeType = (short)this.RaceData.Face.GetRandomEyeType(rnd); if (this.RaceData.Face.MouthTypes.Count > 0) this.MouthType = (byte)this.RaceData.Face.GetRandomMouthType(rnd); if (this.RaceData.Face.SkinColors.Count > 0) this.SkinColor = (byte)this.RaceData.Face.GetRandomSkinColor(rnd); // Set AI if (!string.IsNullOrWhiteSpace(this.RaceData.AI) && this.RaceData.AI != "none") { this.AI = ChannelServer.Instance.ScriptManager.AiScripts.CreateAi(this.RaceData.AI, this); if (this.AI == null) Log.Warning("ScriptManager.Spawn: Missing AI '{0}' for '{1}'.", this.RaceData.AI, this.RaceId); } }
/// <summary> /// Adds item to tab. /// </summary> /// <param name="tabTitle"></param> /// <param name="itemId"></param> /// <param name="color1"></param> /// <param name="color2"></param> /// <param name="color3"></param> /// <param name="price">Uses db value if lower than 0 (default).</param> public void Add(string tabTitle, int itemId, uint color1, uint color2, uint color3, int price = -1) { var item = new Item(itemId); item.Info.Color1 = color1; item.Info.Color2 = color2; item.Info.Color3 = color3; this.Add(tabTitle, item, price); }
public static Packet AddItemInfo(this Packet packet, Item item, ItemPacketType type) { packet.PutLong(item.EntityId); packet.PutByte((byte)type); packet.PutBin(item.Info); if (type == ItemPacketType.Public) { packet.PutByte(1); packet.PutByte(0); //packet.PutByte(0); // Bitmask // if & 1 // float packet.PutByte(1); packet.PutFloat(1); // Size multiplicator *hint: Server side giant key mod* packet.PutByte(item.FirstTimeAppear); // 0: No bouncing, 1: Bouncing, 2: Delayed bouncing } else if (type == ItemPacketType.Private) { packet.PutBin(item.OptionInfo); // Ego data if (item.Data.HasTag("/ego_weapon/")) { packet.PutString(item.EgoInfo.Name); packet.PutByte((byte)item.EgoInfo.Race); packet.PutByte(0); // ? increased from 14 to 18 when I fed a bottle to a sword packet.PutByte(item.EgoInfo.SocialLevel); packet.PutInt(item.EgoInfo.SocialExp); packet.PutByte(item.EgoInfo.StrLevel); packet.PutInt(item.EgoInfo.StrExp); packet.PutByte(item.EgoInfo.IntLevel); packet.PutInt(item.EgoInfo.IntExp); packet.PutByte(item.EgoInfo.DexLevel); packet.PutInt(item.EgoInfo.DexExp); packet.PutByte(item.EgoInfo.WillLevel); packet.PutInt(item.EgoInfo.WillExp); packet.PutByte(item.EgoInfo.LuckLevel); packet.PutInt(item.EgoInfo.LuckExp); packet.PutByte(item.EgoInfo.AwakeningEnergy); packet.PutInt(item.EgoInfo.AwakeningExp); packet.PutLong(0); packet.PutLong(item.EgoInfo.LastFeeding); // Last feeding time? packet.PutInt(0); } packet.PutString(item.MetaData1.ToString()); packet.PutString(item.MetaData2.ToString()); // Upgrades? packet.PutByte(0); // Count // for upgrades // Bin : 01 00 00 00 68 21 11 00 00 00 00 00 05 00 1E 00 00 00 00 00 0A 00 00 00 D3 E4 90 65 0A 00 00 00 F0 18 9E 65 // Special upgrades? (example) //0608 [0000000000000000] Long : 0 //0609 [........00000002] Int : 2 //0610 [........00000024] Int : 36 //0611 [........00000008] Int : 8 //0612 [........00000026] Int : 38 //0613 [........00000004] Int : 4 packet.PutLong(item.QuestId); // [190100, NA200 (2015-01-15)] ? { packet.PutByte(item.IsNew); packet.PutByte(0); } } return packet; }
/// <summary> /// Adds item to trade partner's window. /// </summary> /// <param name="creature">Creature that added the item.</param> /// <param name="item">Item added.</param> public void AddItem(Creature creature, Item item) { var partner = (creature == this.Creature1 ? this.Creature2 : this.Creature1); Send.TradeItemAdded(partner, item); this.Wait(creature); }
private void OnPlayerUsesItem(Creature creature, Item item) { var skill = creature.Skills.Get(SkillId.PotionMaking); if (skill == null) return; if (skill.Info.Rank >= SkillRank.RF && skill.Info.Rank <= SkillRank.RE) { if (item.HasTag("/potion/hp/")) skill.Train(1); // Drink an HP Potion. else if (item.HasTag("/potion/mana/")) skill.Train(2); // Drink an MP Potion. else if (item.HasTag("/potion/stamina/")) skill.Train(3); // Drink a Stamina Potion. return; } if (skill.Info.Rank == SkillRank.RB) { if (item.HasTag("/potion/wound/")) skill.Train(6); // Try drinking a Wound Remedy Potion. return; } }
/// <summary> /// Adds item to tab. /// </summary> /// <param name="tabTitle"></param> /// <param name="itemId"></param> /// <param name="amount"></param> /// <param name="price">Uses db value if lower than 0 (default).</param> public void Add(string tabTitle, int itemId, int amount = 1, int price = -1) { var item = new Item(itemId); item.Amount = amount; this.Add(tabTitle, item, price); }
/// <summary> /// Adds item. /// </summary> /// <param name="item"></param> public void Add(Item item) { _items[item.EntityId] = item; }
/// <summary> /// Adds item to tab. /// </summary> /// <param name="tabTitle"></param> /// <param name="item"></param> /// <param name="price">Uses db value if lower than 0 (default).</param> public void Add(string tabTitle, Item item, int price = -1) { NpcShopTab tab; _tabs.TryGetValue(tabTitle, out tab); if (tab == null) tab = this.Add(tabTitle); if (price >= 0) { item.OptionInfo.Price = price; if (item.OptionInfo.SellingPrice > item.OptionInfo.Price) Log.Warning("NpcShop.Add: Selling price of '{0}' higher than buying price.", item.Info.Id); } tab.Add(item); }
/// <summary> /// Adds item to tab. /// </summary> /// <param name="tabTitle"></param> /// <param name="itemId"></param> /// <param name="metaData"></param> /// <param name="price">Uses db value if lower than 0 (default).</param> public void Add(string tabTitle, int itemId, string metaData, int price = -1) { var item = new Item(itemId); item.MetaData1.Parse(metaData); this.Add(tabTitle, item, price); }
/// <summary> /// Removes item from trade partner's window. /// </summary> /// <param name="creature">Creature that removed the item.</param> /// <param name="item">Item removed.</param> public void RemoveItem(Creature creature, Item item) { var partner = (creature == this.Creature1 ? this.Creature2 : this.Creature1); Send.TradeItemRemoved(partner, item.EntityId); this.Wait(creature); }
public static Packet AddItemInfo(this Packet packet, Item item, ItemPacketType type) { var isEgoWeapon = item.HasTag("/ego_weapon/"); var isGuildRobe = item.HasTag("/guild_robe/"); packet.PutLong(item.EntityId); packet.PutByte((byte)type); packet.PutBin(item.Info); if (isGuildRobe) // EBCL1:4:-16351525;EBCL2:4:-875718;EBLM1:1:46;EBLM2:1:11;EBLM3:1:4; (GLDNAM:s:European;) packet.PutString(item.MetaData1.ToString()); if (type == ItemPacketType.Public) { packet.PutByte(1); // Affects color of dropped item's name (blue or green), // indicating its value. packet.PutByte((byte)item.UpgradeEffectCount); //packet.PutByte(0); // Bitmask // if & 1 // float packet.PutByte(1); packet.PutFloat(1); // Size multiplicator *hint: Server side giant key mod* packet.PutByte(item.FirstTimeAppear); // 0: No bouncing, 1: Bouncing, 2: Delayed bouncing } else if (type == ItemPacketType.Private) { packet.PutBin(item.OptionInfo); // Ego data if (isEgoWeapon) { packet.PutString(item.EgoInfo.Name); packet.PutByte((byte)item.EgoInfo.Race); packet.PutByte(0); // ? increased from 14 to 18 when I fed a bottle to a sword packet.PutByte(item.EgoInfo.SocialLevel); packet.PutInt(item.EgoInfo.SocialExp); packet.PutByte(item.EgoInfo.StrLevel); packet.PutInt(item.EgoInfo.StrExp); packet.PutByte(item.EgoInfo.IntLevel); packet.PutInt(item.EgoInfo.IntExp); packet.PutByte(item.EgoInfo.DexLevel); packet.PutInt(item.EgoInfo.DexExp); packet.PutByte(item.EgoInfo.WillLevel); packet.PutInt(item.EgoInfo.WillExp); packet.PutByte(item.EgoInfo.LuckLevel); packet.PutInt(item.EgoInfo.LuckExp); packet.PutByte(item.EgoInfo.AwakeningEnergy); packet.PutInt(item.EgoInfo.AwakeningExp); packet.PutLong(0); packet.PutLong(item.EgoInfo.LastFeeding); // Last feeding time? packet.PutInt(0); } packet.PutString(item.MetaData1.ToString()); packet.PutString(item.MetaData2.ToString()); // Upgrades var upgradeEffects = item.GetUpgradeEffects(); packet.PutByte((byte)upgradeEffects.Length); foreach (var upgradeEffect in upgradeEffects) packet.PutBin(upgradeEffect); // Special upgrades? (example) //0608 [0000000000000000] Long : 0 //0609 [........00000002] Int : 2 //0610 [........00000024] Int : 36 //0611 [........00000008] Int : 8 //0612 [........00000026] Int : 38 //0613 [........00000004] Int : 4 packet.PutLong(item.QuestId); if (isGuildRobe) packet.PutString(item.MetaData1.GetString("GLDNAM")); // In NA235 (Sep. 2016) we found an additional integer for // Scythe that Reaps Darkness here, with no known purpose. // In NA236 we had to remove said int again. // It will be missed. //if (item.Info.Id == 41237) // packet.PutInt(0); // [190100, NA200 (2015-01-15)] ? { packet.PutByte(item.IsNew); packet.PutByte(0); } } return packet; }