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

Classes

struct  npc_wormholeAI
 

Public Member Functions

 npc_wormhole ()
 
bool OnGossipHello (Player *player, Creature *creature) override
 
bool OnGossipSelect (Player *player, Creature *creature, uint32, uint32 action) override
 
CreatureAIGetAI (Creature *creature) const 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
 
uint16 GetTotalAvailableHooks ()
 
- 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, uint16 totalAvailableHooks=0)
 
virtual ~ScriptObject ()=default
 
- Protected Member Functions inherited from UpdatableScript< Creature >
 UpdatableScript ()=default
 

Detailed Description

Constructor & Destructor Documentation

◆ npc_wormhole()

npc_wormhole::npc_wormhole ( )
inline
1734: CreatureScript("npc_wormhole") { }
Definition: CreatureScript.h:25

Member Function Documentation

◆ GetAI()

CreatureAI * npc_wormhole::GetAI ( Creature creature) const
inlineoverridevirtual

Reimplemented from CreatureScript.

1812 {
1813 return new npc_wormholeAI(creature);
1814 }

◆ OnGossipHello()

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

Reimplemented from CreatureScript.

1755 {
1756 if (creature->IsSummon())
1757 {
1758 if (player == creature->ToTempSummon()->GetSummonerUnit())
1759 {
1765
1766 if (creature->AI()->GetData(DATA_SHOW_UNDERGROUND))
1768
1769 SendGossipMenuFor(player, player->GetGossipTextId(creature), creature);
1770 }
1771 }
1772
1773 return true;
1774 }
@ DATA_SHOW_UNDERGROUND
Definition: npcs_special.cpp:1726
@ GOSSIP_MENU_WORMHOLE
Definition: npcs_special.cpp:1728
@ GOSSIP_SENDER_MAIN
Definition: ScriptedGossip.h:70
@ GOSSIP_ACTION_INFO_DEF
Definition: ScriptedGossip.h:68
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
virtual uint32 GetData(uint32) const
Definition: UnitAI.h:213
CreatureAI * AI() const
Definition: Creature.h:142
Unit * GetSummonerUnit() const
Definition: TemporarySummon.cpp:44
uint32 GetGossipTextId(uint32 menuId, WorldObject *source)
Definition: PlayerGossip.cpp:404
TempSummon * ToTempSummon()
Definition: Unit.h:696
bool IsSummon() const
Definition: Unit.h:751

References AddGossipItemFor(), Creature::AI(), DATA_SHOW_UNDERGROUND, UnitAI::GetData(), Player::GetGossipTextId(), TempSummon::GetSummonerUnit(), GOSSIP_ACTION_INFO_DEF, GOSSIP_MENU_WORMHOLE, GOSSIP_SENDER_MAIN, Unit::IsSummon(), SendGossipMenuFor(), and Unit::ToTempSummon().

◆ OnGossipSelect()

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

Reimplemented from CreatureScript.

1777 {
1778 ClearGossipMenuFor(player);
1779
1780 switch (action)
1781 {
1782 case GOSSIP_ACTION_INFO_DEF + 1: // Borean Tundra
1783 CloseGossipMenuFor(player);
1784 creature->CastSpell(player, SPELL_BOREAN_TUNDRA, false);
1785 break;
1786 case GOSSIP_ACTION_INFO_DEF + 2: // Howling Fjord
1787 CloseGossipMenuFor(player);
1788 creature->CastSpell(player, SPELL_HOWLING_FJORD, false);
1789 break;
1790 case GOSSIP_ACTION_INFO_DEF + 3: // Sholazar Basin
1791 CloseGossipMenuFor(player);
1792 creature->CastSpell(player, SPELL_SHOLAZAR_BASIN, false);
1793 break;
1794 case GOSSIP_ACTION_INFO_DEF + 4: // Icecrown
1795 CloseGossipMenuFor(player);
1796 creature->CastSpell(player, SPELL_ICECROWN, false);
1797 break;
1798 case GOSSIP_ACTION_INFO_DEF + 5: // Storm peaks
1799 CloseGossipMenuFor(player);
1800 creature->CastSpell(player, SPELL_STORM_PEAKS, false);
1801 break;
1802 case GOSSIP_ACTION_INFO_DEF + 6: // Underground
1803 CloseGossipMenuFor(player);
1804 creature->CastSpell(player, SPELL_UNDERGROUND, false);
1805 break;
1806 }
1807
1808 return true;
1809 }
@ SPELL_STORM_PEAKS
Definition: npcs_special.cpp:1722
@ SPELL_UNDERGROUND
Definition: npcs_special.cpp:1724
@ SPELL_SHOLAZAR_BASIN
Definition: npcs_special.cpp:1720
@ SPELL_BOREAN_TUNDRA
Definition: npcs_special.cpp:1719
@ SPELL_HOWLING_FJORD
Definition: npcs_special.cpp:1723
@ SPELL_ICECROWN
Definition: npcs_special.cpp:1721
void ClearGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:22
void CloseGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:56
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:1167

References Unit::CastSpell(), ClearGossipMenuFor(), CloseGossipMenuFor(), GOSSIP_ACTION_INFO_DEF, SPELL_BOREAN_TUNDRA, SPELL_HOWLING_FJORD, SPELL_ICECROWN, SPELL_SHOLAZAR_BASIN, SPELL_STORM_PEAKS, and SPELL_UNDERGROUND.