public override bool ReceiveItem(GameLiving source, InventoryItem item) { GamePlayer t = source as GamePlayer; if (t == null || item == null) { return(false); } if (WorldMgr.GetDistance(this, t) > WorldMgr.INTERACT_DISTANCE) { t.Out.SendMessage("You are too far away to give anything to " + GetName(0, false) + ".", eChatType.CT_System, eChatLoc.CL_SystemWindow); return(false); } if (t.RealmPoints <= 513500) { t.Out.SendMessage("You must be of higher stature to be rewarded!", eChatType.CT_System, eChatLoc.CL_SystemWindow); return(false); } if ((item.Object_Type > 31 && item.Object_Type < 39) && (t.RealmPoints >= 513500)) { SendReply(t, "Alrighplayer, now select your Realm Rank, [5] [6] [7] [8] [9] [10] [11] [12] or [13]:"); } t.TempProperties.setProperty(chargeNPC_ITEM_WEAK, new WeakReference(item)); return(false); }
public override bool ReceiveItem(GameLiving source, InventoryItem item) { GamePlayer player = source as GamePlayer; if (player == null || item == null) { return(false); } bool output = false; #region messages if (player.BountyPoints < 300) { SendReply(player, "You need 300 bounty points to use my service!"); return(false); } if (WorldMgr.GetDistance(this, player) > WorldMgr.INTERACT_DISTANCE) { player.Out.SendMessage("You are too far away to give anything to " + GetName(0, false) + ".", eChatType.CT_System, eChatLoc.CL_SystemWindow); return(false); } if ((player.TempProperties.getProperty <InventoryItem>(TempProperty)) != null) { item = player.TempProperties.getProperty <InventoryItem>(TempProperty); SendReply(player, "You already gave me an item! What was it again?"); output = true; } SendReply(player, "Ok, now whisper me the model ID."); player.TempProperties.setProperty(TempProperty, item); return(true); #endregion messages }
public override bool ReceiveItem(GameLiving source, InventoryItem item) { GamePlayer player = source as GamePlayer; if (player == null || item == null) { return(false); } bool output = false; #region messages if (WorldMgr.GetDistance(this, player) > WorldMgr.INTERACT_DISTANCE) { player.Out.SendMessage("You are too far away to give anything to " + GetName(0, false) + ".", eChatType.CT_System, eChatLoc.CL_SystemWindow); return(false); } if ((player.TempProperties.getProperty <InventoryItem>(TempProperty)) != null) { item = player.TempProperties.getProperty <InventoryItem>(TempProperty); SendReply(player, "You already gave me an item! What was it again?"); output = true; } SendReply(player, "Ok, which proc do you want to remove? \n Proc [1] or Proc [2] ?"); player.TempProperties.setProperty(TempProperty, item); return(true); #endregion messages }
public override bool ReceiveItem(GameLiving source, InventoryItem item) { GamePlayer t = source as GamePlayer; if (WorldMgr.GetDistance(this, source) > WorldMgr.INTERACT_DISTANCE) { ((GamePlayer)source).Out.SendMessage("You are too far away to give anything to " + GetName(0, false) + ".", eChatType.CT_System, eChatLoc.CL_SystemWindow); return(false); } long amount = 0; if (t != null && item != null) { if (item.Id_nb == "Small_BP_Stone") { amount = 1 * item.Count; } else if (item.Id_nb == "Medium_BP_Stone") { amount = 2 * item.Count; } else if (item.Id_nb == "Large_BP_Stone") { amount = 5 * item.Count; } if (amount >= 0) { if (item.ProcSpellID != 0) { amount += 0; } if (item.ProcSpellID1 != 0) { amount += 0; } } if (amount == -1) { if (item.ProcSpellID != 0) { amount += 0; } if (item.ProcSpellID1 != 0) { amount += 0; } } if (amount >= 0) { t.TempProperties.setProperty(REFUND_ITEM_WEAK, new WeakRef(item)); t.Client.Out.SendCustomDialog("You will get " + amount * 50 + " Bountpoints for this Item!", new CustomDialogResponse(RefundDialogResponse)); } } return(base.ReceiveItem(source, item)); }
public override bool ReceiveItem(GameLiving source, InventoryItem item) { GamePlayer player = source as GamePlayer; if (player == null || item == null) { return(false); } if (WorldMgr.GetDistance(this, player) > WorldMgr.INTERACT_DISTANCE) { player.Out.SendMessage("You are too far away to give anything to " + GetName(0, false) + ".", eChatType.CT_System, eChatLoc.CL_SystemWindow); return(false); } if (!player.Champion) { player.Out.SendMessage("You must start your champion path before skipping levels!", eChatType.CT_System, eChatLoc.CL_SystemWindow); return(false); } if (player.ChampionLevel == player.ChampionMaxLevel) { player.Out.SendMessage("You have already learned all the knowledge of being a champion!", eChatType.CT_System, eChatLoc.CL_SystemWindow); return(false); } double cl1 = 32000 / ServerProperties.Properties.XP_RATE; double cl5 = 160000 / ServerProperties.Properties.XP_RATE; double cl10 = 320000 / ServerProperties.Properties.XP_RATE; if (item.Id_nb.Contains("CL1")) { player.Out.SendMessage("Thanks! Here's your reward...", eChatType.CT_System, eChatLoc.CL_SystemWindow); player.GainChampionExperience((int)cl1); player.Inventory.RemoveItem(item); return(true); } if (item.Id_nb.Contains("CL5")) { player.Out.SendMessage("Thanks! Here's your reward...", eChatType.CT_System, eChatLoc.CL_SystemWindow); player.GainChampionExperience((int)cl5); player.Inventory.RemoveItem(item); return(true); } if (item.Id_nb.Contains("CL10")) { player.Out.SendMessage("Thanks! Here's your reward...", eChatType.CT_System, eChatLoc.CL_SystemWindow); player.GainChampionExperience((int)cl10); player.Inventory.RemoveItem(item); return(true); } return(false); }
public override void TakeDamage(GameObject source, eDamageType damageType, int damageAmount, int criticalAmount) { base.TakeDamage(source, damageType, damageAmount, criticalAmount); if (ObjectState != eObjectState.Active) { return; } GameLiving t = (GameLiving)source; int range = WorldMgr.GetDistance(this, t); if (range > 500) { m_summonerTarget = t; PickAction(); } }
public override bool ReceiveItem(GameLiving source, InventoryItem item) { GamePlayer t = source as GamePlayer; if (t == null || item == null) { return(false); } if (WorldMgr.GetDistance(this, t) > WorldMgr.INTERACT_DISTANCE) { t.Out.SendMessage("You are too far away to give anything to " + GetName(0, false) + ".", eChatType.CT_System, eChatLoc.CL_SystemWindow); return(false); } if (t.BountyPoints < 300) { t.Out.SendMessage("You need more bounty points to use this service!", eChatType.CT_System, eChatLoc.CL_SystemWindow); return(false); } if (item.Object_Type > 1 && item.Object_Type < 29) //Item is a weapon { SendReply(t, "Very good, select the type of proc you would like to add:\n" + "[Direct Damage]\n" + "[Damage over Time]\n" + "[Damage Add]\n" + "[Lifetap]\n" + "[Haste]\n" + "[Str/Con Debuff]\n" + "[Dex/Quick Debuff]\n"); } else if ((item.Object_Type > 31 && item.Object_Type < 39) || item.Object_Type == 42) //Item is armor or a shield. { SendReply(t, "Very good, select the type of proc you would like to add:\n" + "[Direct Damage]\n" + "[Damage over Time]\n" + "[Damage Add]\n" + "[Lifetap]\n" + "[Haste]\n" + "[Ablative]\n" + "[Armor Factor Buff]\n" + "[Damage Shield]\n"); } t.TempProperties.setProperty(TempProperty, item); return(false); }
/// <summary> /// Called when the object is about to get an item from someone /// </summary> /// <param name="source">Source from where to get the item</param> /// <param name="templateID">templateID for item to add</param> /// <returns>true if the item was successfully received</returns> public override bool ReceiveItem(GameLiving source, InventoryItem item) { GamePlayer player = source as GamePlayer; if (player == null) { return(false); } if (WorldMgr.GetDistance(this, source) > WorldMgr.INTERACT_DISTANCE) { player.Out.SendMessage("You are too far away to give anything to " + GetName(0, false) + ".", eChatType.CT_System, eChatLoc.CL_SystemWindow); return(false); } if (AlreadyReceivedItem(player)) { return(false); } if (player != null && item != null) { long amount = ReturnAmount(item, player); if (amount > 0 && !m_items.Contains(player) && IsItemRefundable(item)) { m_items.Add(player, item); player.Inventory.RemoveItem(item); SendDialog(player); } else if (!IsItemRefundable(item)) { SayTo(player, eChatLoc.CL_PopupWindow, "This Item isn't refundable!"); } else { SayTo(player, eChatLoc.CL_PopupWindow, "Sorry I can't refund that Item!"); } } return(base.ReceiveItem(source, item)); }
public override bool Interact(GamePlayer player) { if (!base.Interact(player)) { return(false); } if (player.InCombat) { player.Out.SendMessage("Buffbot says \"stop your combat if you want me to buff you!\"", eChatType.CT_Say, eChatLoc.CL_ChatWindow); return(false); } if (WorldMgr.GetDistance(this, player) > WorldMgr.INTERACT_DISTANCE) { player.Out.SendMessage("Buffbot says \"Get over here if you want me to buff you!\"", eChatType.CT_Say, eChatLoc.CL_ChatWindow); return(false); } if (player.ChampionLevel == 10) { SendReply(player, "Do you wish to cure [Disease] or [Poison] ? or how would you like me buff you with [CL Resists]?"); } TurnTo(player, 3000); lock (m_buffs.SyncRoot) { foreach (Spell s in BaseBuffs) { if (s.SpellType == "AcuityBuff" && player.CharacterClass.ClassType != eClassType.ListCaster) { continue; } Container con = new Container(s, BotBaseSpellLine, player); m_buffs.Enqueue(con); } foreach (Spell s in SpecBuffs) { Container con = new Container(s, BotSpecSpellLine, player); m_buffs.Enqueue(con); } foreach (Spell s in OtherBuffs) { if (s.SpellType == "PowerRegenBuff" && player.MaxMana == 0) { continue; } Container con = new Container(s, BotOtherSpellLine, player); m_buffs.Enqueue(con); } //if the player has sickness it will be removed. GameSpellEffect effect = SpellHandler.FindEffectOnTarget(player, "PveResurrectionIllness"); if (effect != null) { effect.Cancel(false); player.Out.SendMessage(GetName(0, false) + " cure your resurrection sickness.", eChatType.CT_System, eChatLoc.CL_SystemWindow); } } if (CurrentSpellHandler == null) { CastBuffs(); } return(true); }
public override bool ReceiveItem(GameLiving source, InventoryItem item) { GamePlayer t = source as GamePlayer; if (t == null || item == null) { return(false); } if (WorldMgr.GetDistance(this, t) > WorldMgr.INTERACT_DISTANCE) { t.Out.SendMessage("You are too far away to give anything to " + GetName(0, false) + ".", eChatType.CT_System, eChatLoc.CL_SystemWindow); return(false); } if (t.BountyPoints < 500) { t.Out.SendMessage("You need more bounty points to use this service!", eChatType.CT_System, eChatLoc.CL_SystemWindow); return(false); } if (item.ProcSpellID1 != 0 || item.SpellID1 != 0) { TurnTo(t, 5000); Emote(eEmote.Rofl); SendReply(t, "You already have a bonus of that type on this armor!"); return(false); } if (item.Object_Type > 1 && item.Object_Type < 29) //Item is a weapon { //Sigil, Rune, Bespelled, Enchanted, Enticing, Embroidered, Ensorcelled, Ornamented, Blazed, Decorated, Spell Marked, Spell Etched, Spell Riddled, Etched, Ensorcelled { SendReply(t, "Very good, would you like a Proc or a Charge?:\n" + "Proc List\n" + "[Proc - Direct Damage]\n" + "[Proc - Damage over Time]\n" + "[Proc - Damage Add]\n" + "[Proc - Lifetap]\n" + "[Proc - Nearsight]\n" + // galatea 30138 "[Proc - Snare]\n" + // galatea 30135 "[Proc - Haste]\n" + "[Proc - Str/Con Debuff]\n" + "[Proc - Dex/Quick Debuff]\n" + "NEW - [ML10 Pet Proc Illusion] - Costs 100k BP\n" + "Charge List\n" + "[Charge - Direct Damage]\n" + "[Charge - Damage over Time]\n" + "[Charge - Damage Add]\n" + "[Charge - Lifetap]\n" + "[Charge - Haste]\n" + "[Charge - Str/Con Debuff]\n" + "[Charge - Dex/Quick Debuff]\n\n"); t.TempProperties.setProperty(TempProperty, item); return(true); } } if ((item.Object_Type > 31 && item.Object_Type < 39) || item.Object_Type == 42) //Item is armor or a shield. { SendReply(t, "Very good, would you like a Proc or a Charge?:\n" + "Proc List\n" + "[Proc - Direct Damage]\n" + "[Proc - Damage over Time]\n" + "[Proc - Damage Add]\n" + "[Proc - Lifetap]\n" + "[Proc - Nearsight]\n" + // galatea 30138 "[Proc - Snare]\n" + // galatea 30135 "[Proc - Haste]\n" + "[Proc - Str/Con Debuff]\n" + "[Proc - Dex/Quick Debuff]\n" + "[Proc - Omni-Drain]\n\n" + "Charge List\n" + "[Charge - Direct Damage]\n" + "[Charge - Damage over Time]\n" + "[Charge - Damage Add]\n" + "[Charge - Lifetap]\n" + "[Charge - Haste]\n" + "[Charge - Str/Con Debuff]\n" + "[Charge - Dex/Quick Debuff]\n\n"); t.TempProperties.setProperty(TempProperty, item); return(true); } if (item.Object_Type > 39) { SendReply(t, "Sorry, I only accept Armorcrafter NPC stuff!"); } t.TempProperties.setProperty(TempProperty, item); return(false); }
public override bool ReceiveItem(GameLiving source, InventoryItem item) { GamePlayer t = source as GamePlayer; if (WorldMgr.GetDistance(this, source) > WorldMgr.INTERACT_DISTANCE) { ((GamePlayer)source).Out.SendMessage("You are too far away to give anything to " + GetName(0, false) + ".", eChatType.CT_System, eChatLoc.CL_SystemWindow); return(false); } if (t.MLLevel == 0) { t.Out.SendMessage("You have not completed any MLs and therefore cannot respec them!", eChatType.CT_Say, eChatLoc.CL_PopupWindow); return(false); } if (t != null && item != null && item.Id_nb == "mlrespectoken") { if (t.CharacterClass.ID == 1)//Paladin { mlchoicea = (byte)eMLLine.Warlord; mlchoiceb = (byte)eMLLine.BattleMaster; } else if (t.CharacterClass.ID == 2)//Armsman { mlchoicea = (byte)eMLLine.Warlord; mlchoiceb = (byte)eMLLine.BattleMaster; } else if (t.CharacterClass.ID == 3)//Scout { mlchoicea = (byte)eMLLine.BattleMaster; mlchoiceb = (byte)eMLLine.Sojourner; } else if (t.CharacterClass.ID == 4)//Minstrel { mlchoicea = (byte)eMLLine.Warlord; mlchoiceb = (byte)eMLLine.Sojourner; } else if (t.CharacterClass.ID == 5)//Theurgist { mlchoicea = (byte)eMLLine.Convoker; mlchoiceb = (byte)eMLLine.Stormlord; } else if (t.CharacterClass.ID == 6)//Cleric { mlchoicea = (byte)eMLLine.Warlord; mlchoiceb = (byte)eMLLine.Perfecter; } else if (t.CharacterClass.ID == 7)//Wizard { mlchoicea = (byte)eMLLine.Convoker; mlchoiceb = (byte)eMLLine.Stormlord; } else if (t.CharacterClass.ID == 8)//Sorcerer { mlchoicea = (byte)eMLLine.Convoker; mlchoiceb = (byte)eMLLine.Stormlord; } else if (t.CharacterClass.ID == 9)//Infiltrator { mlchoicea = (byte)eMLLine.Spymaster; mlchoiceb = (byte)eMLLine.BattleMaster; } else if (t.CharacterClass.ID == 10)//Frair { mlchoicea = (byte)eMLLine.BattleMaster; mlchoiceb = (byte)eMLLine.Perfecter; } else if (t.CharacterClass.ID == 11)//Mercenary { mlchoicea = (byte)eMLLine.BattleMaster; mlchoiceb = (byte)eMLLine.Banelord; } else if (t.CharacterClass.ID == 12)//Necromancer { mlchoicea = (byte)eMLLine.Convoker; mlchoiceb = (byte)eMLLine.Stormlord; } else if (t.CharacterClass.ID == 13)//Cabalist { mlchoicea = (byte)eMLLine.Convoker; mlchoiceb = (byte)eMLLine.BattleMaster; } else if (t.CharacterClass.ID == 19)//Reaver { mlchoicea = (byte)eMLLine.BattleMaster; mlchoiceb = (byte)eMLLine.Banelord; } else if (t.CharacterClass.ID == 21)//Thane { mlchoicea = (byte)eMLLine.BattleMaster; mlchoiceb = (byte)eMLLine.Stormlord; } else if (t.CharacterClass.ID == 22)//Warrior { mlchoicea = (byte)eMLLine.Warlord; mlchoiceb = (byte)eMLLine.BattleMaster; } else if (t.CharacterClass.ID == 23)//Shadowblade { mlchoicea = (byte)eMLLine.Spymaster; mlchoiceb = (byte)eMLLine.BattleMaster; } else if (t.CharacterClass.ID == 24)//Skald { mlchoicea = (byte)eMLLine.Warlord; mlchoiceb = (byte)eMLLine.Sojourner; } else if (t.CharacterClass.ID == 25)//Hunter { mlchoicea = (byte)eMLLine.Sojourner; mlchoiceb = (byte)eMLLine.BattleMaster; } else if (t.CharacterClass.ID == 26)//Healer { mlchoicea = (byte)eMLLine.Sojourner; mlchoiceb = (byte)eMLLine.Perfecter; } else if (t.CharacterClass.ID == 27)//Spiritmaster { mlchoicea = (byte)eMLLine.Convoker; mlchoiceb = (byte)eMLLine.Stormlord; } else if (t.CharacterClass.ID == 28)//Shaman { mlchoicea = (byte)eMLLine.Convoker; mlchoiceb = (byte)eMLLine.Perfecter; } else if (t.CharacterClass.ID == 29)//Runemaster { mlchoicea = (byte)eMLLine.Convoker; mlchoiceb = (byte)eMLLine.Stormlord; } else if (t.CharacterClass.ID == 30)//Bonedancer { mlchoicea = (byte)eMLLine.Convoker; mlchoiceb = (byte)eMLLine.Banelord; } else if (t.CharacterClass.ID == 31)//Berserker { mlchoicea = (byte)eMLLine.BattleMaster; mlchoiceb = (byte)eMLLine.Banelord; } else if (t.CharacterClass.ID == 32)//Savage { mlchoicea = (byte)eMLLine.Warlord; mlchoiceb = (byte)eMLLine.BattleMaster; } else if (t.CharacterClass.ID == 33)//Heretic { mlchoicea = (byte)eMLLine.Banelord; mlchoiceb = (byte)eMLLine.Perfecter; } else if (t.CharacterClass.ID == 34)//Valkyrie { mlchoicea = (byte)eMLLine.Stormlord; mlchoiceb = (byte)eMLLine.Warlord; } else if (t.CharacterClass.ID == 39)//Bainshee { mlchoicea = (byte)eMLLine.Convoker; mlchoiceb = (byte)eMLLine.Stormlord; } else if (t.CharacterClass.ID == 40)//Eldritch { mlchoicea = (byte)eMLLine.Convoker; mlchoiceb = (byte)eMLLine.Stormlord; } else if (t.CharacterClass.ID == 41)//Enchanter { mlchoicea = (byte)eMLLine.Convoker; mlchoiceb = (byte)eMLLine.Stormlord; } else if (t.CharacterClass.ID == 42)//Mentalist { mlchoicea = (byte)eMLLine.Stormlord; mlchoiceb = (byte)eMLLine.Warlord; } else if (t.CharacterClass.ID == 43)//Blademaster { mlchoicea = (byte)eMLLine.BattleMaster; mlchoiceb = (byte)eMLLine.Banelord; } else if (t.CharacterClass.ID == 44)//Hero { mlchoicea = (byte)eMLLine.BattleMaster; mlchoiceb = (byte)eMLLine.Warlord; } else if (t.CharacterClass.ID == 45)//Champion { mlchoicea = (byte)eMLLine.BattleMaster; mlchoiceb = (byte)eMLLine.Banelord; } else if (t.CharacterClass.ID == 46)//Warden { mlchoicea = (byte)eMLLine.BattleMaster; mlchoiceb = (byte)eMLLine.Perfecter; } else if (t.CharacterClass.ID == 47)//Druid { mlchoicea = (byte)eMLLine.Convoker; mlchoiceb = (byte)eMLLine.Perfecter; } else if (t.CharacterClass.ID == 48)//Bard { mlchoicea = (byte)eMLLine.Sojourner; mlchoiceb = (byte)eMLLine.Perfecter; } else if (t.CharacterClass.ID == 49)//Nightshade { mlchoicea = (byte)eMLLine.Spymaster; mlchoiceb = (byte)eMLLine.Stormlord; } else if (t.CharacterClass.ID == 50)//Ranger { mlchoicea = (byte)eMLLine.BattleMaster; mlchoiceb = (byte)eMLLine.Sojourner; } else if (t.CharacterClass.ID == 55)//Animist { mlchoicea = (byte)eMLLine.Convoker; mlchoiceb = (byte)eMLLine.Stormlord; } else if (t.CharacterClass.ID == 56)//Valewalker { mlchoicea = (byte)eMLLine.BattleMaster; mlchoiceb = (byte)eMLLine.Stormlord; } else if (t.CharacterClass.ID == 58)//Vampiir { mlchoicea = (byte)eMLLine.Banelord; mlchoiceb = (byte)eMLLine.Warlord; } else if (t.CharacterClass.ID == 59)//Warlock { mlchoicea = (byte)eMLLine.Banelord; mlchoiceb = (byte)eMLLine.Convoker; } int i = 0; switch (t.MLLevel) { case (byte)eMLLine.Banelord: for (i = 1; i < t.MLLevel + 1; i++) { t.RemoveSpellLine("ML" + i + " Banelord"); } break; case (byte)eMLLine.BattleMaster: for (i = 1; i < t.MLLevel + 1; i++) { t.RemoveSpellLine("ML" + i + " Battlemaster"); } break; case (byte)eMLLine.Convoker: for (i = 1; i < t.MLLevel + 1; i++) { t.RemoveSpellLine("ML" + i + " Convoker"); } break; case (byte)eMLLine.Perfecter: for (i = 1; i < t.MLLevel + 1; i++) { t.RemoveSpellLine("ML" + i + " Perfecter"); } break; case (byte)eMLLine.Sojourner: for (i = 1; i < t.MLLevel + 1; i++) { t.RemoveSpellLine("ML" + i + " Sojourner"); } break; case (byte)eMLLine.Stormlord: for (i = 1; i < t.MLLevel + 1; i++) { t.RemoveSpellLine("ML" + i + " Stormlord"); } break; case (byte)eMLLine.Spymaster: for (i = 1; i < t.MLLevel + 1; i++) { t.RemoveSpellLine("ML" + i + " Spymaster"); } break; case (byte)eMLLine.Warlord: for (i = 1; i < t.MLLevel + 1; i++) { t.RemoveSpellLine("ML" + i + " Warlord"); } break; default: break; } if (t.MLLevel == mlchoicea) { mlfinish = mlchoiceb; } else { mlfinish = mlchoicea; } switch (mlfinish) { case (byte)eMLLine.Banelord: for (i = 1; i < t.MLLevel + 1; i++) { t.AddSpellLine(SkillBase.GetSpellLine("ML" + i + " Banelord")); } t.MLLevel = (byte)eMLLine.Banelord; t.Inventory.RemoveItem(item); t.UpdateSpellLineLevels(true); t.Out.SendUpdatePlayerSkills(); t.Out.SendUpdatePlayer(); t.UpdatePlayerStatus(); t.SaveIntoDatabase(); break; case (byte)eMLLine.BattleMaster: for (i = 1; i < t.MLLevel + 1; i++) { t.AddSpellLine(SkillBase.GetSpellLine("ML" + i + " Battlemaster")); } t.MLLevel = (byte)eMLLine.BattleMaster; t.Inventory.RemoveItem(item); t.UpdateSpellLineLevels(true); t.Out.SendUpdatePlayerSkills(); t.Out.SendUpdatePlayer(); t.UpdatePlayerStatus(); t.SaveIntoDatabase(); break; case (byte)eMLLine.Convoker: for (i = 1; i < t.MLLevel + 1; i++) { t.AddSpellLine(SkillBase.GetSpellLine("ML" + i + " Convoker")); } t.MLLevel = (byte)eMLLine.Convoker; t.Inventory.RemoveItem(item); t.UpdateSpellLineLevels(true); t.Out.SendUpdatePlayerSkills(); t.Out.SendUpdatePlayer(); t.UpdatePlayerStatus(); t.SaveIntoDatabase(); break; case (byte)eMLLine.Perfecter: for (i = 1; i < t.MLLevel + 1; i++) { t.AddSpellLine(SkillBase.GetSpellLine("ML" + i + " Perfecter")); } t.MLLevel = (byte)eMLLine.Perfecter; t.Inventory.RemoveItem(item); t.UpdateSpellLineLevels(true); t.Out.SendUpdatePlayerSkills(); t.Out.SendUpdatePlayer(); t.UpdatePlayerStatus(); t.SaveIntoDatabase(); break; case (byte)eMLLine.Sojourner: for (i = 1; i < t.MLLevel + 1; i++) { t.AddSpellLine(SkillBase.GetSpellLine("ML" + i + " Sojourner")); } t.MLLevel = (byte)eMLLine.Sojourner; t.Inventory.RemoveItem(item); t.UpdateSpellLineLevels(true); t.Out.SendUpdatePlayerSkills(); t.Out.SendUpdatePlayer(); t.UpdatePlayerStatus(); t.SaveIntoDatabase(); break; case (byte)eMLLine.Stormlord: for (i = 1; i < t.MLLevel + 1; i++) { t.AddSpellLine(SkillBase.GetSpellLine("ML" + i + " Stormlord")); } t.MLLevel = (byte)eMLLine.Stormlord; t.Inventory.RemoveItem(item); t.UpdateSpellLineLevels(true); t.Out.SendUpdatePlayerSkills(); t.Out.SendUpdatePlayer(); t.UpdatePlayerStatus(); t.SaveIntoDatabase(); break; case (byte)eMLLine.Spymaster: for (i = 1; i < t.MLLevel + 1; i++) { t.AddSpellLine(SkillBase.GetSpellLine("ML" + i + " Spymaster")); } t.MLLevel = (byte)eMLLine.Spymaster; t.Inventory.RemoveItem(item); t.UpdateSpellLineLevels(true); t.Out.SendUpdatePlayerSkills(); t.Out.SendUpdatePlayer(); t.UpdatePlayerStatus(); t.SaveIntoDatabase(); break; case (byte)eMLLine.Warlord: for (i = 1; i < t.MLLevel + 1; i++) { t.AddSpellLine(SkillBase.GetSpellLine("ML" + i + " Warlord")); } t.MLLevel = (byte)eMLLine.Warlord; t.Inventory.RemoveItem(item); t.UpdateSpellLineLevels(true); t.Out.SendUpdatePlayerSkills(); t.Out.SendUpdatePlayer(); t.UpdatePlayerStatus(); t.SaveIntoDatabase(); break; default: break; } t.Out.SendPlayerQuit(false); t.Quit(true); t.SaveIntoDatabase(); } return(base.ReceiveItem(source, item)); }
public override bool ReceiveItem(GameLiving source, InventoryItem item) { GamePlayer t = source as GamePlayer; if (WorldMgr.GetDistance(this, source) > WorldMgr.INTERACT_DISTANCE) { ((GamePlayer)source).Out.SendMessage("You are too far away to give anything to " + GetName(0, false) + ".", eChatType.CT_System, eChatLoc.CL_SystemWindow); return(false); } if (t != null && item != null) { if ((item.Id_nb == "bptoken500")) { t.Out.SendMessage("Excellent, you've found a token!\n" + "Here, please take your reward!", eChatType.CT_Say, eChatLoc.CL_PopupWindow); t.GainBountyPoints(500, false); t.Inventory.RemoveItem(item); t.UpdateSpellLineLevels(true); t.Out.SendUpdatePlayerSkills(); t.Out.SendUpdatePlayer(); t.UpdatePlayerStatus(); t.SaveIntoDatabase(); } if ((item.Id_nb == "bptoken1000")) { t.Out.SendMessage("Excellent, you've found a token!\n" + "Here, please take your reward!", eChatType.CT_Say, eChatLoc.CL_PopupWindow); t.GainBountyPoints(1000, false); t.Inventory.RemoveItem(item); t.UpdateSpellLineLevels(true); t.Out.SendUpdatePlayerSkills(); t.Out.SendUpdatePlayer(); t.UpdatePlayerStatus(); t.SaveIntoDatabase(); } if ((item.Id_nb == "bptoken5000")) { t.Out.SendMessage("Excellent, you've found a token!\n" + "Here, please take your reward!", eChatType.CT_Say, eChatLoc.CL_PopupWindow); t.GainBountyPoints(5000, false); t.Inventory.RemoveItem(item); t.UpdateSpellLineLevels(true); t.Out.SendUpdatePlayerSkills(); t.Out.SendUpdatePlayer(); t.UpdatePlayerStatus(); t.SaveIntoDatabase(); } if ((item.Id_nb == "bptoken10000")) { t.Out.SendMessage("Excellent, you've found a token!\n" + "Here, please take your reward!", eChatType.CT_Say, eChatLoc.CL_PopupWindow); t.GainBountyPoints(10000, false); t.Inventory.RemoveItem(item); t.UpdateSpellLineLevels(true); t.Out.SendUpdatePlayerSkills(); t.Out.SendUpdatePlayer(); t.UpdatePlayerStatus(); t.SaveIntoDatabase(); } if ((item.Id_nb == "bptoken50000")) { t.Out.SendMessage("Excellent, you've found a token!\n" + "Here, please take your reward!", eChatType.CT_Say, eChatLoc.CL_PopupWindow); t.GainBountyPoints(50000, false); t.Inventory.RemoveItem(item); t.UpdateSpellLineLevels(true); t.Out.SendUpdatePlayerSkills(); t.Out.SendUpdatePlayer(); t.UpdatePlayerStatus(); t.SaveIntoDatabase(); } if ((item.Id_nb == "bptoken100000")) { t.Out.SendMessage("Excellent, you've found a token!\n" + "Here, please take your reward!", eChatType.CT_Say, eChatLoc.CL_PopupWindow); t.GainBountyPoints(100000, false); t.Inventory.RemoveItem(item); t.UpdateSpellLineLevels(true); t.Out.SendUpdatePlayerSkills(); t.Out.SendUpdatePlayer(); t.UpdatePlayerStatus(); t.SaveIntoDatabase(); } if ((item.Id_nb == "bptoken500000")) { t.Out.SendMessage("Excellent, you've found a token!\n" + "Here, please take your reward!", eChatType.CT_Say, eChatLoc.CL_PopupWindow); t.GainBountyPoints(500000, false); t.Inventory.RemoveItem(item); t.UpdateSpellLineLevels(true); t.Out.SendUpdatePlayerSkills(); t.Out.SendUpdatePlayer(); t.UpdatePlayerStatus(); t.SaveIntoDatabase(); } if ((item.Id_nb == "bptoken1000000")) { t.Out.SendMessage("Excellent, you've found a token!\n" + "Here, please take your reward!", eChatType.CT_Say, eChatLoc.CL_PopupWindow); t.GainBountyPoints(1000000, false); t.Inventory.RemoveItem(item); t.UpdateSpellLineLevels(true); t.Out.SendUpdatePlayerSkills(); t.Out.SendUpdatePlayer(); t.UpdatePlayerStatus(); t.SaveIntoDatabase(); } if ((item.Id_nb == "bptoken2000000")) { t.Out.SendMessage("Excellent, you've found a token!\n" + "Here, please take your reward!", eChatType.CT_Say, eChatLoc.CL_PopupWindow); t.GainBountyPoints(2000000, false); t.Inventory.RemoveItem(item); t.UpdateSpellLineLevels(true); t.Out.SendUpdatePlayerSkills(); t.Out.SendUpdatePlayer(); t.UpdatePlayerStatus(); t.SaveIntoDatabase(); } if ((item.Id_nb == "bptoken5000000")) { t.Out.SendMessage("Excellent, you've found a token!\n" + "Here, please take your reward!", eChatType.CT_Say, eChatLoc.CL_PopupWindow); t.GainBountyPoints(5000000, false); t.Inventory.RemoveItem(item); t.UpdateSpellLineLevels(true); t.Out.SendUpdatePlayerSkills(); t.Out.SendUpdatePlayer(); t.UpdatePlayerStatus(); t.SaveIntoDatabase(); } if ((item.Id_nb == "rptoken500")) { t.Out.SendMessage("Excellent, you've found a token!\n" + "Here, please take your reward!", eChatType.CT_Say, eChatLoc.CL_PopupWindow); t.GainRealmPoints(500, false); t.Inventory.RemoveItem(item); t.UpdateSpellLineLevels(true); t.Out.SendUpdatePlayerSkills(); t.Out.SendUpdatePlayer(); t.UpdatePlayerStatus(); t.SaveIntoDatabase(); } if ((item.Id_nb == "rptoken1000")) { t.Out.SendMessage("Excellent, you've found a token!\n" + "Here, please take your reward!", eChatType.CT_Say, eChatLoc.CL_PopupWindow); t.GainRealmPoints(1000, false); t.Inventory.RemoveItem(item); t.UpdateSpellLineLevels(true); t.Out.SendUpdatePlayerSkills(); t.Out.SendUpdatePlayer(); t.UpdatePlayerStatus(); t.SaveIntoDatabase(); } if ((item.Id_nb == "rptoken5000")) { t.Out.SendMessage("Excellent, you've found a token!\n" + "Here, please take your reward!", eChatType.CT_Say, eChatLoc.CL_PopupWindow); t.GainRealmPoints(5000, false); t.Inventory.RemoveItem(item); t.UpdateSpellLineLevels(true); t.Out.SendUpdatePlayerSkills(); t.Out.SendUpdatePlayer(); t.UpdatePlayerStatus(); t.SaveIntoDatabase(); } if ((item.Id_nb == "rptoken10000")) { t.Out.SendMessage("Excellent, you've found a token!\n" + "Here, please take your reward!", eChatType.CT_Say, eChatLoc.CL_PopupWindow); t.GainRealmPoints(10000, false); t.Inventory.RemoveItem(item); t.UpdateSpellLineLevels(true); t.Out.SendUpdatePlayerSkills(); t.Out.SendUpdatePlayer(); t.UpdatePlayerStatus(); t.SaveIntoDatabase(); } if ((item.Id_nb == "rptoken50000")) { t.Out.SendMessage("Excellent, you've found a token!\n" + "Here, please take your reward!", eChatType.CT_Say, eChatLoc.CL_PopupWindow); t.GainRealmPoints(50000, false); t.Inventory.RemoveItem(item); t.UpdateSpellLineLevels(true); t.Out.SendUpdatePlayerSkills(); t.Out.SendUpdatePlayer(); t.UpdatePlayerStatus(); t.SaveIntoDatabase(); } if ((item.Id_nb == "rptoken100000")) { t.Out.SendMessage("Excellent, you've found a token!\n" + "Here, please take your reward!", eChatType.CT_Say, eChatLoc.CL_PopupWindow); t.GainRealmPoints(100000, false); t.Inventory.RemoveItem(item); t.UpdateSpellLineLevels(true); t.Out.SendUpdatePlayerSkills(); t.Out.SendUpdatePlayer(); t.UpdatePlayerStatus(); t.SaveIntoDatabase(); } if ((item.Id_nb == "rptoken500000")) { t.Out.SendMessage("Excellent, you've found a token!\n" + "Here, please take your reward!", eChatType.CT_Say, eChatLoc.CL_PopupWindow); t.GainRealmPoints(500000, false); t.Inventory.RemoveItem(item); t.UpdateSpellLineLevels(true); t.Out.SendUpdatePlayerSkills(); t.Out.SendUpdatePlayer(); t.UpdatePlayerStatus(); t.SaveIntoDatabase(); } if ((item.Id_nb == "rptoken1000000")) { t.Out.SendMessage("Excellent, you've found a token!\n" + "Here, please take your reward!", eChatType.CT_Say, eChatLoc.CL_PopupWindow); t.GainRealmPoints(1000000, false); t.Inventory.RemoveItem(item); t.UpdateSpellLineLevels(true); t.Out.SendUpdatePlayerSkills(); t.Out.SendUpdatePlayer(); t.UpdatePlayerStatus(); t.SaveIntoDatabase(); } if ((item.Id_nb == "rptoken2000000")) { t.Out.SendMessage("Excellent, you've found a token!\n" + "Here, please take your reward!", eChatType.CT_Say, eChatLoc.CL_PopupWindow); t.GainRealmPoints(2000000, false); t.Inventory.RemoveItem(item); t.UpdateSpellLineLevels(true); t.Out.SendUpdatePlayerSkills(); t.Out.SendUpdatePlayer(); t.UpdatePlayerStatus(); t.SaveIntoDatabase(); } if ((item.Id_nb == "rptoken5000000")) { t.Out.SendMessage("Excellent, you've found a token!\n" + "Here, please take your reward!", eChatType.CT_Say, eChatLoc.CL_PopupWindow); t.GainRealmPoints(5000000, false); t.Inventory.RemoveItem(item); t.UpdateSpellLineLevels(true); t.Out.SendUpdatePlayerSkills(); t.Out.SendUpdatePlayer(); t.UpdatePlayerStatus(); t.SaveIntoDatabase(); } } return(base.ReceiveItem(source, item)); }
public override bool ReceiveItem(GameLiving source, InventoryItem item) { GamePlayer player = (GamePlayer)source; GamePlayer t = source as GamePlayer; if (WorldMgr.GetDistance(this, source) > WorldMgr.INTERACT_DISTANCE) { ((GamePlayer)source).Out.SendMessage("You are too far away to give anything to " + GetName(0, false) + ".", eChatType.CT_System, eChatLoc.CL_SystemWindow); return(false); } if (t != null && item != null) { if (item.Id_nb == "prizetoken1") { t.GainRealmPoints(12000); t.Inventory.RemoveItem(item); t.UpdatePlayerStatus(); t.Out.SendMessage("Congratulations you won Realm Points!", eChatType.CT_System, eChatLoc.CL_SystemWindow); } else if (item.Id_nb == "prizetoken2") { t.GainBountyPoints(600); t.Inventory.RemoveItem(item); t.UpdatePlayerStatus(); t.Out.SendMessage("Congratulations you won Bounty Points!", eChatType.CT_System, eChatLoc.CL_SystemWindow); } else if (item.Id_nb == "prizetoken3") { t.GainChampionExperience(10000000000); t.Inventory.RemoveItem(item); t.UpdatePlayerStatus(); t.Out.SendMessage("Congratulations you won Champion Experience!", eChatType.CT_System, eChatLoc.CL_SystemWindow); } else if (item.Id_nb == "prizetoken4") { InventoryItem generic0 = new InventoryItem(); ItemTemplate tgeneric0 = (ItemTemplate)GameServer.Database.FindObjectByKey(typeof(ItemTemplate), "DragonslayerWizardStaff"); generic0.CopyFrom(tgeneric0); t.Inventory.AddItem(eInventorySlot.FirstEmptyBackpack, generic0); t.Inventory.RemoveItem(item); t.UpdatePlayerStatus(); t.Out.SendMessage("Congratulations!", eChatType.CT_System, eChatLoc.CL_SystemWindow); } else if (item.Id_nb == "prizetoken5") { InventoryItem generic0 = new InventoryItem(); ItemTemplate tgeneric0 = (ItemTemplate)GameServer.Database.FindObjectByKey(typeof(ItemTemplate), "DragonslayerWizardStaff"); generic0.CopyFrom(tgeneric0); t.Inventory.AddItem(eInventorySlot.FirstEmptyBackpack, generic0); t.Inventory.RemoveItem(item); t.UpdatePlayerStatus(); t.Out.SendMessage("Congratulations!", eChatType.CT_System, eChatLoc.CL_SystemWindow); } else if (item.Id_nb == "prizetoken6") { InventoryItem generic0 = new InventoryItem(); ItemTemplate tgeneric0 = (ItemTemplate)GameServer.Database.FindObjectByKey(typeof(ItemTemplate), "DragonslayerWizardStaff"); generic0.CopyFrom(tgeneric0); t.Inventory.AddItem(eInventorySlot.FirstEmptyBackpack, generic0); t.Inventory.RemoveItem(item); t.UpdatePlayerStatus(); t.Out.SendMessage("Congratulations!", eChatType.CT_System, eChatLoc.CL_SystemWindow); } else if (item.Id_nb == "prizetoken7") { InventoryItem generic0 = new InventoryItem(); ItemTemplate tgeneric0 = (ItemTemplate)GameServer.Database.FindObjectByKey(typeof(ItemTemplate), "DragonslayerWizardStaff"); generic0.CopyFrom(tgeneric0); t.Inventory.AddItem(eInventorySlot.FirstEmptyBackpack, generic0); t.Inventory.RemoveItem(item); t.UpdatePlayerStatus(); t.Out.SendMessage("Congratulations!", eChatType.CT_System, eChatLoc.CL_SystemWindow); } else if (item.Id_nb == "prizetoken8") { InventoryItem generic0 = new InventoryItem(); ItemTemplate tgeneric0 = (ItemTemplate)GameServer.Database.FindObjectByKey(typeof(ItemTemplate), "DragonslayerWizardStaff"); generic0.CopyFrom(tgeneric0); t.Inventory.AddItem(eInventorySlot.FirstEmptyBackpack, generic0); t.Inventory.RemoveItem(item); t.UpdatePlayerStatus(); t.Out.SendMessage("Congratulations!", eChatType.CT_System, eChatLoc.CL_SystemWindow); } { t.TempProperties.setProperty(REFUND_ITEM_WEAK, new WeakRef(item)); } } return(base.ReceiveItem(source, item)); }
public override bool ReceiveItem(GameLiving source, InventoryItem item) { GamePlayer t = source as GamePlayer; if (WorldMgr.GetDistance(this, source) > WorldMgr.INTERACT_DISTANCE) { ((GamePlayer)source).Out.SendMessage("You are too far away to give anything to " + GetName(0, false) + ".", eChatType.CT_System, eChatLoc.CL_SystemWindow); return(false); } if (t != null && item != null) { if (item.Id_nb == "mlrespectoken") { t.Out.SendMessage("Excellent, you have Respec Token.\n" + "Here, please take your Tokens!", eChatType.CT_Say, eChatLoc.CL_PopupWindow); t.RemoveSpellLine("ML1 Battlemaster"); t.RemoveSpellLine("ML2 Battlemaster"); t.RemoveSpellLine("ML3 Battlemaster"); t.RemoveSpellLine("ML4 Battlemaster"); t.RemoveSpellLine("ML5 Battlemaster"); t.RemoveSpellLine("ML6 Battlemaster"); t.RemoveSpellLine("ML7 Battlemaster"); t.RemoveSpellLine("ML8 Battlemaster"); t.RemoveSpellLine("ML9 Battlemaster"); t.RemoveSpellLine("ML10 Battlemaster"); t.RemoveSpellLine("ML1 Banelord"); t.RemoveSpellLine("ML2 Banelord"); t.RemoveSpellLine("ML3 Banelord"); t.RemoveSpellLine("ML4 Banelord"); t.RemoveSpellLine("ML5 Banelord"); t.RemoveSpellLine("ML6 Banelord"); t.RemoveSpellLine("ML7 Banelord"); t.RemoveSpellLine("ML8 Banelord"); t.RemoveSpellLine("ML9 Banelord"); t.RemoveSpellLine("ML10 Banelord"); t.RemoveSpellLine("ML1 Convoker"); t.RemoveSpellLine("ML2 Convoker"); t.RemoveSpellLine("ML3 Convoker"); t.RemoveSpellLine("ML4 Convoker"); t.RemoveSpellLine("ML5 Convoker"); t.RemoveSpellLine("ML6 Convoker"); t.RemoveSpellLine("ML7 Convoker"); t.RemoveSpellLine("ML8 Convoker"); t.RemoveSpellLine("ML9 Convoker"); t.RemoveSpellLine("ML10 Convoker"); t.RemoveSpellLine("ML1 Perfecter"); t.RemoveSpellLine("ML2 Perfecter"); t.RemoveSpellLine("ML3 Perfecter"); t.RemoveSpellLine("ML4 Perfecter"); t.RemoveSpellLine("ML5 Perfecter"); t.RemoveSpellLine("ML6 Perfecter"); t.RemoveSpellLine("ML7 Perfecter"); t.RemoveSpellLine("ML8 Perfecter"); t.RemoveSpellLine("ML9 Perfecter"); t.RemoveSpellLine("ML10 Perfecter"); t.RemoveSpellLine("ML1 Sojourner"); t.RemoveSpellLine("ML2 Sojourner"); t.RemoveSpellLine("ML3 Sojourner"); t.RemoveSpellLine("ML4 Sojourner"); t.RemoveSpellLine("ML5 Sojourner"); t.RemoveSpellLine("ML6 Sojourner"); t.RemoveSpellLine("ML7 Sojourner"); t.RemoveSpellLine("ML8 Sojourner"); t.RemoveSpellLine("ML9 Sojourner"); t.RemoveSpellLine("ML10 Sojourner"); t.RemoveSpellLine("ML1 Stormlord"); t.RemoveSpellLine("ML2 Stormlord"); t.RemoveSpellLine("ML3 Stormlord"); t.RemoveSpellLine("ML4 Stormlord"); t.RemoveSpellLine("ML5 Stormlord"); t.RemoveSpellLine("ML6 Stormlord"); t.RemoveSpellLine("ML7 Stormlord"); t.RemoveSpellLine("ML8 Stormlord"); t.RemoveSpellLine("ML9 Stormlord"); t.RemoveSpellLine("ML10 Stormlord"); t.RemoveSpellLine("ML1 Spymaster"); t.RemoveSpellLine("ML2 Spymaster"); t.RemoveSpellLine("ML3 Spymaster"); t.RemoveSpellLine("ML4 Spymaster"); t.RemoveSpellLine("ML5 Spymaster"); t.RemoveSpellLine("ML6 Spymaster"); t.RemoveSpellLine("ML7 Spymaster"); t.RemoveSpellLine("ML8 Spymaster"); t.RemoveSpellLine("ML9 Spymaster"); t.RemoveSpellLine("ML10 Spymaster"); t.RemoveSpellLine("ML1 Warlord"); t.RemoveSpellLine("ML2 Warlord"); t.RemoveSpellLine("ML3 Warlord"); t.RemoveSpellLine("ML4 Warlord"); t.RemoveSpellLine("ML5 Warlord"); t.RemoveSpellLine("ML6 Warlord"); t.RemoveSpellLine("ML7 Warlord"); t.RemoveSpellLine("ML8 Warlord"); t.RemoveSpellLine("ML9 Warlord"); t.RemoveSpellLine("ML10 Warlord"); t.ReceiveItem(this, "ml1token"); t.ReceiveItem(this, "ml2token"); t.ReceiveItem(this, "ml3token"); t.ReceiveItem(this, "ml4token"); t.ReceiveItem(this, "ml5token"); t.ReceiveItem(this, "ml6token"); t.ReceiveItem(this, "ml7token"); t.ReceiveItem(this, "ml8token"); t.ReceiveItem(this, "ml9token"); t.ReceiveItem(this, "ml10token"); t.Inventory.RemoveItem(item); t.UpdateSpellLineLevels(true); t.Out.SendUpdatePlayerSkills(); t.Out.SendUpdatePlayer(); t.UpdatePlayerStatus(); t.SaveIntoDatabase(); t.TempProperties.setProperty(REFUND_ITEM_WEAK, new WeakRef("mlrespectoken")); } } return(base.ReceiveItem(source, item)); }