2009-02-17 18:08:26 +01:00
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.sourceforge.net/>
2008-10-21 13:19:26 -05:00
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
/* ScriptData
SDName: Npc_Professions
SD%Complete: 80
SDComment: Provides learn/unlearn/relearn-options for professions. Not supported: Unlearn engineering, re-learn engineering, re-learn leatherworking.
SDCategory: NPCs
EndScriptData */
2009-10-17 15:51:44 -07:00
2010-01-19 11:36:05 +01:00
#include "ScriptedPch.h"
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
/*
A few notes for future developement:
- A full implementation of gossip for GO's is required. They must have the same scripting capabilities as creatures. Basically,
there is no difference here (except that default text is chosen with `gameobject_template`.`data3` (for GO type2, different dataN for a few others)
- It's possible blacksmithing still require some tweaks and adjustments due to the way we _have_ to use reputation.
*/
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
/*
-- UPDATE `gameobject_template` SET `ScriptName` = 'go_soothsaying_for_dummies' WHERE `entry` = 177226;
*/
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
/*###
# to be removed from here (->ncp_text). This is data for database projects.
###*/
#define TALK_MUST_UNLEARN_WEAPON "You must forget your weapon type specialty before I can help you. Go to Everlook in Winterspring and seek help there."
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
#define TALK_HAMMER_LEARN "Ah, a seasoned veteran you once were. I know you are capable, you merely need to ask and I shall teach you the way of the hammersmith."
#define TALK_AXE_LEARN "Ah, a seasoned veteran you once were. I know you are capable, you merely need to ask and I shall teach you the way of the axesmith."
#define TALK_SWORD_LEARN "Ah, a seasoned veteran you once were. I know you are capable, you merely need to ask and I shall teach you the way of the swordsmith."
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
#define TALK_HAMMER_UNLEARN "Forgetting your Hammersmithing skill is not something to do lightly. If you choose to abandon it you will forget all recipes that require Hammersmithing to create!"
#define TALK_AXE_UNLEARN "Forgetting your Axesmithing skill is not something to do lightly. If you choose to abandon it you will forget all recipes that require Axesmithing to create!"
#define TALK_SWORD_UNLEARN "Forgetting your Swordsmithing skill is not something to do lightly. If you choose to abandon it you will forget all recipes that require Swordsmithing to create!"
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
/*###
# generic defines
###*/
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
#define GOSSIP_SENDER_LEARN 50
#define GOSSIP_SENDER_UNLEARN 51
#define GOSSIP_SENDER_CHECK 52
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
/*###
# gossip item and box texts
###*/
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
#define GOSSIP_LEARN_POTION "Please teach me how to become a Master of Potions, Lauranna"
#define GOSSIP_UNLEARN_POTION "I wish to unlearn Potion Mastery"
#define GOSSIP_LEARN_TRANSMUTE "Please teach me how to become a Master of Transmutations, Zarevhi"
#define GOSSIP_UNLEARN_TRANSMUTE "I wish to unlearn Transmutation Mastery"
#define GOSSIP_LEARN_ELIXIR "Please teach me how to become a Master of Elixirs, Lorokeem"
#define GOSSIP_UNLEARN_ELIXIR "I wish to unlearn Elixir Mastery"
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
#define BOX_UNLEARN_ALCHEMY_SPEC "Do you really want to unlearn your alchemy specialty and lose all associated recipes? \n Cost: "
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
#define GOSSIP_WEAPON_LEARN "Please teach me how to become a Weaponsmith"
#define GOSSIP_WEAPON_UNLEARN "I wish to unlearn the art of Weaponsmithing"
#define GOSSIP_ARMOR_LEARN "Please teach me how to become a Armorsmith"
#define GOSSIP_ARMOR_UNLEARN "I wish to unlearn the art of Armorsmithing"
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
#define GOSSIP_UNLEARN_SMITH_SPEC "I wish to unlearn my blacksmith specialty"
#define BOX_UNLEARN_ARMORORWEAPON "Do you really want to unlearn your blacksmith specialty and lose all associated recipes? \n Cost: "
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
#define GOSSIP_LEARN_HAMMER "Please teach me how to become a Hammersmith, Lilith"
#define GOSSIP_UNLEARN_HAMMER "I wish to unlearn Hammersmithing"
#define GOSSIP_LEARN_AXE "Please teach me how to become a Axesmith, Kilram"
#define GOSSIP_UNLEARN_AXE "I wish to unlearn Axesmithing"
#define GOSSIP_LEARN_SWORD "Please teach me how to become a Swordsmith, Seril"
#define GOSSIP_UNLEARN_SWORD "I wish to unlearn Swordsmithing"
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
#define BOX_UNLEARN_WEAPON_SPEC "Do you really want to unlearn your weaponsmith specialty and lose all associated recipes? \n Cost: "
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
#define GOSSIP_LEARN_DRAGON "I am absolutely certain that i want to learn dragonscale leatherworking"
#define GOSSIP_UNLEARN_DRAGON "I wish to unlearn Dragonscale Leatherworking"
#define GOSSIP_LEARN_ELEMENTAL "I am absolutely certain that i want to learn elemental leatherworking"
#define GOSSIP_UNLEARN_ELEMENTAL "I wish to unlearn Elemental Leatherworking"
#define GOSSIP_LEARN_TRIBAL "I am absolutely certain that i want to learn tribal leatherworking"
#define GOSSIP_UNLEARN_TRIBAL "I wish to unlearn Tribal Leatherworking"
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
#define BOX_UNLEARN_LEATHER_SPEC "Do you really want to unlearn your leatherworking specialty and lose all associated recipes? \n Cost: "
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
#define GOSSIP_LEARN_SPELLFIRE "Please teach me how to become a Spellcloth tailor"
#define GOSSIP_UNLEARN_SPELLFIRE "I wish to unlearn Spellfire Tailoring"
#define GOSSIP_LEARN_MOONCLOTH "Please teach me how to become a Mooncloth tailor"
#define GOSSIP_UNLEARN_MOONCLOTH "I wish to unlearn Mooncloth Tailoring"
#define GOSSIP_LEARN_SHADOWEAVE "Please teach me how to become a Shadoweave tailor"
#define GOSSIP_UNLEARN_SHADOWEAVE "I wish to unlearn Shadoweave Tailoring"
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
#define BOX_UNLEARN_TAILOR_SPEC "Do you really want to unlearn your tailoring specialty and lose all associated recipes? \n Cost: "
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
#define GOSSIP_LEARN_GOBLIN "I am absolutely certain that i want to learn Goblin engineering"
#define GOSSIP_LEARN_GNOMISH "I am absolutely certain that i want to learn Gnomish engineering"
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
/*###
# spells defines
###*/
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
#define S_WEAPON 9787
#define S_ARMOR 9788
#define S_HAMMER 17040
#define S_AXE 17041
#define S_SWORD 17039
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
#define S_LEARN_WEAPON 9789
#define S_LEARN_ARMOR 9790
#define S_LEARN_HAMMER 39099
#define S_LEARN_AXE 39098
#define S_LEARN_SWORD 39097
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
#define S_UNLEARN_WEAPON 36436
#define S_UNLEARN_ARMOR 36435
#define S_UNLEARN_HAMMER 36441
#define S_UNLEARN_AXE 36439
#define S_UNLEARN_SWORD 36438
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
#define S_REP_ARMOR 17451
#define S_REP_WEAPON 17452
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
#define REP_ARMOR 46
#define REP_WEAPON 289
#define REP_HAMMER 569
#define REP_AXE 570
#define REP_SWORD 571
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
#define S_DRAGON 10656
#define S_ELEMENTAL 10658
#define S_TRIBAL 10660
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
#define S_LEARN_DRAGON 10657
#define S_LEARN_ELEMENTAL 10659
#define S_LEARN_TRIBAL 10661
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
#define S_UNLEARN_DRAGON 36434
#define S_UNLEARN_ELEMENTAL 36328
#define S_UNLEARN_TRIBAL 36433
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
#define S_GOBLIN 20222
#define S_GNOMISH 20219
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
#define S_LEARN_GOBLIN 20221
#define S_LEARN_GNOMISH 20220
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
#define S_SPELLFIRE 26797
#define S_MOONCLOTH 26798
#define S_SHADOWEAVE 26801
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
#define S_LEARN_SPELLFIRE 26796
#define S_LEARN_MOONCLOTH 26799
#define S_LEARN_SHADOWEAVE 26800
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
#define S_UNLEARN_SPELLFIRE 41299
#define S_UNLEARN_MOONCLOTH 41558
#define S_UNLEARN_SHADOWEAVE 41559
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
#define S_TRANSMUTE 28672
#define S_ELIXIR 28677
#define S_POTION 28675
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
#define S_LEARN_TRANSMUTE 28674
#define S_LEARN_ELIXIR 28678
#define S_LEARN_POTION 28676
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
#define S_UNLEARN_TRANSMUTE 41565
#define S_UNLEARN_ELIXIR 41564
#define S_UNLEARN_POTION 41563
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
/*###
# formulas to calculate unlearning cost
###*/
2009-10-17 15:51:44 -07:00
2009-08-14 00:02:13 +02:00
int32 DoLearnCost ( Player * pPlayer ) //tailor, alchemy
2008-10-21 13:19:26 -05:00
{
return 200000 ;
}
2009-10-17 15:51:44 -07:00
2009-08-14 00:02:13 +02:00
int32 DoHighUnlearnCost ( Player * pPlayer ) //tailor, alchemy
2008-10-21 13:19:26 -05:00
{
return 1500000 ;
}
2009-10-17 15:51:44 -07:00
2009-08-14 00:02:13 +02:00
int32 DoMedUnlearnCost ( Player * pPlayer ) //blacksmith, leatherwork
2008-10-21 13:19:26 -05:00
{
2009-11-01 17:53:07 -08:00
uint8 level = pPlayer -> getLevel ();
2009-08-14 00:02:13 +02:00
if ( level < 51 )
2008-10-21 13:19:26 -05:00
return 250000 ;
else if ( level < 66 )
return 500000 ;
else
return 1000000 ;
}
2009-10-17 15:51:44 -07:00
2009-08-14 00:02:13 +02:00
int32 DoLowUnlearnCost ( Player * pPlayer ) //blacksmith
2008-10-21 13:19:26 -05:00
{
2009-11-01 17:53:07 -08:00
uint8 level = pPlayer -> getLevel ();
2008-10-21 13:19:26 -05:00
if ( level < 66 )
return 50000 ;
else
return 100000 ;
}
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
/*###
# unlearning related profession spells
###*/
2009-10-17 15:51:44 -07:00
2009-08-14 00:02:13 +02:00
bool EquippedOk ( Player * pPlayer , uint32 spellId )
2008-10-21 13:19:26 -05:00
{
SpellEntry const * spell = GetSpellStore () -> LookupEntry ( spellId );
2009-10-17 15:51:44 -07:00
2009-08-14 00:02:13 +02:00
if ( ! spell )
2008-10-21 13:19:26 -05:00
return false ;
2009-10-17 15:51:44 -07:00
2009-11-01 17:53:07 -08:00
for ( uint8 i = 0 ; i < 3 ; ++ i )
2008-10-21 13:19:26 -05:00
{
uint32 reqSpell = spell -> EffectTriggerSpell [ i ];
2009-08-14 00:02:13 +02:00
if ( ! reqSpell )
2008-10-21 13:19:26 -05:00
continue ;
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
Item * pItem ;
2009-11-01 17:53:07 -08:00
for ( uint8 j = EQUIPMENT_SLOT_START ; j < EQUIPMENT_SLOT_END ; ++ j )
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:02:13 +02:00
pItem = pPlayer -> GetItemByPos ( INVENTORY_SLOT_BAG_0 , j );
if ( pItem )
if ( pItem -> GetProto () -> RequiredSpell == reqSpell )
2008-10-21 13:19:26 -05:00
{
//player has item equipped that require specialty. Not allow to unlearn, player has to unequip first
2009-04-24 00:51:09 -04:00
debug_log ( "TSCR: player attempt to unlearn spell %u, but item %u is equipped." , reqSpell , pItem -> GetProto () -> ItemId );
2008-10-21 13:19:26 -05:00
return false ;
}
}
}
return true ;
}
2009-10-17 15:51:44 -07:00
2009-08-14 00:02:13 +02:00
void ProfessionUnlearnSpells ( Player * pPlayer , uint32 type )
2008-10-21 13:19:26 -05:00
{
switch ( type )
{
case 36436 : // S_UNLEARN_WEAPON
2009-08-14 00:02:13 +02:00
pPlayer -> removeSpell ( 36125 ); // Light Earthforged Blade
pPlayer -> removeSpell ( 36128 ); // Light Emberforged Hammer
pPlayer -> removeSpell ( 36126 ); // Light Skyforged Axe
2008-10-21 13:19:26 -05:00
break ;
case 36435 : // S_UNLEARN_ARMOR
2009-08-14 00:02:13 +02:00
pPlayer -> removeSpell ( 36122 ); // Earthforged Leggings
pPlayer -> removeSpell ( 36129 ); // Heavy Earthforged Breastplate
pPlayer -> removeSpell ( 36130 ); // Stormforged Hauberk
pPlayer -> removeSpell ( 34533 ); // Breastplate of Kings
pPlayer -> removeSpell ( 34529 ); // Nether Chain Shirt
pPlayer -> removeSpell ( 34534 ); // Bulwark of Kings
pPlayer -> removeSpell ( 36257 ); // Bulwark of the Ancient Kings
pPlayer -> removeSpell ( 36256 ); // Embrace of the Twisting Nether
pPlayer -> removeSpell ( 34530 ); // Twisting Nether Chain Shirt
pPlayer -> removeSpell ( 36124 ); // Windforged Leggings
2008-10-21 13:19:26 -05:00
break ;
case 36441 : // S_UNLEARN_HAMMER
2009-08-14 00:02:13 +02:00
pPlayer -> removeSpell ( 36262 ); // Dragonstrike
pPlayer -> removeSpell ( 34546 ); // Dragonmaw
pPlayer -> removeSpell ( 34545 ); // Drakefist Hammer
pPlayer -> removeSpell ( 36136 ); // Lavaforged Warhammer
pPlayer -> removeSpell ( 34547 ); // Thunder
pPlayer -> removeSpell ( 34567 ); // Deep Thunder
pPlayer -> removeSpell ( 36263 ); // Stormherald
pPlayer -> removeSpell ( 36137 ); // Great Earthforged Hammer
2008-10-21 13:19:26 -05:00
break ;
case 36439 : // S_UNLEARN_AXE
2009-08-14 00:02:13 +02:00
pPlayer -> removeSpell ( 36260 ); // Wicked Edge of the Planes
pPlayer -> removeSpell ( 34562 ); // Black Planar Edge
pPlayer -> removeSpell ( 34541 ); // The Planar Edge
pPlayer -> removeSpell ( 36134 ); // Stormforged Axe
pPlayer -> removeSpell ( 36135 ); // Skyforged Great Axe
pPlayer -> removeSpell ( 36261 ); // Bloodmoon
pPlayer -> removeSpell ( 34543 ); // Lunar Crescent
pPlayer -> removeSpell ( 34544 ); // Mooncleaver
2008-10-21 13:19:26 -05:00
break ;
case 36438 : // S_UNLEARN_SWORD
2009-08-14 00:02:13 +02:00
pPlayer -> removeSpell ( 36258 ); // Blazefury
pPlayer -> removeSpell ( 34537 ); // Blazeguard
pPlayer -> removeSpell ( 34535 ); // Fireguard
pPlayer -> removeSpell ( 36131 ); // Windforged Rapier
pPlayer -> removeSpell ( 36133 ); // Stoneforged Claymore
pPlayer -> removeSpell ( 34538 ); // Lionheart Blade
pPlayer -> removeSpell ( 34540 ); // Lionheart Champion
pPlayer -> removeSpell ( 36259 ); // Lionheart Executioner
2008-10-21 13:19:26 -05:00
break ;
case 36434 : // S_UNLEARN_DRAGON
2009-08-14 00:02:13 +02:00
pPlayer -> removeSpell ( 36076 ); // Dragonstrike Leggings
pPlayer -> removeSpell ( 36079 ); // Golden Dragonstrike Breastplate
pPlayer -> removeSpell ( 35576 ); // Ebon Netherscale Belt
pPlayer -> removeSpell ( 35577 ); // Ebon Netherscale Bracers
pPlayer -> removeSpell ( 35575 ); // Ebon Netherscale Breastplate
pPlayer -> removeSpell ( 35582 ); // Netherstrike Belt
pPlayer -> removeSpell ( 35584 ); // Netherstrike Bracers
pPlayer -> removeSpell ( 35580 ); // Netherstrike Breastplate
2008-10-21 13:19:26 -05:00
break ;
case 36328 : // S_UNLEARN_ELEMENTAL
2009-08-14 00:02:13 +02:00
pPlayer -> removeSpell ( 36074 ); // Blackstorm Leggings
pPlayer -> removeSpell ( 36077 ); // Primalstorm Breastplate
pPlayer -> removeSpell ( 35590 ); // Primalstrike Belt
pPlayer -> removeSpell ( 35591 ); // Primalstrike Bracers
pPlayer -> removeSpell ( 35589 ); // Primalstrike Vest
2008-10-21 13:19:26 -05:00
break ;
case 36433 : // S_UNLEARN_TRIBAL
2009-08-14 00:02:13 +02:00
pPlayer -> removeSpell ( 35585 ); // Windhawk Hauberk
pPlayer -> removeSpell ( 35587 ); // Windhawk Belt
pPlayer -> removeSpell ( 35588 ); // Windhawk Bracers
pPlayer -> removeSpell ( 36075 ); // Wildfeather Leggings
pPlayer -> removeSpell ( 36078 ); // Living Crystal Breastplate
2008-10-21 13:19:26 -05:00
break ;
case 41299 : // S_UNLEARN_SPELLFIRE
2009-08-14 00:02:13 +02:00
pPlayer -> removeSpell ( 26752 ); // Spellfire Belt
pPlayer -> removeSpell ( 26753 ); // Spellfire Gloves
pPlayer -> removeSpell ( 26754 ); // Spellfire Robe
2008-10-21 13:19:26 -05:00
break ;
case 41558 : // S_UNLEARN_MOONCLOTH
2009-08-14 00:02:13 +02:00
pPlayer -> removeSpell ( 26760 ); // Primal Mooncloth Belt
pPlayer -> removeSpell ( 26761 ); // Primal Mooncloth Shoulders
pPlayer -> removeSpell ( 26762 ); // Primal Mooncloth Robe
2008-10-21 13:19:26 -05:00
break ;
case 41559 : // S_UNLEARN_SHADOWEAVE
2009-08-14 00:02:13 +02:00
pPlayer -> removeSpell ( 26756 ); // Frozen Shadoweave Shoulders
pPlayer -> removeSpell ( 26757 ); // Frozen Shadoweave Boots
pPlayer -> removeSpell ( 26758 ); // Frozen Shadoweave Robe
2008-10-21 13:19:26 -05:00
break ;
}
}
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
/*###
# start menues alchemy
###*/
2009-10-17 15:51:44 -07:00
2009-08-14 00:02:13 +02:00
bool HasAlchemySpell ( Player * pPlayer )
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:02:13 +02:00
if ( pPlayer -> HasSpell ( S_TRANSMUTE ) || pPlayer -> HasSpell ( S_ELIXIR ) || pPlayer -> HasSpell ( S_POTION ))
2008-10-21 13:19:26 -05:00
return true ;
return false ;
}
2009-10-17 15:51:44 -07:00
2009-08-14 00:39:07 +02:00
bool GossipHello_npc_prof_alchemy ( Player * pPlayer , Creature * pCreature )
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:39:07 +02:00
if ( pCreature -> isQuestGiver ())
pPlayer -> PrepareQuestMenu ( pCreature -> GetGUID ());
if ( pCreature -> isVendor ())
2009-08-14 00:02:13 +02:00
pPlayer -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_VENDOR , GOSSIP_TEXT_BROWSE_GOODS , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_TRADE );
2009-08-14 00:39:07 +02:00
if ( pCreature -> isTrainer ())
2009-08-14 00:02:13 +02:00
pPlayer -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_TRAINER , GOSSIP_TEXT_TRAIN , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_TRAIN );
2009-10-17 15:51:44 -07:00
2009-08-14 00:39:07 +02:00
uint32 eCreature = pCreature -> GetEntry ();
2009-10-17 15:51:44 -07:00
2009-08-14 00:02:13 +02:00
if ( pPlayer -> HasSkill ( SKILL_ALCHEMY ) && pPlayer -> GetBaseSkillValue ( SKILL_ALCHEMY ) >= 350 && pPlayer -> getLevel () > 67 )
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:02:13 +02:00
if ( pPlayer -> GetQuestRewardStatus ( 10899 ) || pPlayer -> GetQuestRewardStatus ( 10902 ) || pPlayer -> GetQuestRewardStatus ( 10897 ))
2008-10-21 13:19:26 -05:00
{
switch ( eCreature )
{
case 22427 : //Zarevhi
2009-08-14 00:02:13 +02:00
if ( ! HasAlchemySpell ( pPlayer ))
pPlayer -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_LEARN_TRANSMUTE , GOSSIP_SENDER_LEARN , GOSSIP_ACTION_INFO_DEF + 1 );
if ( pPlayer -> HasSpell ( S_TRANSMUTE ))
pPlayer -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_UNLEARN_TRANSMUTE , GOSSIP_SENDER_UNLEARN , GOSSIP_ACTION_INFO_DEF + 4 );
2008-10-21 13:19:26 -05:00
break ;
case 19052 : //Lorokeem
2009-08-14 00:02:13 +02:00
if ( ! HasAlchemySpell ( pPlayer ))
pPlayer -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_LEARN_ELIXIR , GOSSIP_SENDER_LEARN , GOSSIP_ACTION_INFO_DEF + 2 );
if ( pPlayer -> HasSpell ( S_ELIXIR ))
pPlayer -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_UNLEARN_ELIXIR , GOSSIP_SENDER_UNLEARN , GOSSIP_ACTION_INFO_DEF + 5 );
2008-10-21 13:19:26 -05:00
break ;
case 17909 : //Lauranna Thar'well
2009-08-14 00:02:13 +02:00
if ( ! HasAlchemySpell ( pPlayer ))
pPlayer -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_LEARN_POTION , GOSSIP_SENDER_LEARN , GOSSIP_ACTION_INFO_DEF + 3 );
if ( pPlayer -> HasSpell ( S_POTION ))
pPlayer -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_UNLEARN_POTION , GOSSIP_SENDER_UNLEARN , GOSSIP_ACTION_INFO_DEF + 6 );
2008-10-21 13:19:26 -05:00
break ;
}
}
}
2009-10-17 15:51:44 -07:00
2009-12-20 13:35:08 +02:00
pPlayer -> SEND_GOSSIP_MENU ( pPlayer -> GetGossipTextId ( pCreature ), pCreature -> GetGUID ());
2008-10-21 13:19:26 -05:00
return true ;
}
2009-10-17 15:51:44 -07:00
2009-08-15 00:32:04 +02:00
void SendActionMenu_npc_prof_alchemy ( Player * pPlayer , Creature * pCreature , uint32 uiAction )
2008-10-21 13:19:26 -05:00
{
2009-08-15 00:32:04 +02:00
switch ( uiAction )
2008-10-21 13:19:26 -05:00
{
case GOSSIP_ACTION_TRADE :
2009-08-14 00:39:07 +02:00
pPlayer -> SEND_VENDORLIST ( pCreature -> GetGUID ());
2008-10-21 13:19:26 -05:00
break ;
case GOSSIP_ACTION_TRAIN :
2009-08-14 00:39:07 +02:00
pPlayer -> SEND_TRAINERLIST ( pCreature -> GetGUID ());
2008-10-21 13:19:26 -05:00
break ;
//Learn Alchemy
case GOSSIP_ACTION_INFO_DEF + 1 :
2009-08-14 00:02:13 +02:00
if ( ! pPlayer -> HasSpell ( S_TRANSMUTE ) && pPlayer -> GetMoney () >= DoLearnCost ( pPlayer ))
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:02:13 +02:00
pPlayer -> CastSpell ( pPlayer , S_LEARN_TRANSMUTE , true );
pPlayer -> ModifyMoney ( - DoLearnCost ( pPlayer ));
2008-10-21 13:19:26 -05:00
} else
2009-08-14 00:39:07 +02:00
pPlayer -> SendBuyError ( BUY_ERR_NOT_ENOUGHT_MONEY , pCreature , 0 , 0 );
2009-08-14 00:02:13 +02:00
pPlayer -> CLOSE_GOSSIP_MENU ();
2008-10-21 13:19:26 -05:00
break ;
case GOSSIP_ACTION_INFO_DEF + 2 :
2009-08-14 00:02:13 +02:00
if ( ! pPlayer -> HasSpell ( S_ELIXIR ) && pPlayer -> GetMoney () >= DoLearnCost ( pPlayer ))
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:02:13 +02:00
pPlayer -> CastSpell ( pPlayer , S_LEARN_ELIXIR , true );
pPlayer -> ModifyMoney ( - DoLearnCost ( pPlayer ));
2008-10-21 13:19:26 -05:00
} else
2009-08-14 00:39:07 +02:00
pPlayer -> SendBuyError ( BUY_ERR_NOT_ENOUGHT_MONEY , pCreature , 0 , 0 );
2009-08-14 00:02:13 +02:00
pPlayer -> CLOSE_GOSSIP_MENU ();
2008-10-21 13:19:26 -05:00
break ;
case GOSSIP_ACTION_INFO_DEF + 3 :
2009-08-14 00:02:13 +02:00
if ( ! pPlayer -> HasSpell ( S_POTION ) && pPlayer -> GetMoney () >= DoLearnCost ( pPlayer ))
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:02:13 +02:00
pPlayer -> CastSpell ( pPlayer , S_LEARN_POTION , true );
pPlayer -> ModifyMoney ( - DoLearnCost ( pPlayer ));
2008-10-21 13:19:26 -05:00
} else
2009-08-14 00:39:07 +02:00
pPlayer -> SendBuyError ( BUY_ERR_NOT_ENOUGHT_MONEY , pCreature , 0 , 0 );
2009-08-14 00:02:13 +02:00
pPlayer -> CLOSE_GOSSIP_MENU ();
2008-10-21 13:19:26 -05:00
break ;
//Unlearn Alchemy
case GOSSIP_ACTION_INFO_DEF + 4 :
2009-08-14 00:02:13 +02:00
if ( pPlayer -> GetMoney () >= DoHighUnlearnCost ( pPlayer ))
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:39:07 +02:00
pCreature -> CastSpell ( pPlayer , S_UNLEARN_TRANSMUTE , true );
2009-08-14 00:02:13 +02:00
pPlayer -> ModifyMoney ( - DoHighUnlearnCost ( pPlayer ));
2008-10-21 13:19:26 -05:00
} else
2009-08-14 00:39:07 +02:00
pPlayer -> SendBuyError ( BUY_ERR_NOT_ENOUGHT_MONEY , pCreature , 0 , 0 );
2009-08-14 00:02:13 +02:00
pPlayer -> CLOSE_GOSSIP_MENU ();
2008-10-21 13:19:26 -05:00
break ;
case GOSSIP_ACTION_INFO_DEF + 5 :
2009-08-14 00:02:13 +02:00
if ( pPlayer -> GetMoney () >= DoHighUnlearnCost ( pPlayer ))
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:39:07 +02:00
pCreature -> CastSpell ( pPlayer , S_UNLEARN_ELIXIR , true );
2009-08-14 00:02:13 +02:00
pPlayer -> ModifyMoney ( - DoHighUnlearnCost ( pPlayer ));
2008-10-21 13:19:26 -05:00
} else
2009-08-14 00:39:07 +02:00
pPlayer -> SendBuyError ( BUY_ERR_NOT_ENOUGHT_MONEY , pCreature , 0 , 0 );
2009-08-14 00:02:13 +02:00
pPlayer -> CLOSE_GOSSIP_MENU ();
2008-10-21 13:19:26 -05:00
break ;
case GOSSIP_ACTION_INFO_DEF + 6 :
2009-08-14 00:02:13 +02:00
if ( pPlayer -> GetMoney () >= DoHighUnlearnCost ( pPlayer ))
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:39:07 +02:00
pCreature -> CastSpell ( pPlayer , S_UNLEARN_POTION , true );
2009-08-14 00:02:13 +02:00
pPlayer -> ModifyMoney ( - DoHighUnlearnCost ( pPlayer ));
2008-10-21 13:19:26 -05:00
} else
2009-08-14 00:39:07 +02:00
pPlayer -> SendBuyError ( BUY_ERR_NOT_ENOUGHT_MONEY , pCreature , 0 , 0 );
2009-08-14 00:02:13 +02:00
pPlayer -> CLOSE_GOSSIP_MENU ();
2008-10-21 13:19:26 -05:00
break ;
}
}
2009-10-17 15:51:44 -07:00
2009-08-15 00:32:04 +02:00
void SendConfirmLearn_npc_prof_alchemy ( Player * pPlayer , Creature * pCreature , uint32 uiAction )
2008-10-21 13:19:26 -05:00
{
2009-08-15 00:32:04 +02:00
if ( uiAction )
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:39:07 +02:00
uint32 eCreature = pCreature -> GetEntry ();
2008-10-21 13:19:26 -05:00
switch ( eCreature )
{
case 22427 :
2009-08-15 00:32:04 +02:00
pPlayer -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_LEARN_TRANSMUTE , GOSSIP_SENDER_CHECK , uiAction );
2008-10-21 13:19:26 -05:00
//unknown textID ()
2009-12-20 13:35:08 +02:00
pPlayer -> SEND_GOSSIP_MENU ( pPlayer -> GetGossipTextId ( pCreature ), pCreature -> GetGUID ());
2008-10-21 13:19:26 -05:00
break ;
case 19052 :
2009-08-15 00:32:04 +02:00
pPlayer -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_LEARN_ELIXIR , GOSSIP_SENDER_CHECK , uiAction );
2008-10-21 13:19:26 -05:00
//unknown textID ()
2009-12-20 13:35:08 +02:00
pPlayer -> SEND_GOSSIP_MENU ( pPlayer -> GetGossipTextId ( pCreature ), pCreature -> GetGUID ());
2008-10-21 13:19:26 -05:00
break ;
case 17909 :
2009-08-15 00:32:04 +02:00
pPlayer -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_LEARN_POTION , GOSSIP_SENDER_CHECK , uiAction );
2008-10-21 13:19:26 -05:00
//unknown textID ()
2009-12-20 13:35:08 +02:00
pPlayer -> SEND_GOSSIP_MENU ( pPlayer -> GetGossipTextId ( pCreature ), pCreature -> GetGUID ());
2008-10-21 13:19:26 -05:00
break ;
}
}
}
2009-10-17 15:51:44 -07:00
2009-08-15 00:32:04 +02:00
void SendConfirmUnlearn_npc_prof_alchemy ( Player * pPlayer , Creature * pCreature , uint32 uiAction )
2008-10-21 13:19:26 -05:00
{
2009-08-15 00:32:04 +02:00
if ( uiAction )
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:39:07 +02:00
uint32 eCreature = pCreature -> GetEntry ();
2008-10-21 13:19:26 -05:00
switch ( eCreature )
{
case 22427 : //Zarevhi
2009-08-15 00:32:04 +02:00
pPlayer -> ADD_GOSSIP_ITEM_EXTENDED ( 0 , GOSSIP_UNLEARN_TRANSMUTE , GOSSIP_SENDER_CHECK , uiAction , BOX_UNLEARN_ALCHEMY_SPEC , DoHighUnlearnCost ( pPlayer ), false );
2008-10-21 13:19:26 -05:00
//unknown textID ()
2009-12-20 13:35:08 +02:00
pPlayer -> SEND_GOSSIP_MENU ( pPlayer -> GetGossipTextId ( pCreature ), pCreature -> GetGUID ());
2008-10-21 13:19:26 -05:00
break ;
case 19052 : //Lorokeem
2009-08-15 00:32:04 +02:00
pPlayer -> ADD_GOSSIP_ITEM_EXTENDED ( 0 , GOSSIP_UNLEARN_ELIXIR , GOSSIP_SENDER_CHECK , uiAction , BOX_UNLEARN_ALCHEMY_SPEC , DoHighUnlearnCost ( pPlayer ), false );
2008-10-21 13:19:26 -05:00
//unknown textID ()
2009-12-20 13:35:08 +02:00
pPlayer -> SEND_GOSSIP_MENU ( pPlayer -> GetGossipTextId ( pCreature ), pCreature -> GetGUID ());
2008-10-21 13:19:26 -05:00
break ;
case 17909 : //Lauranna Thar'well
2009-08-15 00:32:04 +02:00
pPlayer -> ADD_GOSSIP_ITEM_EXTENDED ( 0 , GOSSIP_UNLEARN_POTION , GOSSIP_SENDER_CHECK , uiAction , BOX_UNLEARN_ALCHEMY_SPEC , DoHighUnlearnCost ( pPlayer ), false );
2008-10-21 13:19:26 -05:00
//unknown textID ()
2009-12-20 13:35:08 +02:00
pPlayer -> SEND_GOSSIP_MENU ( pPlayer -> GetGossipTextId ( pCreature ), pCreature -> GetGUID ());
2008-10-21 13:19:26 -05:00
break ;
}
}
}
2009-10-17 15:51:44 -07:00
2009-08-15 00:32:04 +02:00
bool GossipSelect_npc_prof_alchemy ( Player * pPlayer , Creature * pCreature , uint32 uiSender , uint32 uiAction )
2008-10-21 13:19:26 -05:00
{
2009-08-15 00:32:04 +02:00
switch ( uiSender )
2008-10-21 13:19:26 -05:00
{
2009-08-15 00:32:04 +02:00
case GOSSIP_SENDER_MAIN : SendActionMenu_npc_prof_alchemy ( pPlayer , pCreature , uiAction ); break ;
case GOSSIP_SENDER_LEARN : SendConfirmLearn_npc_prof_alchemy ( pPlayer , pCreature , uiAction ); break ;
case GOSSIP_SENDER_UNLEARN : SendConfirmUnlearn_npc_prof_alchemy ( pPlayer , pCreature , uiAction ); break ;
case GOSSIP_SENDER_CHECK : SendActionMenu_npc_prof_alchemy ( pPlayer , pCreature , uiAction ); break ;
2008-10-21 13:19:26 -05:00
}
return true ;
}
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
/*###
# start menues blacksmith
###*/
2009-10-17 15:51:44 -07:00
2009-08-14 00:02:13 +02:00
bool HasWeaponSub ( Player * pPlayer )
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:02:13 +02:00
if ( pPlayer -> HasSpell ( S_HAMMER ) || pPlayer -> HasSpell ( S_AXE ) || pPlayer -> HasSpell ( S_SWORD ))
2008-10-21 13:19:26 -05:00
return true ;
return false ;
}
2009-10-17 15:51:44 -07:00
2009-08-14 00:39:07 +02:00
bool GossipHello_npc_prof_blacksmith ( Player * pPlayer , Creature * pCreature )
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:39:07 +02:00
if ( pCreature -> isQuestGiver ())
pPlayer -> PrepareQuestMenu ( pCreature -> GetGUID ());
if ( pCreature -> isVendor ())
2009-08-14 00:02:13 +02:00
pPlayer -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_VENDOR , GOSSIP_TEXT_BROWSE_GOODS , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_TRADE );
2009-08-14 00:39:07 +02:00
if ( pCreature -> isTrainer ())
2009-08-14 00:02:13 +02:00
pPlayer -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_TRAINER , GOSSIP_TEXT_TRAIN , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_TRAIN );
2009-10-17 15:51:44 -07:00
2009-08-14 00:39:07 +02:00
uint32 eCreature = pCreature -> GetEntry ();
2008-10-21 13:19:26 -05:00
//WEAPONSMITH & ARMORSMITH
2009-08-14 00:02:13 +02:00
if ( pPlayer -> GetBaseSkillValue ( SKILL_BLACKSMITHING ) >= 225 )
2008-10-21 13:19:26 -05:00
{
switch ( eCreature )
{
case 11145 : //Myolor Sunderfury
case 11176 : //Krathok Moltenfist
2009-08-14 00:02:13 +02:00
if ( ! pPlayer -> HasSpell ( S_ARMOR ) && ! pPlayer -> HasSpell ( S_WEAPON ) && pPlayer -> GetReputationRank ( REP_ARMOR ) >= REP_FRIENDLY )
pPlayer -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_ARMOR_LEARN , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 1 );
if ( ! pPlayer -> HasSpell ( S_WEAPON ) && ! pPlayer -> HasSpell ( S_ARMOR ) && pPlayer -> GetReputationRank ( REP_WEAPON ) >= REP_FRIENDLY )
pPlayer -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_WEAPON_LEARN , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_INFO_DEF + 2 );
2008-10-21 13:19:26 -05:00
break ;
case 11146 : //Ironus Coldsteel
case 11178 : //Borgosh Corebender
2009-08-14 00:02:13 +02:00
if ( pPlayer -> HasSpell ( S_WEAPON ))
pPlayer -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_WEAPON_UNLEARN , GOSSIP_SENDER_UNLEARN , GOSSIP_ACTION_INFO_DEF + 3 );
2008-10-21 13:19:26 -05:00
break ;
case 5164 : //Grumnus Steelshaper
case 11177 : //Okothos Ironrager
2009-08-14 00:02:13 +02:00
if ( pPlayer -> HasSpell ( S_ARMOR ))
pPlayer -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_ARMOR_UNLEARN , GOSSIP_SENDER_UNLEARN , GOSSIP_ACTION_INFO_DEF + 4 );
2008-10-21 13:19:26 -05:00
break ;
}
}
//WEAPONSMITH SPEC
2009-08-14 00:02:13 +02:00
if ( pPlayer -> HasSpell ( S_WEAPON ) && pPlayer -> getLevel () > 49 && pPlayer -> GetBaseSkillValue ( SKILL_BLACKSMITHING ) >= 250 )
2008-10-21 13:19:26 -05:00
{
switch ( eCreature )
{
case 11191 : //Lilith the Lithe
2009-08-14 00:02:13 +02:00
if ( ! HasWeaponSub ( pPlayer ))
pPlayer -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_LEARN_HAMMER , GOSSIP_SENDER_LEARN , GOSSIP_ACTION_INFO_DEF + 5 );
if ( pPlayer -> HasSpell ( S_HAMMER ))
pPlayer -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_UNLEARN_HAMMER , GOSSIP_SENDER_UNLEARN , GOSSIP_ACTION_INFO_DEF + 8 );
2008-10-21 13:19:26 -05:00
break ;
case 11192 : //Kilram
2009-08-14 00:02:13 +02:00
if ( ! HasWeaponSub ( pPlayer ))
pPlayer -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_LEARN_AXE , GOSSIP_SENDER_LEARN , GOSSIP_ACTION_INFO_DEF + 6 );
if ( pPlayer -> HasSpell ( S_AXE ))
pPlayer -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_UNLEARN_AXE , GOSSIP_SENDER_UNLEARN , GOSSIP_ACTION_INFO_DEF + 9 );
2008-10-21 13:19:26 -05:00
break ;
case 11193 : //Seril Scourgebane
2009-08-14 00:02:13 +02:00
if ( ! HasWeaponSub ( pPlayer ))
pPlayer -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_LEARN_SWORD , GOSSIP_SENDER_LEARN , GOSSIP_ACTION_INFO_DEF + 7 );
if ( pPlayer -> HasSpell ( S_SWORD ))
pPlayer -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_UNLEARN_SWORD , GOSSIP_SENDER_UNLEARN , GOSSIP_ACTION_INFO_DEF + 10 );
2008-10-21 13:19:26 -05:00
break ;
}
}
2009-10-17 15:51:44 -07:00
2009-12-20 13:35:08 +02:00
pPlayer -> SEND_GOSSIP_MENU ( pPlayer -> GetGossipTextId ( pCreature ), pCreature -> GetGUID ());
2008-10-21 13:19:26 -05:00
return true ;
}
2009-10-17 15:51:44 -07:00
2009-08-15 00:32:04 +02:00
void SendActionMenu_npc_prof_blacksmith ( Player * pPlayer , Creature * pCreature , uint32 uiAction )
2008-10-21 13:19:26 -05:00
{
2009-08-15 00:32:04 +02:00
switch ( uiAction )
2008-10-21 13:19:26 -05:00
{
case GOSSIP_ACTION_TRADE :
2009-08-14 00:39:07 +02:00
pPlayer -> SEND_VENDORLIST ( pCreature -> GetGUID ());
2008-10-21 13:19:26 -05:00
break ;
case GOSSIP_ACTION_TRAIN :
2009-08-14 00:39:07 +02:00
pPlayer -> SEND_TRAINERLIST ( pCreature -> GetGUID ());
2008-10-21 13:19:26 -05:00
break ;
//Learn Armor/Weapon
case GOSSIP_ACTION_INFO_DEF + 1 :
2009-08-14 00:02:13 +02:00
if ( ! pPlayer -> HasSpell ( S_ARMOR ))
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:02:13 +02:00
pPlayer -> CastSpell ( pPlayer , S_LEARN_ARMOR , true );
//_Creature->CastSpell(pPlayer, S_REP_ARMOR, true);
2008-10-21 13:19:26 -05:00
}
2009-08-14 00:02:13 +02:00
pPlayer -> CLOSE_GOSSIP_MENU ();
2008-10-21 13:19:26 -05:00
break ;
case GOSSIP_ACTION_INFO_DEF + 2 :
2009-08-14 00:02:13 +02:00
if ( ! pPlayer -> HasSpell ( S_WEAPON ))
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:02:13 +02:00
pPlayer -> CastSpell ( pPlayer , S_LEARN_WEAPON , true );
//_Creature->CastSpell(pPlayer, S_REP_WEAPON, true);
2008-10-21 13:19:26 -05:00
}
2009-08-14 00:02:13 +02:00
pPlayer -> CLOSE_GOSSIP_MENU ();
2008-10-21 13:19:26 -05:00
break ;
//Unlearn Armor/Weapon
case GOSSIP_ACTION_INFO_DEF + 3 :
2009-08-14 00:02:13 +02:00
if ( HasWeaponSub ( pPlayer ))
2008-10-21 13:19:26 -05:00
{
//unknown textID (TALK_MUST_UNLEARN_WEAPON)
2009-12-20 13:35:08 +02:00
pPlayer -> SEND_GOSSIP_MENU ( pPlayer -> GetGossipTextId ( pCreature ), pCreature -> GetGUID ());
2008-10-21 13:19:26 -05:00
}
2009-08-14 00:02:13 +02:00
else if ( EquippedOk ( pPlayer , S_UNLEARN_WEAPON ))
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:02:13 +02:00
if ( pPlayer -> GetMoney () >= DoLowUnlearnCost ( pPlayer ))
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:02:13 +02:00
pPlayer -> CastSpell ( pPlayer , S_UNLEARN_WEAPON , true );
ProfessionUnlearnSpells ( pPlayer , S_UNLEARN_WEAPON );
pPlayer -> ModifyMoney ( - DoLowUnlearnCost ( pPlayer ));
2009-08-14 00:39:07 +02:00
pCreature -> CastSpell ( pPlayer , S_REP_ARMOR , true );
2009-08-14 00:02:13 +02:00
pPlayer -> CLOSE_GOSSIP_MENU ();
2008-10-21 13:19:26 -05:00
} else
2009-08-14 00:39:07 +02:00
pPlayer -> SendBuyError ( BUY_ERR_NOT_ENOUGHT_MONEY , pCreature , 0 , 0 );
2008-10-21 13:19:26 -05:00
}
else
{
2009-08-14 00:02:13 +02:00
pPlayer -> SendEquipError ( EQUIP_ERR_CANT_DO_RIGHT_NOW , NULL , NULL );
pPlayer -> CLOSE_GOSSIP_MENU ();
2008-10-21 13:19:26 -05:00
}
break ;
case GOSSIP_ACTION_INFO_DEF + 4 :
2009-08-14 00:02:13 +02:00
if ( EquippedOk ( pPlayer , S_UNLEARN_ARMOR ))
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:02:13 +02:00
if ( pPlayer -> GetMoney () >= DoLowUnlearnCost ( pPlayer ))
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:02:13 +02:00
pPlayer -> CastSpell ( pPlayer , S_UNLEARN_ARMOR , true );
ProfessionUnlearnSpells ( pPlayer , S_UNLEARN_ARMOR );
pPlayer -> ModifyMoney ( - DoLowUnlearnCost ( pPlayer ));
2009-08-14 00:39:07 +02:00
pCreature -> CastSpell ( pPlayer , S_REP_WEAPON , true );
2008-10-21 13:19:26 -05:00
} else
2009-08-14 00:39:07 +02:00
pPlayer -> SendBuyError ( BUY_ERR_NOT_ENOUGHT_MONEY , pCreature , 0 , 0 );
2008-10-21 13:19:26 -05:00
} else
2009-08-14 00:02:13 +02:00
pPlayer -> SendEquipError ( EQUIP_ERR_CANT_DO_RIGHT_NOW , NULL , NULL );
pPlayer -> CLOSE_GOSSIP_MENU ();
2008-10-21 13:19:26 -05:00
break ;
//Learn Hammer/Axe/Sword
case GOSSIP_ACTION_INFO_DEF + 5 :
2009-08-14 00:02:13 +02:00
pPlayer -> CastSpell ( pPlayer , S_LEARN_HAMMER , true );
pPlayer -> CLOSE_GOSSIP_MENU ();
2008-10-21 13:19:26 -05:00
break ;
case GOSSIP_ACTION_INFO_DEF + 6 :
2009-08-14 00:02:13 +02:00
pPlayer -> CastSpell ( pPlayer , S_LEARN_AXE , true );
pPlayer -> CLOSE_GOSSIP_MENU ();
2008-10-21 13:19:26 -05:00
break ;
case GOSSIP_ACTION_INFO_DEF + 7 :
2009-08-14 00:02:13 +02:00
pPlayer -> CastSpell ( pPlayer , S_LEARN_SWORD , true );
pPlayer -> CLOSE_GOSSIP_MENU ();
2008-10-21 13:19:26 -05:00
break ;
//Unlearn Hammer/Axe/Sword
case GOSSIP_ACTION_INFO_DEF + 8 :
2009-08-14 00:02:13 +02:00
if ( EquippedOk ( pPlayer , S_UNLEARN_HAMMER ))
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:02:13 +02:00
if ( pPlayer -> GetMoney () >= DoMedUnlearnCost ( pPlayer ))
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:02:13 +02:00
pPlayer -> CastSpell ( pPlayer , S_UNLEARN_HAMMER , true );
ProfessionUnlearnSpells ( pPlayer , S_UNLEARN_HAMMER );
pPlayer -> ModifyMoney ( - DoMedUnlearnCost ( pPlayer ));
2008-10-21 13:19:26 -05:00
} else
2009-08-14 00:39:07 +02:00
pPlayer -> SendBuyError ( BUY_ERR_NOT_ENOUGHT_MONEY , pCreature , 0 , 0 );
2008-10-21 13:19:26 -05:00
} else
2009-08-14 00:02:13 +02:00
pPlayer -> SendEquipError ( EQUIP_ERR_CANT_DO_RIGHT_NOW , NULL , NULL );
pPlayer -> CLOSE_GOSSIP_MENU ();
2008-10-21 13:19:26 -05:00
break ;
case GOSSIP_ACTION_INFO_DEF + 9 :
2009-08-14 00:02:13 +02:00
if ( EquippedOk ( pPlayer , S_UNLEARN_AXE ))
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:02:13 +02:00
if ( pPlayer -> GetMoney () >= DoMedUnlearnCost ( pPlayer ))
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:02:13 +02:00
pPlayer -> CastSpell ( pPlayer , S_UNLEARN_AXE , true );
ProfessionUnlearnSpells ( pPlayer , S_UNLEARN_AXE );
pPlayer -> ModifyMoney ( - DoMedUnlearnCost ( pPlayer ));
2008-10-21 13:19:26 -05:00
} else
2009-08-14 00:39:07 +02:00
pPlayer -> SendBuyError ( BUY_ERR_NOT_ENOUGHT_MONEY , pCreature , 0 , 0 );
2008-10-21 13:19:26 -05:00
} else
2009-08-14 00:02:13 +02:00
pPlayer -> SendEquipError ( EQUIP_ERR_CANT_DO_RIGHT_NOW , NULL , NULL );
pPlayer -> CLOSE_GOSSIP_MENU ();
2008-10-21 13:19:26 -05:00
break ;
case GOSSIP_ACTION_INFO_DEF + 10 :
2009-08-14 00:02:13 +02:00
if ( EquippedOk ( pPlayer , S_UNLEARN_SWORD ))
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:02:13 +02:00
if ( pPlayer -> GetMoney () >= DoMedUnlearnCost ( pPlayer ))
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:02:13 +02:00
pPlayer -> CastSpell ( pPlayer , S_UNLEARN_SWORD , true );
ProfessionUnlearnSpells ( pPlayer , S_UNLEARN_SWORD );
pPlayer -> ModifyMoney ( - DoMedUnlearnCost ( pPlayer ));
2008-10-21 13:19:26 -05:00
} else
2009-08-14 00:39:07 +02:00
pPlayer -> SendBuyError ( BUY_ERR_NOT_ENOUGHT_MONEY , pCreature , 0 , 0 );
2008-10-21 13:19:26 -05:00
} else
2009-08-14 00:02:13 +02:00
pPlayer -> SendEquipError ( EQUIP_ERR_CANT_DO_RIGHT_NOW , NULL , NULL );
pPlayer -> CLOSE_GOSSIP_MENU ();
2008-10-21 13:19:26 -05:00
break ;
}
}
2009-10-17 15:51:44 -07:00
2009-08-15 00:32:04 +02:00
void SendConfirmLearn_npc_prof_blacksmith ( Player * pPlayer , Creature * pCreature , uint32 uiAction )
2008-10-21 13:19:26 -05:00
{
2009-08-15 00:32:04 +02:00
if ( uiAction )
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:39:07 +02:00
uint32 eCreature = pCreature -> GetEntry ();
2008-10-21 13:19:26 -05:00
switch ( eCreature )
{
case 11191 :
2009-08-15 00:32:04 +02:00
pPlayer -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_LEARN_HAMMER , GOSSIP_SENDER_CHECK , uiAction );
2008-10-21 13:19:26 -05:00
//unknown textID (TALK_HAMMER_LEARN)
2009-12-20 13:35:08 +02:00
pPlayer -> SEND_GOSSIP_MENU ( pPlayer -> GetGossipTextId ( pCreature ), pCreature -> GetGUID ());
2008-10-21 13:19:26 -05:00
break ;
case 11192 :
2009-08-15 00:32:04 +02:00
pPlayer -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_LEARN_AXE , GOSSIP_SENDER_CHECK , uiAction );
2008-10-21 13:19:26 -05:00
//unknown textID (TALK_AXE_LEARN)
2009-12-20 13:35:08 +02:00
pPlayer -> SEND_GOSSIP_MENU ( pPlayer -> GetGossipTextId ( pCreature ), pCreature -> GetGUID ());
2008-10-21 13:19:26 -05:00
break ;
case 11193 :
2009-08-15 00:32:04 +02:00
pPlayer -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_LEARN_SWORD , GOSSIP_SENDER_CHECK , uiAction );
2008-10-21 13:19:26 -05:00
//unknown textID (TALK_SWORD_LEARN)
2009-12-20 13:35:08 +02:00
pPlayer -> SEND_GOSSIP_MENU ( pPlayer -> GetGossipTextId ( pCreature ), pCreature -> GetGUID ());
2008-10-21 13:19:26 -05:00
break ;
}
}
}
2009-10-17 15:51:44 -07:00
2009-08-15 00:32:04 +02:00
void SendConfirmUnlearn_npc_prof_blacksmith ( Player * pPlayer , Creature * pCreature , uint32 uiAction )
2008-10-21 13:19:26 -05:00
{
2009-08-15 00:32:04 +02:00
if ( uiAction )
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:39:07 +02:00
uint32 eCreature = pCreature -> GetEntry ();
2008-10-21 13:19:26 -05:00
switch ( eCreature )
{
case 11146 : //Ironus Coldsteel
case 11178 : //Borgosh Corebender
case 5164 : //Grumnus Steelshaper
case 11177 : //Okothos Ironrager
2009-08-15 00:32:04 +02:00
pPlayer -> ADD_GOSSIP_ITEM_EXTENDED ( 0 , GOSSIP_UNLEARN_SMITH_SPEC , GOSSIP_SENDER_CHECK , uiAction , BOX_UNLEARN_ARMORORWEAPON , DoLowUnlearnCost ( pPlayer ), false );
2008-10-21 13:19:26 -05:00
//unknown textID (TALK_UNLEARN_AXEORWEAPON)
2009-12-20 13:35:08 +02:00
pPlayer -> SEND_GOSSIP_MENU ( pPlayer -> GetGossipTextId ( pCreature ), pCreature -> GetGUID ());
2008-10-21 13:19:26 -05:00
break ;
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
case 11191 :
2009-08-15 00:32:04 +02:00
pPlayer -> ADD_GOSSIP_ITEM_EXTENDED ( 0 , GOSSIP_UNLEARN_HAMMER , GOSSIP_SENDER_CHECK , uiAction , BOX_UNLEARN_WEAPON_SPEC , DoMedUnlearnCost ( pPlayer ), false );
2008-10-21 13:19:26 -05:00
//unknown textID (TALK_HAMMER_UNLEARN)
2009-12-20 13:35:08 +02:00
pPlayer -> SEND_GOSSIP_MENU ( pPlayer -> GetGossipTextId ( pCreature ), pCreature -> GetGUID ());
2008-10-21 13:19:26 -05:00
break ;
case 11192 :
2009-08-15 00:32:04 +02:00
pPlayer -> ADD_GOSSIP_ITEM_EXTENDED ( 0 , GOSSIP_UNLEARN_AXE , GOSSIP_SENDER_CHECK , uiAction , BOX_UNLEARN_WEAPON_SPEC , DoMedUnlearnCost ( pPlayer ), false );
2008-10-21 13:19:26 -05:00
//unknown textID (TALK_AXE_UNLEARN)
2009-12-20 13:35:08 +02:00
pPlayer -> SEND_GOSSIP_MENU ( pPlayer -> GetGossipTextId ( pCreature ), pCreature -> GetGUID ());
2008-10-21 13:19:26 -05:00
break ;
case 11193 :
2009-08-15 00:32:04 +02:00
pPlayer -> ADD_GOSSIP_ITEM_EXTENDED ( 0 , GOSSIP_UNLEARN_SWORD , GOSSIP_SENDER_CHECK , uiAction , BOX_UNLEARN_WEAPON_SPEC , DoMedUnlearnCost ( pPlayer ), false );
2008-10-21 13:19:26 -05:00
//unknown textID (TALK_SWORD_UNLEARN)
2009-12-20 13:35:08 +02:00
pPlayer -> SEND_GOSSIP_MENU ( pPlayer -> GetGossipTextId ( pCreature ), pCreature -> GetGUID ());
2008-10-21 13:19:26 -05:00
break ;
}
}
}
2009-10-17 15:51:44 -07:00
2009-08-15 00:32:04 +02:00
bool GossipSelect_npc_prof_blacksmith ( Player * pPlayer , Creature * pCreature , uint32 uiSender , uint32 uiAction )
2008-10-21 13:19:26 -05:00
{
2009-08-15 00:32:04 +02:00
switch ( uiSender )
2008-10-21 13:19:26 -05:00
{
2009-08-15 00:32:04 +02:00
case GOSSIP_SENDER_MAIN : SendActionMenu_npc_prof_blacksmith ( pPlayer , pCreature , uiAction ); break ;
case GOSSIP_SENDER_LEARN : SendConfirmLearn_npc_prof_blacksmith ( pPlayer , pCreature , uiAction ); break ;
case GOSSIP_SENDER_UNLEARN : SendConfirmUnlearn_npc_prof_blacksmith ( pPlayer , pCreature , uiAction ); break ;
case GOSSIP_SENDER_CHECK : SendActionMenu_npc_prof_blacksmith ( pPlayer , pCreature , uiAction ); break ;
2008-10-21 13:19:26 -05:00
}
return true ;
}
2009-10-17 15:51:44 -07:00
2009-08-14 00:39:07 +02:00
/*bool QuestComplete_npc_prof_blacksmith(Player* pPlayer, Creature* pCreature, Quest const *_Quest)
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:02:13 +02:00
if ((_Quest->GetQuestId() == 5283) || (_Quest->GetQuestId() == 5301)) //armorsmith
2009-08-14 00:39:07 +02:00
pCreature->CastSpell(pPlayer, 17451, true);
2009-10-17 15:51:44 -07:00
2009-08-14 00:02:13 +02:00
if ((_Quest->GetQuestId() == 5284) || (_Quest->GetQuestId() == 5302)) //weaponsmith
2009-08-14 00:39:07 +02:00
pCreature->CastSpell(pPlayer, 17452, true);
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
return true;
}*/
2009-10-17 15:51:44 -07:00
2009-05-31 22:49:30 +02:00
/*###
# engineering trinkets
###*/
2009-10-17 15:51:44 -07:00
2009-10-17 07:42:48 -07:00
enum eEngineeringTrinkets
2009-05-31 22:49:30 +02:00
{
NPC_ZAP = 14742 ,
NPC_JHORDY = 14743 ,
NPC_KABLAM = 21493 ,
NPC_SMILES = 21494 ,
2009-10-17 15:51:44 -07:00
2009-05-31 22:49:30 +02:00
SPELL_LEARN_TO_EVERLOOK = 23490 ,
SPELL_LEARN_TO_GADGET = 23491 ,
SPELL_LEARN_TO_AREA52 = 36956 ,
SPELL_LEARN_TO_TOSHLEY = 36957 ,
2009-10-17 15:51:44 -07:00
2009-05-31 22:49:30 +02:00
SPELL_TO_EVERLOOK = 23486 ,
SPELL_TO_GADGET = 23489 ,
SPELL_TO_AREA52 = 36954 ,
SPELL_TO_TOSHLEY = 36955 ,
2009-10-17 15:51:44 -07:00
2009-05-31 22:49:30 +02:00
ITEM_GNOMISH_CARD = 10790 ,
ITEM_GOBLIN_CARD = 10791
};
2009-10-17 15:51:44 -07:00
2009-05-31 22:49:30 +02:00
#define GOSSIP_ITEM_ZAP "[PH] Unknown"
#define GOSSIP_ITEM_JHORDY "I must build a beacon for this marvelous device!"
#define GOSSIP_ITEM_KABLAM "[PH] Unknown"
#define GOSSIP_ITEM_SMILES "[PH] Unknown"
2009-10-17 15:51:44 -07:00
2009-05-31 22:49:30 +02:00
bool GossipHello_npc_engineering_tele_trinket ( Player * pPlayer , Creature * pCreature )
{
uint32 NpcTextId = 0 ;
std :: string GossipItem ;
bool CanLearn = false ;
2009-10-17 15:51:44 -07:00
2009-08-14 00:02:13 +02:00
if ( pPlayer -> HasSkill ( SKILL_ENGINERING ))
2009-05-31 22:49:30 +02:00
{
switch ( pCreature -> GetEntry ())
{
case NPC_ZAP :
NpcTextId = 7249 ;
2009-08-14 00:02:13 +02:00
if ( pPlayer -> GetBaseSkillValue ( SKILL_ENGINERING ) >= 260 && pPlayer -> HasSpell ( S_GOBLIN ))
2009-05-31 22:49:30 +02:00
{
2009-08-14 00:02:13 +02:00
if ( ! pPlayer -> HasSpell ( SPELL_TO_EVERLOOK ))
2009-05-31 22:49:30 +02:00
{
CanLearn = true ;
GossipItem = GOSSIP_ITEM_ZAP ;
}
2009-08-14 00:02:13 +02:00
else if ( pPlayer -> HasSpell ( SPELL_TO_EVERLOOK ))
2009-05-31 22:49:30 +02:00
NpcTextId = 0 ;
}
break ;
case NPC_JHORDY :
NpcTextId = 7251 ;
2009-08-14 00:02:13 +02:00
if ( pPlayer -> GetBaseSkillValue ( SKILL_ENGINERING ) >= 260 && pPlayer -> HasSpell ( S_GNOMISH ))
2009-05-31 22:49:30 +02:00
{
2009-08-14 00:02:13 +02:00
if ( ! pPlayer -> HasSpell ( SPELL_TO_GADGET ))
2009-05-31 22:49:30 +02:00
{
CanLearn = true ;
GossipItem = GOSSIP_ITEM_JHORDY ;
}
2009-08-14 00:02:13 +02:00
else if ( pPlayer -> HasSpell ( SPELL_TO_GADGET ))
2009-05-31 22:49:30 +02:00
NpcTextId = 7252 ;
}
break ;
case NPC_KABLAM :
NpcTextId = 10365 ;
2009-08-14 00:02:13 +02:00
if ( pPlayer -> GetBaseSkillValue ( SKILL_ENGINERING ) >= 350 && pPlayer -> HasSpell ( S_GOBLIN ))
2009-05-31 22:49:30 +02:00
{
2009-08-14 00:02:13 +02:00
if ( ! pPlayer -> HasSpell ( SPELL_TO_AREA52 ))
2009-05-31 22:49:30 +02:00
{
CanLearn = true ;
GossipItem = GOSSIP_ITEM_KABLAM ;
}
2009-08-14 00:02:13 +02:00
else if ( pPlayer -> HasSpell ( SPELL_TO_AREA52 ))
2009-05-31 22:49:30 +02:00
NpcTextId = 0 ;
}
break ;
case NPC_SMILES :
NpcTextId = 10363 ;
2009-08-14 00:02:13 +02:00
if ( pPlayer -> GetBaseSkillValue ( SKILL_ENGINERING ) >= 350 && pPlayer -> HasSpell ( S_GNOMISH ))
2009-05-31 22:49:30 +02:00
{
2009-08-14 00:02:13 +02:00
if ( ! pPlayer -> HasSpell ( SPELL_TO_TOSHLEY ))
2009-05-31 22:49:30 +02:00
{
CanLearn = true ;
GossipItem = GOSSIP_ITEM_SMILES ;
}
2009-08-14 00:02:13 +02:00
else if ( pPlayer -> HasSpell ( SPELL_TO_TOSHLEY ))
2009-05-31 22:49:30 +02:00
NpcTextId = 0 ;
}
break ;
}
}
2009-10-17 15:51:44 -07:00
2009-08-14 00:02:13 +02:00
if ( CanLearn )
2009-05-31 22:49:30 +02:00
{
2009-08-14 00:02:13 +02:00
if ( pPlayer -> HasItemCount ( ITEM_GOBLIN_CARD , 1 ) || pPlayer -> HasItemCount ( ITEM_GNOMISH_CARD , 1 ))
2009-05-31 22:49:30 +02:00
pPlayer -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GossipItem , pCreature -> GetEntry (), GOSSIP_ACTION_INFO_DEF + 1 );
}
2009-10-17 15:51:44 -07:00
2009-12-20 13:35:08 +02:00
pPlayer -> SEND_GOSSIP_MENU ( NpcTextId ? NpcTextId : pPlayer -> GetGossipTextId ( pCreature ), pCreature -> GetGUID ());
2009-05-31 22:49:30 +02:00
return true ;
}
2009-10-17 15:51:44 -07:00
2009-08-15 00:32:04 +02:00
bool GossipSelect_npc_engineering_tele_trinket ( Player * pPlayer , Creature * pCreature , uint32 uiSender , uint32 uiAction )
2009-05-31 22:49:30 +02:00
{
2009-08-15 00:32:04 +02:00
if ( uiAction == GOSSIP_ACTION_INFO_DEF + 1 )
2009-05-31 22:49:30 +02:00
pPlayer -> CLOSE_GOSSIP_MENU ();
2009-10-17 15:51:44 -07:00
2009-08-15 00:32:04 +02:00
if ( uiSender != pCreature -> GetEntry ())
2009-05-31 22:49:30 +02:00
return true ;
2009-10-17 15:51:44 -07:00
2009-08-15 00:32:04 +02:00
switch ( uiSender )
2009-05-31 22:49:30 +02:00
{
case NPC_ZAP :
pPlayer -> CastSpell ( pPlayer , SPELL_LEARN_TO_EVERLOOK , false );
break ;
case NPC_JHORDY :
pPlayer -> CastSpell ( pPlayer , SPELL_LEARN_TO_GADGET , false );
break ;
case NPC_KABLAM :
pPlayer -> CastSpell ( pPlayer , SPELL_LEARN_TO_AREA52 , false );
break ;
case NPC_SMILES :
pPlayer -> CastSpell ( pPlayer , SPELL_LEARN_TO_TOSHLEY , false );
break ;
}
2009-10-17 15:51:44 -07:00
2009-05-31 22:49:30 +02:00
return true ;
}
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
/*###
# start menues leatherworking
###*/
2009-10-17 15:51:44 -07:00
2009-08-14 00:39:07 +02:00
bool GossipHello_npc_prof_leather ( Player * pPlayer , Creature * pCreature )
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:39:07 +02:00
if ( pCreature -> isQuestGiver ())
pPlayer -> PrepareQuestMenu ( pCreature -> GetGUID ());
if ( pCreature -> isVendor ())
2009-08-14 00:02:13 +02:00
pPlayer -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_VENDOR , GOSSIP_TEXT_BROWSE_GOODS , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_TRADE );
2009-08-14 00:39:07 +02:00
if ( pCreature -> isTrainer ())
2009-08-14 00:02:13 +02:00
pPlayer -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_TRAINER , GOSSIP_TEXT_TRAIN , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_TRAIN );
2009-10-17 15:51:44 -07:00
2009-08-14 00:39:07 +02:00
uint32 eCreature = pCreature -> GetEntry ();
2009-10-17 15:51:44 -07:00
2009-08-14 00:02:13 +02:00
if ( pPlayer -> HasSkill ( SKILL_LEATHERWORKING ) && pPlayer -> GetBaseSkillValue ( SKILL_LEATHERWORKING ) >= 250 && pPlayer -> getLevel () > 49 )
2008-10-21 13:19:26 -05:00
{
switch ( eCreature )
{
case 7866 : //Peter Galen
case 7867 : //Thorkaf Dragoneye
2009-08-14 00:02:13 +02:00
if ( pPlayer -> HasSpell ( S_DRAGON ))
pPlayer -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_UNLEARN_DRAGON , GOSSIP_SENDER_UNLEARN , GOSSIP_ACTION_INFO_DEF + 1 );
2008-10-21 13:19:26 -05:00
break ;
case 7868 : //Sarah Tanner
case 7869 : //Brumn Winterhoof
2009-08-14 00:02:13 +02:00
if ( pPlayer -> HasSpell ( S_ELEMENTAL ))
pPlayer -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_UNLEARN_ELEMENTAL , GOSSIP_SENDER_UNLEARN , GOSSIP_ACTION_INFO_DEF + 2 );
2008-10-21 13:19:26 -05:00
break ;
case 7870 : //Caryssia Moonhunter
case 7871 : //Se'Jib
2009-08-14 00:02:13 +02:00
if ( pPlayer -> HasSpell ( S_TRIBAL ))
pPlayer -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_UNLEARN_TRIBAL , GOSSIP_SENDER_UNLEARN , GOSSIP_ACTION_INFO_DEF + 3 );
2008-10-21 13:19:26 -05:00
break ;
}
}
2009-10-17 15:51:44 -07:00
2009-12-20 13:35:08 +02:00
pPlayer -> SEND_GOSSIP_MENU ( pPlayer -> GetGossipTextId ( pCreature ), pCreature -> GetGUID ());
2008-10-21 13:19:26 -05:00
return true ;
}
2009-10-17 15:51:44 -07:00
2009-08-15 00:32:04 +02:00
void SendActionMenu_npc_prof_leather ( Player * pPlayer , Creature * pCreature , uint32 uiAction )
2008-10-21 13:19:26 -05:00
{
2009-08-15 00:32:04 +02:00
switch ( uiAction )
2008-10-21 13:19:26 -05:00
{
case GOSSIP_ACTION_TRADE :
2009-08-14 00:39:07 +02:00
pPlayer -> SEND_VENDORLIST ( pCreature -> GetGUID ());
2008-10-21 13:19:26 -05:00
break ;
case GOSSIP_ACTION_TRAIN :
2009-08-14 00:39:07 +02:00
pPlayer -> SEND_TRAINERLIST ( pCreature -> GetGUID ());
2008-10-21 13:19:26 -05:00
break ;
//Unlearn Leather
case GOSSIP_ACTION_INFO_DEF + 1 :
2009-08-14 00:02:13 +02:00
if ( EquippedOk ( pPlayer , S_UNLEARN_DRAGON ))
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:02:13 +02:00
if ( pPlayer -> GetMoney () >= DoMedUnlearnCost ( pPlayer ))
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:02:13 +02:00
pPlayer -> CastSpell ( pPlayer , S_UNLEARN_DRAGON , true );
ProfessionUnlearnSpells ( pPlayer , S_UNLEARN_DRAGON );
pPlayer -> ModifyMoney ( - DoMedUnlearnCost ( pPlayer ));
2008-10-21 13:19:26 -05:00
} else
2009-08-14 00:39:07 +02:00
pPlayer -> SendBuyError ( BUY_ERR_NOT_ENOUGHT_MONEY , pCreature , 0 , 0 );
2008-10-21 13:19:26 -05:00
} else
2009-08-14 00:02:13 +02:00
pPlayer -> SendEquipError ( EQUIP_ERR_CANT_DO_RIGHT_NOW , NULL , NULL );
pPlayer -> CLOSE_GOSSIP_MENU ();
2008-10-21 13:19:26 -05:00
break ;
case GOSSIP_ACTION_INFO_DEF + 2 :
2009-08-14 00:02:13 +02:00
if ( EquippedOk ( pPlayer , S_UNLEARN_ELEMENTAL ))
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:02:13 +02:00
if ( pPlayer -> GetMoney () >= DoMedUnlearnCost ( pPlayer ))
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:02:13 +02:00
pPlayer -> CastSpell ( pPlayer , S_UNLEARN_ELEMENTAL , true );
ProfessionUnlearnSpells ( pPlayer , S_UNLEARN_ELEMENTAL );
pPlayer -> ModifyMoney ( - DoMedUnlearnCost ( pPlayer ));
2008-10-21 13:19:26 -05:00
} else
2009-08-14 00:39:07 +02:00
pPlayer -> SendBuyError ( BUY_ERR_NOT_ENOUGHT_MONEY , pCreature , 0 , 0 );
2008-10-21 13:19:26 -05:00
} else
2009-08-14 00:02:13 +02:00
pPlayer -> SendEquipError ( EQUIP_ERR_CANT_DO_RIGHT_NOW , NULL , NULL );
pPlayer -> CLOSE_GOSSIP_MENU ();
2008-10-21 13:19:26 -05:00
break ;
case GOSSIP_ACTION_INFO_DEF + 3 :
2009-08-14 00:02:13 +02:00
if ( EquippedOk ( pPlayer , S_UNLEARN_TRIBAL ))
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:02:13 +02:00
if ( pPlayer -> GetMoney () >= DoMedUnlearnCost ( pPlayer ))
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:02:13 +02:00
pPlayer -> CastSpell ( pPlayer , S_UNLEARN_TRIBAL , true );
ProfessionUnlearnSpells ( pPlayer , S_UNLEARN_TRIBAL );
pPlayer -> ModifyMoney ( - DoMedUnlearnCost ( pPlayer ));
2008-10-21 13:19:26 -05:00
} else
2009-08-14 00:39:07 +02:00
pPlayer -> SendBuyError ( BUY_ERR_NOT_ENOUGHT_MONEY , pCreature , 0 , 0 );
2008-10-21 13:19:26 -05:00
} else
2009-08-14 00:02:13 +02:00
pPlayer -> SendEquipError ( EQUIP_ERR_CANT_DO_RIGHT_NOW , NULL , NULL );
pPlayer -> CLOSE_GOSSIP_MENU ();
2008-10-21 13:19:26 -05:00
break ;
}
}
2009-10-17 15:51:44 -07:00
2009-08-15 00:32:04 +02:00
void SendConfirmUnlearn_npc_prof_leather ( Player * pPlayer , Creature * pCreature , uint32 uiAction )
2008-10-21 13:19:26 -05:00
{
2009-08-15 00:32:04 +02:00
if ( uiAction )
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:39:07 +02:00
uint32 eCreature = pCreature -> GetEntry ();
2008-10-21 13:19:26 -05:00
switch ( eCreature )
{
case 7866 : //Peter Galen
case 7867 : //Thorkaf Dragoneye
2009-08-15 00:32:04 +02:00
pPlayer -> ADD_GOSSIP_ITEM_EXTENDED ( 0 , GOSSIP_UNLEARN_DRAGON , GOSSIP_SENDER_CHECK , uiAction , BOX_UNLEARN_LEATHER_SPEC , DoMedUnlearnCost ( pPlayer ), false );
2008-10-21 13:19:26 -05:00
//unknown textID ()
2009-12-20 13:35:08 +02:00
pPlayer -> SEND_GOSSIP_MENU ( pPlayer -> GetGossipTextId ( pCreature ), pCreature -> GetGUID ());
2008-10-21 13:19:26 -05:00
break ;
case 7868 : //Sarah Tanner
case 7869 : //Brumn Winterhoof
2009-08-15 00:32:04 +02:00
pPlayer -> ADD_GOSSIP_ITEM_EXTENDED ( 0 , GOSSIP_UNLEARN_ELEMENTAL , GOSSIP_SENDER_CHECK , uiAction , BOX_UNLEARN_LEATHER_SPEC , DoMedUnlearnCost ( pPlayer ), false );
2008-10-21 13:19:26 -05:00
//unknown textID ()
2009-12-20 13:35:08 +02:00
pPlayer -> SEND_GOSSIP_MENU ( pPlayer -> GetGossipTextId ( pCreature ), pCreature -> GetGUID ());
2008-10-21 13:19:26 -05:00
break ;
case 7870 : //Caryssia Moonhunter
case 7871 : //Se'Jib
2009-08-15 00:32:04 +02:00
pPlayer -> ADD_GOSSIP_ITEM_EXTENDED ( 0 , GOSSIP_UNLEARN_TRIBAL , GOSSIP_SENDER_CHECK , uiAction , BOX_UNLEARN_LEATHER_SPEC , DoMedUnlearnCost ( pPlayer ), false );
2008-10-21 13:19:26 -05:00
//unknown textID ()
2009-12-20 13:35:08 +02:00
pPlayer -> SEND_GOSSIP_MENU ( pPlayer -> GetGossipTextId ( pCreature ), pCreature -> GetGUID ());
2008-10-21 13:19:26 -05:00
break ;
}
}
}
2009-10-17 15:51:44 -07:00
2009-08-15 00:32:04 +02:00
bool GossipSelect_npc_prof_leather ( Player * pPlayer , Creature * pCreature , uint32 uiSender , uint32 uiAction )
2008-10-21 13:19:26 -05:00
{
2009-08-15 00:32:04 +02:00
switch ( uiSender )
2008-10-21 13:19:26 -05:00
{
2009-08-15 00:32:04 +02:00
case GOSSIP_SENDER_MAIN : SendActionMenu_npc_prof_leather ( pPlayer , pCreature , uiAction ); break ;
case GOSSIP_SENDER_UNLEARN : SendConfirmUnlearn_npc_prof_leather ( pPlayer , pCreature , uiAction ); break ;
case GOSSIP_SENDER_CHECK : SendActionMenu_npc_prof_leather ( pPlayer , pCreature , uiAction ); break ;
2008-10-21 13:19:26 -05:00
}
return true ;
}
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
/*###
# start menues tailoring
###*/
2009-10-17 15:51:44 -07:00
2009-08-14 00:02:13 +02:00
bool HasTailorSpell ( Player * pPlayer )
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:02:13 +02:00
if ( pPlayer -> HasSpell ( S_MOONCLOTH ) || pPlayer -> HasSpell ( S_SHADOWEAVE ) || pPlayer -> HasSpell ( S_SPELLFIRE ))
2008-10-21 13:19:26 -05:00
return true ;
return false ;
}
2009-10-17 15:51:44 -07:00
2009-08-14 00:39:07 +02:00
bool GossipHello_npc_prof_tailor ( Player * pPlayer , Creature * pCreature )
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:39:07 +02:00
if ( pCreature -> isQuestGiver ())
pPlayer -> PrepareQuestMenu ( pCreature -> GetGUID ());
if ( pCreature -> isVendor ())
2009-08-14 00:02:13 +02:00
pPlayer -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_VENDOR , GOSSIP_TEXT_BROWSE_GOODS , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_TRADE );
2009-08-14 00:39:07 +02:00
if ( pCreature -> isTrainer ())
2009-08-14 00:02:13 +02:00
pPlayer -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_TRAINER , GOSSIP_TEXT_TRAIN , GOSSIP_SENDER_MAIN , GOSSIP_ACTION_TRAIN );
2009-10-17 15:51:44 -07:00
2009-08-14 00:39:07 +02:00
uint32 eCreature = pCreature -> GetEntry ();
2008-10-21 13:19:26 -05:00
//TAILORING SPEC
2009-08-14 00:02:13 +02:00
if ( pPlayer -> HasSkill ( SKILL_TAILORING ) && pPlayer -> GetBaseSkillValue ( SKILL_TAILORING ) >= 350 && pPlayer -> getLevel () > 59 )
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:02:13 +02:00
if ( pPlayer -> GetQuestRewardStatus ( 10831 ) || pPlayer -> GetQuestRewardStatus ( 10832 ) || pPlayer -> GetQuestRewardStatus ( 10833 ))
2008-10-21 13:19:26 -05:00
{
switch ( eCreature )
{
case 22213 : //Gidge Spellweaver
2009-08-14 00:02:13 +02:00
if ( ! HasTailorSpell ( pPlayer ))
pPlayer -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_LEARN_SPELLFIRE , GOSSIP_SENDER_LEARN , GOSSIP_ACTION_INFO_DEF + 1 );
if ( pPlayer -> HasSpell ( S_SPELLFIRE ))
pPlayer -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_UNLEARN_SPELLFIRE , GOSSIP_SENDER_UNLEARN , GOSSIP_ACTION_INFO_DEF + 4 );
2008-10-21 13:19:26 -05:00
break ;
case 22208 : //Nasmara Moonsong
2009-08-14 00:02:13 +02:00
if ( ! HasTailorSpell ( pPlayer ))
pPlayer -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_LEARN_MOONCLOTH , GOSSIP_SENDER_LEARN , GOSSIP_ACTION_INFO_DEF + 2 );
if ( pPlayer -> HasSpell ( S_MOONCLOTH ))
pPlayer -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_UNLEARN_MOONCLOTH , GOSSIP_SENDER_UNLEARN , GOSSIP_ACTION_INFO_DEF + 5 );
2008-10-21 13:19:26 -05:00
break ;
case 22212 : //Andrion Darkspinner
2009-08-14 00:02:13 +02:00
if ( ! HasTailorSpell ( pPlayer ))
pPlayer -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_LEARN_SHADOWEAVE , GOSSIP_SENDER_LEARN , GOSSIP_ACTION_INFO_DEF + 3 );
if ( pPlayer -> HasSpell ( S_SHADOWEAVE ))
pPlayer -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_UNLEARN_SHADOWEAVE , GOSSIP_SENDER_UNLEARN , GOSSIP_ACTION_INFO_DEF + 6 );
2008-10-21 13:19:26 -05:00
break ;
}
}
}
2009-10-17 15:51:44 -07:00
2009-12-20 13:35:08 +02:00
pPlayer -> SEND_GOSSIP_MENU ( pPlayer -> GetGossipTextId ( pCreature ), pCreature -> GetGUID ());
2008-10-21 13:19:26 -05:00
return true ;
}
2009-10-17 15:51:44 -07:00
2009-08-15 00:32:04 +02:00
void SendActionMenu_npc_prof_tailor ( Player * pPlayer , Creature * pCreature , uint32 uiAction )
2008-10-21 13:19:26 -05:00
{
2009-08-15 00:32:04 +02:00
switch ( uiAction )
2008-10-21 13:19:26 -05:00
{
case GOSSIP_ACTION_TRADE :
2009-08-14 00:39:07 +02:00
pPlayer -> SEND_VENDORLIST ( pCreature -> GetGUID ());
2008-10-21 13:19:26 -05:00
break ;
case GOSSIP_ACTION_TRAIN :
2009-08-14 00:39:07 +02:00
pPlayer -> SEND_TRAINERLIST ( pCreature -> GetGUID ());
2008-10-21 13:19:26 -05:00
break ;
//Learn Tailor
case GOSSIP_ACTION_INFO_DEF + 1 :
2009-08-14 00:02:13 +02:00
if ( ! pPlayer -> HasSpell ( S_SPELLFIRE ) && pPlayer -> GetMoney () >= DoLearnCost ( pPlayer ))
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:02:13 +02:00
pPlayer -> CastSpell ( pPlayer , S_LEARN_SPELLFIRE , true );
pPlayer -> ModifyMoney ( - DoLearnCost ( pPlayer ));
2008-10-21 13:19:26 -05:00
} else
2009-08-14 00:39:07 +02:00
pPlayer -> SendBuyError ( BUY_ERR_NOT_ENOUGHT_MONEY , pCreature , 0 , 0 );
2009-08-14 00:02:13 +02:00
pPlayer -> CLOSE_GOSSIP_MENU ();
2008-10-21 13:19:26 -05:00
break ;
case GOSSIP_ACTION_INFO_DEF + 2 :
2009-08-14 00:02:13 +02:00
if ( ! pPlayer -> HasSpell ( S_MOONCLOTH ) && pPlayer -> GetMoney () >= DoLearnCost ( pPlayer ))
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:02:13 +02:00
pPlayer -> CastSpell ( pPlayer , S_LEARN_MOONCLOTH , true );
pPlayer -> ModifyMoney ( - DoLearnCost ( pPlayer ));
2008-10-21 13:19:26 -05:00
} else
2009-08-14 00:39:07 +02:00
pPlayer -> SendBuyError ( BUY_ERR_NOT_ENOUGHT_MONEY , pCreature , 0 , 0 );
2009-08-14 00:02:13 +02:00
pPlayer -> CLOSE_GOSSIP_MENU ();
2008-10-21 13:19:26 -05:00
break ;
case GOSSIP_ACTION_INFO_DEF + 3 :
2009-08-14 00:02:13 +02:00
if ( ! pPlayer -> HasSpell ( S_SHADOWEAVE ) && pPlayer -> GetMoney () >= DoLearnCost ( pPlayer ))
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:02:13 +02:00
pPlayer -> CastSpell ( pPlayer , S_LEARN_SHADOWEAVE , true );
pPlayer -> ModifyMoney ( - DoLearnCost ( pPlayer ));
2008-10-21 13:19:26 -05:00
} else
2009-08-14 00:39:07 +02:00
pPlayer -> SendBuyError ( BUY_ERR_NOT_ENOUGHT_MONEY , pCreature , 0 , 0 );
2009-08-14 00:02:13 +02:00
pPlayer -> CLOSE_GOSSIP_MENU ();
2008-10-21 13:19:26 -05:00
break ;
//Unlearn Tailor
case GOSSIP_ACTION_INFO_DEF + 4 :
2009-08-14 00:02:13 +02:00
if ( EquippedOk ( pPlayer , S_UNLEARN_SPELLFIRE ))
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:02:13 +02:00
if ( pPlayer -> GetMoney () >= DoHighUnlearnCost ( pPlayer ))
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:02:13 +02:00
pPlayer -> CastSpell ( pPlayer , S_UNLEARN_SPELLFIRE , true );
ProfessionUnlearnSpells ( pPlayer , S_UNLEARN_SPELLFIRE );
pPlayer -> ModifyMoney ( - DoHighUnlearnCost ( pPlayer ));
2008-10-21 13:19:26 -05:00
} else
2009-08-14 00:39:07 +02:00
pPlayer -> SendBuyError ( BUY_ERR_NOT_ENOUGHT_MONEY , pCreature , 0 , 0 );
2008-10-21 13:19:26 -05:00
} else
2009-08-14 00:02:13 +02:00
pPlayer -> SendEquipError ( EQUIP_ERR_CANT_DO_RIGHT_NOW , NULL , NULL );
pPlayer -> CLOSE_GOSSIP_MENU ();
2008-10-21 13:19:26 -05:00
break ;
case GOSSIP_ACTION_INFO_DEF + 5 :
2009-08-14 00:02:13 +02:00
if ( EquippedOk ( pPlayer , S_UNLEARN_MOONCLOTH ))
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:02:13 +02:00
if ( pPlayer -> GetMoney () >= DoHighUnlearnCost ( pPlayer ))
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:02:13 +02:00
pPlayer -> CastSpell ( pPlayer , S_UNLEARN_MOONCLOTH , true );
ProfessionUnlearnSpells ( pPlayer , S_UNLEARN_MOONCLOTH );
pPlayer -> ModifyMoney ( - DoHighUnlearnCost ( pPlayer ));
2008-10-21 13:19:26 -05:00
} else
2009-08-14 00:39:07 +02:00
pPlayer -> SendBuyError ( BUY_ERR_NOT_ENOUGHT_MONEY , pCreature , 0 , 0 );
2008-10-21 13:19:26 -05:00
} else
2009-08-14 00:02:13 +02:00
pPlayer -> SendEquipError ( EQUIP_ERR_CANT_DO_RIGHT_NOW , NULL , NULL );
pPlayer -> CLOSE_GOSSIP_MENU ();
2008-10-21 13:19:26 -05:00
break ;
case GOSSIP_ACTION_INFO_DEF + 6 :
2009-08-14 00:02:13 +02:00
if ( EquippedOk ( pPlayer , S_UNLEARN_SHADOWEAVE ))
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:02:13 +02:00
if ( pPlayer -> GetMoney () >= DoHighUnlearnCost ( pPlayer ))
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:02:13 +02:00
pPlayer -> CastSpell ( pPlayer , S_UNLEARN_SHADOWEAVE , true );
ProfessionUnlearnSpells ( pPlayer , S_UNLEARN_SHADOWEAVE );
pPlayer -> ModifyMoney ( - DoHighUnlearnCost ( pPlayer ));
2008-10-21 13:19:26 -05:00
} else
2009-08-14 00:39:07 +02:00
pPlayer -> SendBuyError ( BUY_ERR_NOT_ENOUGHT_MONEY , pCreature , 0 , 0 );
2008-10-21 13:19:26 -05:00
} else
2009-08-14 00:02:13 +02:00
pPlayer -> SendEquipError ( EQUIP_ERR_CANT_DO_RIGHT_NOW , NULL , NULL );
pPlayer -> CLOSE_GOSSIP_MENU ();
2008-10-21 13:19:26 -05:00
break ;
}
}
2009-10-17 15:51:44 -07:00
2009-08-15 00:32:04 +02:00
void SendConfirmLearn_npc_prof_tailor ( Player * pPlayer , Creature * pCreature , uint32 uiAction )
2008-10-21 13:19:26 -05:00
{
2009-08-15 00:32:04 +02:00
if ( uiAction )
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:39:07 +02:00
uint32 eCreature = pCreature -> GetEntry ();
2008-10-21 13:19:26 -05:00
switch ( eCreature )
{
case 22213 :
2009-08-15 00:32:04 +02:00
pPlayer -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_LEARN_SPELLFIRE , GOSSIP_SENDER_CHECK , uiAction );
2008-10-21 13:19:26 -05:00
//unknown textID ()
2009-12-20 13:35:08 +02:00
pPlayer -> SEND_GOSSIP_MENU ( pPlayer -> GetGossipTextId ( pCreature ), pCreature -> GetGUID ());
2008-10-21 13:19:26 -05:00
break ;
case 22208 :
2009-08-15 00:32:04 +02:00
pPlayer -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_LEARN_MOONCLOTH , GOSSIP_SENDER_CHECK , uiAction );
2008-10-21 13:19:26 -05:00
//unknown textID ()
2009-12-20 13:35:08 +02:00
pPlayer -> SEND_GOSSIP_MENU ( pPlayer -> GetGossipTextId ( pCreature ), pCreature -> GetGUID ());
2008-10-21 13:19:26 -05:00
break ;
case 22212 :
2009-08-15 00:32:04 +02:00
pPlayer -> ADD_GOSSIP_ITEM ( GOSSIP_ICON_CHAT , GOSSIP_LEARN_SHADOWEAVE , GOSSIP_SENDER_CHECK , uiAction );
2008-10-21 13:19:26 -05:00
//unknown textID ()
2009-12-20 13:35:08 +02:00
pPlayer -> SEND_GOSSIP_MENU ( pPlayer -> GetGossipTextId ( pCreature ), pCreature -> GetGUID ());
2008-10-21 13:19:26 -05:00
break ;
}
}
}
2009-10-17 15:51:44 -07:00
2009-08-15 00:32:04 +02:00
void SendConfirmUnlearn_npc_prof_tailor ( Player * pPlayer , Creature * pCreature , uint32 uiAction )
2008-10-21 13:19:26 -05:00
{
2009-08-15 00:32:04 +02:00
if ( uiAction )
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:39:07 +02:00
uint32 eCreature = pCreature -> GetEntry ();
2008-10-21 13:19:26 -05:00
switch ( eCreature )
{
case 22213 : //Gidge Spellweaver
2009-08-15 00:32:04 +02:00
pPlayer -> ADD_GOSSIP_ITEM_EXTENDED ( 0 , GOSSIP_UNLEARN_SPELLFIRE , GOSSIP_SENDER_CHECK , uiAction , BOX_UNLEARN_TAILOR_SPEC , DoHighUnlearnCost ( pPlayer ), false );
2008-10-21 13:19:26 -05:00
//unknown textID ()
2009-12-20 13:35:08 +02:00
pPlayer -> SEND_GOSSIP_MENU ( pPlayer -> GetGossipTextId ( pCreature ), pCreature -> GetGUID ());
2008-10-21 13:19:26 -05:00
break ;
case 22208 : //Nasmara Moonsong
2009-08-15 00:32:04 +02:00
pPlayer -> ADD_GOSSIP_ITEM_EXTENDED ( 0 , GOSSIP_UNLEARN_MOONCLOTH , GOSSIP_SENDER_CHECK , uiAction , BOX_UNLEARN_TAILOR_SPEC , DoHighUnlearnCost ( pPlayer ), false );
2008-10-21 13:19:26 -05:00
//unknown textID ()
2009-12-20 13:35:08 +02:00
pPlayer -> SEND_GOSSIP_MENU ( pPlayer -> GetGossipTextId ( pCreature ), pCreature -> GetGUID ());
2008-10-21 13:19:26 -05:00
break ;
case 22212 : //Andrion Darkspinner
2009-08-15 00:32:04 +02:00
pPlayer -> ADD_GOSSIP_ITEM_EXTENDED ( 0 , GOSSIP_UNLEARN_SHADOWEAVE , GOSSIP_SENDER_CHECK , uiAction , BOX_UNLEARN_TAILOR_SPEC , DoHighUnlearnCost ( pPlayer ), false );
2008-10-21 13:19:26 -05:00
//unknown textID ()
2009-12-20 13:35:08 +02:00
pPlayer -> SEND_GOSSIP_MENU ( pPlayer -> GetGossipTextId ( pCreature ), pCreature -> GetGUID ());
2008-10-21 13:19:26 -05:00
break ;
}
}
}
2009-10-17 15:51:44 -07:00
2009-08-15 00:32:04 +02:00
bool GossipSelect_npc_prof_tailor ( Player * pPlayer , Creature * pCreature , uint32 uiSender , uint32 uiAction )
2008-10-21 13:19:26 -05:00
{
2009-08-15 00:32:04 +02:00
switch ( uiSender )
2008-10-21 13:19:26 -05:00
{
2009-08-15 00:32:04 +02:00
case GOSSIP_SENDER_MAIN : SendActionMenu_npc_prof_tailor ( pPlayer , pCreature , uiAction ); break ;
case GOSSIP_SENDER_LEARN : SendConfirmLearn_npc_prof_tailor ( pPlayer , pCreature , uiAction ); break ;
case GOSSIP_SENDER_UNLEARN : SendConfirmUnlearn_npc_prof_tailor ( pPlayer , pCreature , uiAction ); break ;
case GOSSIP_SENDER_CHECK : SendActionMenu_npc_prof_tailor ( pPlayer , pCreature , uiAction ); break ;
2008-10-21 13:19:26 -05:00
}
return true ;
}
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
/*###
# start menues for GO (engineering and leatherworking)
###*/
2009-10-17 15:51:44 -07:00
2009-08-15 00:32:04 +02:00
/*bool GOHello_go_soothsaying_for_dummies(Player* pPlayer, GameObject* pGo)
2008-10-21 13:19:26 -05:00
{
2009-08-14 00:02:13 +02:00
pPlayer->PlayerTalkClass->GetGossipMenu()->AddMenuItem(0,GOSSIP_LEARN_DRAGON, GOSSIP_SENDER_INFO, GOSSIP_ACTION_INFO_DEF, "", 0);
2009-10-17 15:51:44 -07:00
2009-08-15 00:32:04 +02:00
pPlayer->SEND_GOSSIP_MENU(5584, pGo->GetGUID());
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
return true;
}*/
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
/*###
#
###*/
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
void AddSC_npc_professions ()
{
Script * newscript ;
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
newscript = new Script ;
2009-10-17 04:23:24 -07:00
newscript -> Name = "npc_prof_alchemy" ;
2008-10-21 13:19:26 -05:00
newscript -> pGossipHello = & GossipHello_npc_prof_alchemy ;
newscript -> pGossipSelect = & GossipSelect_npc_prof_alchemy ;
2008-11-20 16:16:57 -06:00
newscript -> RegisterSelf ();
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
newscript = new Script ;
2009-10-17 04:23:24 -07:00
newscript -> Name = "npc_prof_blacksmith" ;
2008-10-21 13:19:26 -05:00
newscript -> pGossipHello = & GossipHello_npc_prof_blacksmith ;
newscript -> pGossipSelect = & GossipSelect_npc_prof_blacksmith ;
2008-11-20 16:16:57 -06:00
newscript -> RegisterSelf ();
2009-10-17 15:51:44 -07:00
2009-05-31 22:49:30 +02:00
newscript = new Script ;
newscript -> Name = "npc_engineering_tele_trinket" ;
newscript -> pGossipHello = & GossipHello_npc_engineering_tele_trinket ;
newscript -> pGossipSelect = & GossipSelect_npc_engineering_tele_trinket ;
newscript -> RegisterSelf ();
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
newscript = new Script ;
2009-10-17 04:23:24 -07:00
newscript -> Name = "npc_prof_leather" ;
2008-10-21 13:19:26 -05:00
newscript -> pGossipHello = & GossipHello_npc_prof_leather ;
newscript -> pGossipSelect = & GossipSelect_npc_prof_leather ;
2008-11-20 16:16:57 -06:00
newscript -> RegisterSelf ();
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
newscript = new Script ;
2009-10-17 04:23:24 -07:00
newscript -> Name = "npc_prof_tailor" ;
2008-10-21 13:19:26 -05:00
newscript -> pGossipHello = & GossipHello_npc_prof_tailor ;
newscript -> pGossipSelect = & GossipSelect_npc_prof_tailor ;
2008-11-20 16:16:57 -06:00
newscript -> RegisterSelf ();
2009-10-17 15:51:44 -07:00
2008-10-21 13:19:26 -05:00
/*newscript = new Script;
2009-10-17 04:23:24 -07:00
newscript->Name = "go_soothsaying_for_dummies";
2008-10-21 13:19:26 -05:00
newscript->pGOHello = &GOHello_go_soothsaying_for_dummies;
//newscript->pGossipSelect = &GossipSelect_go_soothsaying_for_dummies;
2008-11-20 16:16:57 -06:00
newscript->RegisterSelf();*/
2008-10-21 13:19:26 -05:00
}
2009-02-17 20:07:49 -06:00