AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
npc_locksmith Class Reference
Inheritance diagram for npc_locksmith:
CreatureScript ScriptObject UpdatableScript< Creature >

Public Member Functions

 npc_locksmith ()
 
bool OnGossipHello (Player *player, Creature *creature) override
 
bool OnGossipSelect (Player *player, Creature *, uint32, uint32 action) override
 
- Public Member Functions inherited from CreatureScript
bool IsDatabaseBound () const override
 
virtual bool OnGossipHello (Player *, Creature *)
 
virtual bool OnGossipSelect (Player *, Creature *, uint32, uint32)
 
virtual bool OnGossipSelectCode (Player *, Creature *, uint32, uint32, const char *)
 
virtual bool OnQuestAccept (Player *, Creature *, Quest const *)
 
virtual bool OnQuestSelect (Player *, Creature *, Quest const *)
 
virtual bool OnQuestComplete (Player *, Creature *, Quest const *)
 
virtual bool OnQuestReward (Player *, Creature *, Quest const *, uint32)
 
virtual uint32 GetDialogStatus (Player *, Creature *)
 
virtual CreatureAIGetAI (Creature *) const
 
virtual void OnFfaPvpStateUpdate (Creature *, bool)
 
- Public Member Functions inherited from ScriptObject
virtual bool IsDatabaseBound () const
 
virtual bool isAfterLoadScript () const
 
virtual void checkValidity ()
 
const std::string & GetName () const
 
- Public Member Functions inherited from UpdatableScript< Creature >
virtual void OnUpdate (Creature *, uint32)
 

Additional Inherited Members

- Protected Member Functions inherited from CreatureScript
 CreatureScript (const char *name)
 
- Protected Member Functions inherited from ScriptObject
 ScriptObject (const char *name)
 
virtual ~ScriptObject ()=default
 
- Protected Member Functions inherited from UpdatableScript< Creature >
 UpdatableScript ()=default
 

Detailed Description

Constructor & Destructor Documentation

◆ npc_locksmith()

npc_locksmith::npc_locksmith ( )
inline
1909: CreatureScript("npc_locksmith") { }
Definition: CreatureScript.h:25

Member Function Documentation

◆ OnGossipHello()

bool npc_locksmith::OnGossipHello ( Player player,
Creature creature 
)
inlineoverridevirtual

Reimplemented from CreatureScript.

1912 {
1913 // Skeleton Key - Scholomance
1915 !player->HasItemCount(ITEM_SKELETON_KEY, 1, true))
1917
1918 // Arcatraz Key
1921
1922 // Shatered Halls Key
1924 !player->HasItemCount(ITEM_SHATTERED_HALLS_KEY, 1, true))
1926
1927 // Searing Gorge Key
1928 if (player->GetQuestRewardStatus(QUEST_AT_LAST) && !player->HasItemCount(ITEM_SEARING_GORGE, 1, true))
1930
1931 // Shadowforge Key
1934
1935 // Eye of Haramad
1938
1939 // Master's Key
1942
1943 // Violet Hold Key
1946
1947 // Essence-Infused Moonstone
1950
1951 SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID());
1952
1953 return true;
1954 }
void SendGossipMenuFor(Player *player, uint32 npcTextID, ObjectGuid const guid)
Definition: ScriptedGossip.cpp:45
void AddGossipItemFor(Player *player, uint32 icon, std::string const &text, uint32 sender, uint32 action)
Definition: ScriptedGossip.cpp:28
@ GOSSIP_SENDER_MAIN
Definition: ScriptedGossip.h:70
@ GOSSIP_ACTION_INFO_DEF
Definition: ScriptedGossip.h:68
@ ITEM_VIOLET_HOLD_KEY
Definition: npcs_special.cpp:1894
@ ITEM_SHADOWFORGE_KEY
Definition: npcs_special.cpp:1879
@ QUEST_CONTAINMENT
Definition: npcs_special.cpp:1893
@ QUEST_RETURN_TO_KHAGDAR
Definition: npcs_special.cpp:1888
@ QUEST_THE_KEY_TO_SCHOLOMANCE_H
Definition: npcs_special.cpp:1857
@ QUEST_HOTTER_THAN_HELL_H
Definition: npcs_special.cpp:1868
@ QUEST_HOW_TO_BRAKE_IN_TO_THE_ARCATRAZ
Definition: npcs_special.cpp:1862
@ ITEM_THE_MASTERS_KEY
Definition: npcs_special.cpp:1889
@ QUEST_DARK_IRON_LEGACY
Definition: npcs_special.cpp:1878
@ QUEST_THE_EYE_OF_HARAMAD
Definition: npcs_special.cpp:1883
@ ITEM_SEARING_GORGE
Definition: npcs_special.cpp:1874
@ QUEST_AT_LAST
Definition: npcs_special.cpp:1873
@ ITEM_ESSENCE_INFUSED_MOONSTONE
Definition: npcs_special.cpp:1899
@ QUEST_THE_KEY_TO_SCHOLOMANCE_A
Definition: npcs_special.cpp:1856
@ GOSSIP_MENU_LOCKSMITH
Definition: npcs_special.cpp:1903
@ QUEST_ETERNAL_VIGILANCE
Definition: npcs_special.cpp:1898
@ ITEM_SKELETON_KEY
Definition: npcs_special.cpp:1858
@ ITEM_SHATTERED_HALLS_KEY
Definition: npcs_special.cpp:1869
@ ITEM_ARCATRAZ_KEY
Definition: npcs_special.cpp:1863
@ QUEST_HOTTER_THAN_HELL_A
Definition: npcs_special.cpp:1867
@ ITEM_EYE_OF_HARAMAD
Definition: npcs_special.cpp:1884
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:106
bool GetQuestRewardStatus(uint32 quest_id) const
Definition: PlayerQuest.cpp:1401
bool HasItemCount(uint32 item, uint32 count=1, bool inBankAlso=false) const
Definition: PlayerStorage.cpp:683
uint32 GetGossipTextId(uint32 menuId, WorldObject *source)
Definition: PlayerGossip.cpp:403

