2057 {
2058 uint32 roll = rand() % 2;
2059
2062
2063 if (!tree || !player)
2064 return;
2065
2067
2068 if (roll == 1)
2069 {
2073 }
2074 else if (roll == 0)
2075 {
2078 tree->
Attack(player,
true);
2079 }
2080 }
std::uint32_t uint32
Definition: Define.h:107
@ SAY_WALKER_ENEMY
Definition: zone_dragonblight.cpp:2038
@ SPELL_CREATE_ITEM_BARK
Definition: zone_dragonblight.cpp:2041
@ SAY_WALKER_FRIENDLY
Definition: zone_dragonblight.cpp:2037
@ FACTION_MONSTER
Definition: SharedDefines.h:195
@ UNIT_NPC_FLAG_SPELLCLICK
Definition: UnitDefines.h:318
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr, Milliseconds delay=0s)
Causes the creature to talk/say the text assigned to their entry in the creature_text database table.
Definition: CreatureAI.cpp:50
Definition: Creature.h:43
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Definition: Creature.cpp:2178
CreatureAI * AI() const
Definition: Creature.h:140
Player * ToPlayer()
Definition: Object.h:201
Definition: Player.h:1081
void SetFaction(uint32 faction)
Definition: Unit.cpp:10056
void RemoveNpcFlag(NPCFlags flags)
Definition: Unit.h:727
bool Attack(Unit *victim, bool meleeAttack)
Definition: Unit.cpp:10272
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
Creature * GetHitCreature()
Definition: SpellScript.cpp:458
Unit * GetCaster()
Definition: SpellScript.cpp:401