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
 
- 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_wormhole()

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

Member Function Documentation

◆ GetAI()

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

Reimplemented from CreatureScript.

1808 {
1809 return new npc_wormholeAI(creature);
1810 }

◆ OnGossipHello()

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

Reimplemented from CreatureScript.

1751 {
1752 if (creature->IsSummon())
1753 {
1754 if (player == creature->ToTempSummon()->GetSummonerUnit())
1755 {
1761
1762 if (creature->AI()->GetData(DATA_SHOW_UNDERGROUND))
1764
1765 SendGossipMenuFor(player, player->GetGossipTextId(creature), creature);
1766 }
1767 }
1768
1769 return true;
1770 }
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
@ DATA_SHOW_UNDERGROUND
Definition: npcs_special.cpp:1722
@ GOSSIP_MENU_WORMHOLE
Definition: npcs_special.cpp:1724
virtual uint32 GetData(uint32) const
Definition: UnitAI.h:202
CreatureAI * AI() const
Definition: Creature.h:136
Unit * GetSummonerUnit() const
Definition: TemporarySummon.cpp:44
uint32 GetGossipTextId(uint32 menuId, WorldObject *source)
Definition: PlayerGossip.cpp:403
TempSummon * ToTempSummon()
Definition: Unit.h:2414
bool IsSummon() const
Definition: Unit.h:1422

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.

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