References AddGossipItemFor(), Player::GetGossipTextId(), Object::GetGUID(), Player::GetQuestRewardStatus(), GOSSIP_ACTION_INFO_DEF, GOSSIP_MENU_LOCKSMITH, GOSSIP_SENDER_MAIN, Player::HasItemCount(), ITEM_ARCATRAZ_KEY, ITEM_ESSENCE_INFUSED_MOONSTONE, ITEM_EYE_OF_HARAMAD, ITEM_SEARING_GORGE, ITEM_SHADOWFORGE_KEY, ITEM_SHATTERED_HALLS_KEY, ITEM_SKELETON_KEY, ITEM_THE_MASTERS_KEY, ITEM_VIOLET_HOLD_KEY, QUEST_AT_LAST, QUEST_CONTAINMENT, QUEST_DARK_IRON_LEGACY, QUEST_ETERNAL_VIGILANCE, QUEST_HOTTER_THAN_HELL_A, QUEST_HOTTER_THAN_HELL_H, QUEST_HOW_TO_BRAKE_IN_TO_THE_ARCATRAZ, QUEST_RETURN_TO_KHAGDAR, QUEST_THE_EYE_OF_HARAMAD, QUEST_THE_KEY_TO_SCHOLOMANCE_A, QUEST_THE_KEY_TO_SCHOLOMANCE_H, and SendGossipMenuFor().

◆ OnGossipSelect()

bool npc_locksmith::OnGossipSelect ( Player player,
Creature ,
uint32  ,
uint32  action 
)
inlineoverridevirtual

Reimplemented from CreatureScript.

1957 {
1958 ClearGossipMenuFor(player);
1959 switch (action)
1960 {
1961 case GOSSIP_ACTION_INFO_DEF + 1:
1962 CloseGossipMenuFor(player);
1963 player->CastSpell(player, SPELL_SKELETON_KEY, false);
1964 break;
1965 case GOSSIP_ACTION_INFO_DEF + 2:
1966 CloseGossipMenuFor(player);
1967 player->CastSpell(player, SPELL_ARCATRAZ_KEY, false);
1968 break;
1969 case GOSSIP_ACTION_INFO_DEF + 3:
1970 CloseGossipMenuFor(player);
1971 player->CastSpell(player, SPELL_SHATTERED_HALLS_KEY, false);
1972 break;
1973 case GOSSIP_ACTION_INFO_DEF + 4:
1974 CloseGossipMenuFor(player);
1975 player->CastSpell(player, SPELL_SEARING_GORGE_KEY, false);
1976 break;
1977 case GOSSIP_ACTION_INFO_DEF + 5:
1978 CloseGossipMenuFor(player);
1979 player->CastSpell(player, SPELL_SHADOWFORGE_KEY, false);
1980 break;
1981 case GOSSIP_ACTION_INFO_DEF + 6:
1982 CloseGossipMenuFor(player);
1983 player->CastSpell(player, SPELL_EYE_OF_HARMAD, false);
1984 break;
1985 case GOSSIP_ACTION_INFO_DEF + 7:
1986 CloseGossipMenuFor(player);
1987 player->CastSpell(player, SPELL_THE_MASTERS_KEY, false);
1988 break;
1989 case GOSSIP_ACTION_INFO_DEF + 8:
1990 CloseGossipMenuFor(player);
1991 player->CastSpell(player, SPELL_VIOLET_HOLD_KEY, false);
1992 break;
1993 case GOSSIP_ACTION_INFO_DEF + 9:
1994 CloseGossipMenuFor(player);
1995 player->CastSpell(player, SPELL_ESSENCE_INFUSED_MOONSTONE, false);
1996 break;
1997 }
1998 return true;
1999 }
void ClearGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:22
void CloseGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:56
@ SPELL_EYE_OF_HARMAD
Definition: npcs_special.cpp:1885
@ SPELL_ESSENCE_INFUSED_MOONSTONE
Definition: npcs_special.cpp:1900
@ SPELL_SHATTERED_HALLS_KEY
Definition: npcs_special.cpp:1870
@ SPELL_THE_MASTERS_KEY
Definition: npcs_special.cpp:1890
@ SPELL_SEARING_GORGE_KEY
Definition: npcs_special.cpp:1875
@ SPELL_SHADOWFORGE_KEY
Definition: npcs_special.cpp:1880
@ SPELL_VIOLET_HOLD_KEY
Definition: npcs_special.cpp:1895
@ SPELL_ARCATRAZ_KEY
Definition: npcs_special.cpp:1864
@ SPELL_SKELETON_KEY
Definition: npcs_special.cpp:1859
SpellCastResult CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:1169

References Unit::CastSpell(), ClearGossipMenuFor(), CloseGossipMenuFor(), GOSSIP_ACTION_INFO_DEF, SPELL_ARCATRAZ_KEY, SPELL_ESSENCE_INFUSED_MOONSTONE, SPELL_EYE_OF_HARMAD, SPELL_SEARING_GORGE_KEY, SPELL_SHADOWFORGE_KEY, SPELL_SHATTERED_HALLS_KEY, SPELL_SKELETON_KEY, SPELL_THE_MASTERS_KEY, and SPELL_VIOLET_HOLD_KEY.