TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
npcs_ashyen_and_keleth Class Reference

Public Member Functions

 npcs_ashyen_and_keleth ()
 
bool OnGossipHello (Player *player, Creature *creature) override
 
bool OnGossipSelect (Player *player, Creature *creature, uint32, uint32 action) override
 
- Public Member Functions inherited from CreatureScript
virtual bool OnDummyEffect (Unit *, uint32, SpellEffIndex, Creature *)
 
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 OnQuestReward (Player *, Creature *, Quest const *, uint32)
 
virtual uint32 GetDialogStatus (Player *, Creature *)
 
virtual CreatureAIGetAI (Creature *) const
 
- Public Member Functions inherited from UnitScript
virtual void OnHeal (Unit *, Unit *, uint32 &)
 
virtual void OnDamage (Unit *, Unit *, uint32 &)
 
virtual void ModifyPeriodicDamageAurasTick (Unit *, Unit *, uint32 &)
 
virtual void ModifyMeleeDamage (Unit *, Unit *, uint32 &)
 
virtual void ModifySpellDamageTaken (Unit *, Unit *, int32 &)
 
- Public Member Functions inherited from ScriptObject
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 UnitScript
 UnitScript (const char *name, bool addToScripts=true)
 
- Protected Member Functions inherited from ScriptObject
 ScriptObject (const char *name)
 
virtual ~ScriptObject ()
 
- Protected Member Functions inherited from UpdatableScript< Creature >
 UpdatableScript ()
 
virtual ~UpdatableScript ()
 

Constructor & Destructor Documentation

npcs_ashyen_and_keleth::npcs_ashyen_and_keleth ( )
inline
68 : CreatureScript("npcs_ashyen_and_keleth") { }
CreatureScript(const char *name)
Definition: ScriptMgr.cpp:1586

Member Function Documentation

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

Reimplemented from CreatureScript.

71  {
72  if (player->GetReputationRank(942) > REP_NEUTRAL)
73  {
74  if (creature->GetEntry() == NPC_ASHYEN)
76 
77  if (creature->GetEntry() == NPC_KELETH)
79  }
80  player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
81 
82  return true;
83  }
Definition: ScriptedGossip.h:71
#define GOSSIP_ITEM_BLESS_KEL
Definition: zone_zangarmarsh.cpp:47
Definition: SharedDefines.h:216
Definition: zone_zangarmarsh.cpp:52
Definition: ScriptedGossip.h:73
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: zone_zangarmarsh.cpp:51
Definition: GossipDef.h:59
uint32 GetEntry() const
Definition: Object.h:107
#define GOSSIP_ITEM_BLESS_ASH
Definition: zone_zangarmarsh.cpp:46

+ Here is the call graph for this function:

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

Reimplemented from CreatureScript.

86  {
87  player->PlayerTalkClass->ClearMenus();
88  if (action == GOSSIP_ACTION_INFO_DEF+1)
89  {
90  creature->setPowerType(POWER_MANA);
91  creature->SetMaxPower(POWER_MANA, 200); //set a "fake" mana value, we can't depend on database doing it in this case
92  creature->SetPower(POWER_MANA, 200);
93 
94  if (creature->GetEntry() == NPC_ASHYEN) //check which Creature we are dealing with
95  {
96  uint32 spell = 0;
97  switch (player->GetReputationRank(942))
98  { //mark of lore
99  case REP_FRIENDLY:
100  spell = SPELL_BLESS_ASH_FRI;
101  break;
102  case REP_HONORED:
103  spell = SPELL_BLESS_ASH_HON;
104  break;
105  case REP_REVERED:
106  spell = SPELL_BLESS_ASH_REV;
107  break;
108  case REP_EXALTED:
109  spell = SPELL_BLESS_ASH_EXA;
110  break;
111  default:
112  break;
113  }
114 
115  if (spell)
116  {
117  creature->CastSpell(player, spell, true);
118  }
119  }
120 
121  if (creature->GetEntry() == NPC_KELETH)
122  {
123  uint32 spell = 0;
124  switch (player->GetReputationRank(942)) //mark of war
125  {
126  case REP_FRIENDLY:
127  spell = SPELL_BLESS_KEL_FRI;
128  break;
129  case REP_HONORED:
130  spell = SPELL_BLESS_KEL_HON;
131  break;
132  case REP_REVERED:
133  spell = SPELL_BLESS_KEL_REV;
134  break;
135  case REP_EXALTED:
136  spell = SPELL_BLESS_KEL_EXA;
137  break;
138  default:
139  break;
140  }
141 
142  if (spell)
143  {
144  creature->CastSpell(player, spell, true);
145  }
146  }
147  player->CLOSE_GOSSIP_MENU();
148  player->TalkedToCreature(creature->GetEntry(), creature->GetGUID());
149  }
150  return true;
151  }
Definition: zone_zangarmarsh.cpp:61
Definition: SharedDefines.h:220
Definition: zone_zangarmarsh.cpp:54
Definition: ScriptedGossip.h:71
Definition: zone_zangarmarsh.cpp:57
void setPowerType(Powers power)
Definition: Unit.cpp:6977
Definition: zone_zangarmarsh.cpp:56
Definition: SharedDefines.h:219
Definition: zone_zangarmarsh.cpp:62
Definition: SharedDefines.h:217
uint32_t uint32
Definition: Define.h:150
Definition: zone_zangarmarsh.cpp:55
Definition: zone_zangarmarsh.cpp:52
void SetPower(Powers power, int32 val)
Definition: Unit.cpp:11607
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: zone_zangarmarsh.cpp:51
void SetMaxPower(Powers power, int32 val)
Definition: Unit.cpp:11641
uint32 GetEntry() const
Definition: Object.h:107
Definition: SharedDefines.h:218
Definition: zone_zangarmarsh.cpp:60
Definition: zone_zangarmarsh.cpp:59
void CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:869
Definition: SharedDefines.h:248

+ Here is the call graph for this function:


The documentation for this class was generated from the following file: