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
1715: CreatureScript("npc_wormhole") { }
Definition: ScriptMgr.h:719

Member Function Documentation

◆ GetAI()

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

Reimplemented from CreatureScript.

1793 {
1794 return new npc_wormholeAI(creature);
1795 }

◆ OnGossipHello()

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

Reimplemented from CreatureScript.

1736 {
1737 if (creature->IsSummon())
1738 {
1739 if (player == creature->ToTempSummon()->GetSummonerUnit())
1740 {
1746
1747 if (creature->AI()->GetData(DATA_SHOW_UNDERGROUND))
1749
1750 SendGossipMenuFor(player, player->GetGossipTextId(creature), creature);
1751 }
1752 }
1753
1754 return true;
1755 }
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:1707
@ GOSSIP_MENU_WORMHOLE
Definition: npcs_special.cpp:1709
virtual uint32 GetData(uint32) const
Definition: UnitAI.h:202
CreatureAI * AI() const
Definition: Creature.h:135
Unit * GetSummonerUnit() const
Definition: TemporarySummon.cpp:45
uint32 GetGossipTextId(uint32 menuId, WorldObject *source)
Definition: PlayerGossip.cpp:405
TempSummon * ToTempSummon()
Definition: Unit.h:2400
bool IsSummon() const
Definition: Unit.h:1410

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.

1758 {
1759 ClearGossipMenuFor(player);
1760
1761 switch (action)
1762 {
1763 case GOSSIP_ACTION_INFO_DEF + 1: // Borean Tundra
1764 CloseGossipMenuFor(player);
1765 creature->CastSpell(player, SPELL_BOREAN_TUNDRA, false);
1766 break;
1767 case GOSSIP_ACTION_INFO_DEF + 2: // Howling Fjord
1768 CloseGossipMenuFor(player);
1769 creature->CastSpell(player, SPELL_HOWLING_FJORD, false);
1770 break;
1771 case GOSSIP_ACTION_INFO_DEF + 3: // Sholazar Basin
1772 CloseGossipMenuFor(player);
1773 creature->CastSpell(player, SPELL_SHOLAZAR_BASIN, false);
1774 break;
1775 case GOSSIP_ACTION_INFO_DEF + 4: // Icecrown
1776 CloseGossipMenuFor(player);
1777 creature->CastSpell(player, SPELL_ICECROWN, false);
1778 break;
1779 case GOSSIP_ACTION_INFO_DEF + 5: // Storm peaks
1780 CloseGossipMenuFor(player);
1781 creature->CastSpell(player, SPELL_STORM_PEAKS, false);
1782 break;
1783 case GOSSIP_ACTION_INFO_DEF + 6: // Underground
1784 CloseGossipMenuFor(player);
1785 creature->CastSpell(player, SPELL_UNDERGROUND, false);
1786 break;
1787 }
1788
1789 return true;
1790 }
void ClearGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:22
void CloseGossipMenuFor(Player *player)
Definition: ScriptedGossip.cpp:56
@ SPELL_STORM_PEAKS
Definition: npcs_special.cpp:1703
@ SPELL_UNDERGROUND
Definition: npcs_special.cpp:1705
@ SPELL_SHOLAZAR_BASIN
Definition: npcs_special.cpp:1701
@ SPELL_BOREAN_TUNDRA
Definition: npcs_special.cpp:1700
@ SPELL_HOWLING_FJORD
Definition: npcs_special.cpp:1704
@ SPELL_ICECROWN
Definition: npcs_special.cpp:1702
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.