Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
zone_stranglethorn_vale.cpp
Go to the documentation of this file.
1
/*
2
* This file is part of Project SkyFire https://www.projectskyfire.org.
3
* See LICENSE.md file for Copyright information
4
*/
5
6
/* ScriptData
7
SDName: Stranglethorn_Vale
8
SD%Complete: 100
9
SDComment: Quest support: 592
10
SDCategory: Stranglethorn Vale
11
EndScriptData */
12
13
/* ContentData
14
npc_yenniku
15
EndContentData */
16
17
#include "
ScriptMgr.h
"
18
#include "
ScriptedCreature.h
"
19
#include "
Player.h
"
20
#include "
SpellInfo.h
"
21
22
/*######
23
## npc_yenniku
24
######*/
25
26
class
npc_yenniku
:
public
CreatureScript
27
{
28
public
:
29
npc_yenniku
() :
CreatureScript
(
"npc_yenniku"
) { }
30
31
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
32
{
33
return
new
npc_yennikuAI
(creature);
34
}
35
36
struct
npc_yennikuAI
:
public
ScriptedAI
37
{
38
npc_yennikuAI
(
Creature
* creature) :
ScriptedAI
(creature)
39
{
40
bReset
=
false
;
41
}
42
43
uint32
Reset_Timer
;
44
bool
bReset
;
45
46
void
Reset
()
OVERRIDE
47
{
48
Reset_Timer
= 0;
49
me
->SetUInt32Value(
UNIT_FIELD_NPC_EMOTESTATE
,
EMOTE_STATE_NONE
);
50
}
51
52
void
SpellHit
(
Unit
* caster,
const
SpellInfo
* spell)
OVERRIDE
53
{
54
if
(
bReset
|| spell->Id != 3607)
55
return
;
56
57
if
(
Player
* player = caster->
ToPlayer
())
58
{
59
if
(player->GetQuestStatus(592) ==
QUEST_STATUS_INCOMPLETE
)
//Yenniku's Release
60
{
61
me
->SetUInt32Value(
UNIT_FIELD_NPC_EMOTESTATE
,
EMOTE_STATE_STUN
);
62
me
->CombatStop();
//stop combat
63
me
->DeleteThreatList();
//unsure of this
64
me
->setFaction(83);
//horde generic
65
66
bReset
=
true
;
67
Reset_Timer
= 60000;
68
}
69
}
70
}
71
72
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
{ }
73
74
void
UpdateAI
(
uint32
diff)
OVERRIDE
75
{
76
if
(
bReset
)
77
{
78
if
(
Reset_Timer
<= diff)
79
{
80
EnterEvadeMode
();
81
bReset
=
false
;
82
me
->setFaction(28);
//troll, bloodscalp
83
return
;
84
}
85
86
Reset_Timer
-= diff;
87
88
if
(
me
->IsInCombat() &&
me
->GetVictim())
89
{
90
if
(
Player
* player =
me
->GetVictim()->ToPlayer())
91
{
92
if
(player->GetTeam() ==
HORDE
)
93
{
94
me
->CombatStop();
95
me
->DeleteThreatList();
96
}
97
}
98
}
99
}
100
101
//Return since we have no target
102
if
(!
UpdateVictim
())
103
return
;
104
105
DoMeleeAttackIfReady
();
106
}
107
};
108
};
109
110
/*######
111
##
112
######*/
113
114
void
AddSC_stranglethorn_vale
()
115
{
116
new
npc_yenniku
();
117
}
uint32
std::uint32_t uint32
Definition
Define.h:77
OVERRIDE
#define OVERRIDE
Definition
Define.h:60
Player.h
QUEST_STATUS_INCOMPLETE
@ QUEST_STATUS_INCOMPLETE
Definition
QuestDef.h:89
ScriptMgr.h
ScriptedCreature.h
EMOTE_STATE_STUN
@ EMOTE_STATE_STUN
Definition
SharedDefines.h:2177
EMOTE_STATE_NONE
@ EMOTE_STATE_NONE
Definition
SharedDefines.h:2159
HORDE
@ HORDE
Definition
SharedDefines.h:876
SpellInfo.h
UNIT_FIELD_NPC_EMOTESTATE
@ UNIT_FIELD_NPC_EMOTESTATE
Definition
UpdateFields.h:108
CreatureAI
Definition
CreatureAI.h:54
CreatureAI::UpdateVictim
bool UpdateVictim()
Definition
CreatureAI.cpp:192
CreatureAI::EnterEvadeMode
virtual void EnterEvadeMode()
Definition
CreatureAI.cpp:130
Creature
Definition
Creature.h:427
CreatureScript::CreatureScript
CreatureScript(const char *name)
Definition
ScriptMgr.cpp:1436
Object::ToPlayer
Player * ToPlayer()
Definition
Object.h:204
Player
Definition
Player.h:1289
SpellInfo
Definition
SpellInfo.h:158
UnitAI::DoMeleeAttackIfReady
void DoMeleeAttackIfReady()
Definition
UnitAI.cpp:28
Unit
Definition
Unit.h:1367
npc_yenniku
Definition
zone_stranglethorn_vale.cpp:27
npc_yenniku::npc_yenniku
npc_yenniku()
Definition
zone_stranglethorn_vale.cpp:29
npc_yenniku::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
zone_stranglethorn_vale.cpp:31
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
ScriptedAI::ScriptedAI
ScriptedAI(Creature *creature)
Definition
ScriptedCreature.cpp:85
npc_yenniku::npc_yennikuAI
Definition
zone_stranglethorn_vale.cpp:37
npc_yenniku::npc_yennikuAI::Reset
void Reset() OVERRIDE
Definition
zone_stranglethorn_vale.cpp:46
npc_yenniku::npc_yennikuAI::SpellHit
void SpellHit(Unit *caster, const SpellInfo *spell) OVERRIDE
Definition
zone_stranglethorn_vale.cpp:52
npc_yenniku::npc_yennikuAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
zone_stranglethorn_vale.cpp:72
npc_yenniku::npc_yennikuAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
zone_stranglethorn_vale.cpp:74
npc_yenniku::npc_yennikuAI::bReset
bool bReset
Definition
zone_stranglethorn_vale.cpp:44
npc_yenniku::npc_yennikuAI::Reset_Timer
uint32 Reset_Timer
Definition
zone_stranglethorn_vale.cpp:43
npc_yenniku::npc_yennikuAI::npc_yennikuAI
npc_yennikuAI(Creature *creature)
Definition
zone_stranglethorn_vale.cpp:38
AddSC_stranglethorn_vale
void AddSC_stranglethorn_vale()
Definition
zone_stranglethorn_vale.cpp:114
src
server
scripts
EasternKingdoms
zone_stranglethorn_vale.cpp
Generated on
for Project SkyFire Core by
1.17.0