Merge branch 'master' of github.com:TrinityCore/TrinityCore into mmaps

Conflicts:
	src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp
This commit is contained in:
Subv
2012-10-04 19:39:09 -05:00
128 changed files with 2862 additions and 2459 deletions
+2 -2
View File
@@ -201,8 +201,8 @@ public:
float z = player->GetPositionZ();
float ang = player->GetOrientation();
float rot2 = sin(ang/2);
float rot3 = cos(ang/2);
float rot2 = std::sin(ang/2);
float rot3 = std::cos(ang/2);
uint32 objectId = atoi(id);
+2 -2
View File
@@ -39,12 +39,12 @@ public:
{ "complete", SEC_ADMINISTRATOR, false, &HandleQuestComplete, "", NULL },
{ "remove", SEC_ADMINISTRATOR, false, &HandleQuestRemove, "", NULL },
{ "reward", SEC_ADMINISTRATOR, false, &HandleQuestReward, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
{ NULL, SEC_PLAYER, false, NULL, "", NULL }
};
static ChatCommand commandTable[] =
{
{ "quest", SEC_ADMINISTRATOR, false, NULL, "", questCommandTable },
{ NULL, 0, false, NULL, "", NULL }
{ NULL, SEC_PLAYER, false, NULL, "", NULL }
};
return commandTable;
}
+2 -2
View File
@@ -408,9 +408,9 @@ public:
if (!*args)
return false;
Tokens entries(std::string(args), ' ');
Tokenizer entries(std::string(args), ' ');
for (Tokens::const_iterator itr = entries.begin(); itr != entries.end(); ++itr)
for (Tokenizer::const_iterator itr = entries.begin(); itr != entries.end(); ++itr)
{
uint32 entry = uint32(atoi(*itr));
@@ -210,16 +210,16 @@ public:
pAttumen->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
float angle = me->GetAngle(pAttumen);
float distance = me->GetDistance2d(pAttumen);
float newX = me->GetPositionX() + cos(angle)*(distance/2);
float newY = me->GetPositionY() + sin(angle)*(distance/2);
float newX = me->GetPositionX() + std::cos(angle)*(distance/2);
float newY = me->GetPositionY() + std::sin(angle)*(distance/2);
float newZ = 50;
//me->Relocate(newX, newY, newZ, angle);
//me->SendMonsterMove(newX, newY, newZ, 0, true, 1000);
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MovePoint(0, newX, newY, newZ);
distance += 10;
newX = me->GetPositionX() + cos(angle)*(distance/2);
newY = me->GetPositionY() + sin(angle)*(distance/2);
newX = me->GetPositionX() + std::cos(angle)*(distance/2);
newY = me->GetPositionY() + std::sin(angle)*(distance/2);
pAttumen->GetMotionMaster()->Clear();
pAttumen->GetMotionMaster()->MovePoint(0, newX, newY, newZ);
//pAttumen->Relocate(newX, newY, newZ, -angle);
@@ -774,8 +774,8 @@ public:
for (uint8 i = 1; i < Phase; ++i)
{
float sx, sy;
sx = ShieldOrbLocations[0][0] + sin(ShieldOrbLocations[i][0]);
sy = ShieldOrbLocations[0][1] + sin(ShieldOrbLocations[i][1]);
sx = ShieldOrbLocations[0][0] + std::sin(ShieldOrbLocations[i][0]);
sy = ShieldOrbLocations[0][1] + std::sin(ShieldOrbLocations[i][1]);
me->SummonCreature(CREATURE_SHIELD_ORB, sx, sy, SHIELD_ORB_Z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000);
}
Timer[TIMER_SUMMON_SHILEDORB] = urand(30000, 60000); // 30-60seconds cooldown
@@ -1207,13 +1207,13 @@ public:
{
if (bClockwise)
{
y = my - r * sin(c);
x = mx - r * cos(c);
y = my - r * std::sin(c);
x = mx - r * std::cos(c);
}
else
{
y = my + r * sin(c);
x = mx + r * cos(c);
y = my + r * std::sin(c);
x = mx + r * std::cos(c);
}
bPointReached = false;
uiCheckTimer = 1000;
@@ -15,10 +15,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Comment: Find correct mushrooms spell to make them visible - buffs of the mushrooms not ever applied to the users...
*/
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ahnkahet.h"
@@ -34,12 +30,24 @@ enum Spells
SPELL_POISONOUS_MUSHROOM_VISUAL_AREA = 61566, // Self
SPELL_POISONOUS_MUSHROOM_VISUAL_AURA = 56741, // Self
SPELL_PUTRID_MUSHROOM = 31690, // To make the mushrooms visible
SPELL_POWER_MUSHROOM_VISUAL_AURA = 56740,
};
enum Creatures
{
NPC_HEALTHY_MUSHROOM = 30391,
NPC_POISONOUS_MUSHROOM = 30435
NPC_HEALTHY_MUSHROOM = 30391,
NPC_POISONOUS_MUSHROOM = 30435,
NPC_TRIGGER = 19656
};
enum event
{
EVENT_SPAWN = 1,
EVENT_MINI,
EVENT_ROOT,
EVENT_BASH,
EVENT_BOLT,
EVENT_AURA
};
class boss_amanitar : public CreatureScript
@@ -47,110 +55,118 @@ class boss_amanitar : public CreatureScript
public:
boss_amanitar() : CreatureScript("boss_amanitar") { }
struct boss_amanitarAI : public ScriptedAI
struct boss_amanitarAI : public BossAI
{
boss_amanitarAI(Creature* creature) : ScriptedAI(creature)
{
instance = creature->GetInstanceScript();
bFirstTime = true;
}
InstanceScript* instance;
uint32 uiRootTimer;
uint32 uiBashTimer;
uint32 uiBoltTimer;
uint32 uiSpawnTimer;
bool bFirstTime;
boss_amanitarAI(Creature* creature) : BossAI(creature, DATA_AMANITAR) { }
void Reset()
{
uiRootTimer = urand(5*IN_MILLISECONDS, 9*IN_MILLISECONDS);
uiBashTimer = urand(10*IN_MILLISECONDS, 14*IN_MILLISECONDS);
uiBoltTimer = urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS);
uiSpawnTimer = 0;
_Reset();
me->SetMeleeDamageSchool(SPELL_SCHOOL_NATURE);
me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true);
me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true);
summons.DespawnAll();
if (instance)
{
instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_MINI);
if (!bFirstTime)
instance->SetData(DATA_AMANITAR_EVENT, FAIL);
else
bFirstTime = false;
instance->SetData(DATA_AMANITAR_EVENT, NOT_STARTED);
}
}
void JustDied(Unit* /*killer*/)
void JustDied(Unit* /*Killer*/)
{
if (instance)
{
_JustDied();
instance->SetData(DATA_AMANITAR_EVENT, DONE);
instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_MINI);
summons.DespawnAll();
}
}
void EnterCombat(Unit* /*who*/)
{
_EnterCombat();
events.ScheduleEvent(EVENT_ROOT, urand(5,9)*IN_MILLISECONDS);
events.ScheduleEvent(EVENT_BASH, urand(10,14)*IN_MILLISECONDS);
events.ScheduleEvent(EVENT_BOLT, urand(15,20)*IN_MILLISECONDS);
events.ScheduleEvent(EVENT_MINI, urand(12,18)*IN_MILLISECONDS);
events.ScheduleEvent(EVENT_SPAWN, 5 *IN_MILLISECONDS);
me->SetInCombatWithZone();
if (instance)
instance->SetData(DATA_AMANITAR_EVENT, IN_PROGRESS);
DoCast(me, SPELL_MINI, false);
}
void SpawnAdds()
{
uint8 u = 0;
for (uint8 i = 0; i < 30; ++i)
{
Unit* victim = SelectTarget(SELECT_TARGET_RANDOM, 0);
Position pos;
me->GetPosition(&pos);
me->GetRandomNearPosition(pos, 30.0f);
pos.m_positionZ = me->GetMap()->GetHeight(pos.GetPositionX(), pos.GetPositionY(), MAX_HEIGHT) + 2.0f;
if (victim)
if (Creature* trigger = me->SummonCreature(NPC_TRIGGER, pos))
{
Position pos;
victim->GetPosition(&pos);
me->GetRandomNearPosition(pos, float(urand(5, 80)));
me->SummonCreature(NPC_POISONOUS_MUSHROOM, pos, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30*IN_MILLISECONDS);
me->GetRandomNearPosition(pos, float(urand(5, 80)));
me->SummonCreature(NPC_HEALTHY_MUSHROOM, pos, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30*IN_MILLISECONDS);
Creature* temp1 = trigger->FindNearestCreature(NPC_HEALTHY_MUSHROOM, 4.0f, true);
Creature* temp2 = trigger->FindNearestCreature(NPC_POISONOUS_MUSHROOM, 4.0f, true);
if (temp1 || temp2)
{
trigger->DisappearAndDie();
}
else
{
u = 1 - u;
trigger->DisappearAndDie();
me->SummonCreature(u > 0 ? NPC_POISONOUS_MUSHROOM : NPC_HEALTHY_MUSHROOM, pos, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60*IN_MILLISECONDS);
}
}
}
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
if (uiSpawnTimer <= diff)
{
SpawnAdds();
uiSpawnTimer = urand(35*IN_MILLISECONDS, 40*IN_MILLISECONDS);
} else uiSpawnTimer -= diff;
events.Update(diff);
if (uiRootTimer <= diff)
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_ENTANGLING_ROOTS);
uiRootTimer = urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS);
} else uiRootTimer -= diff;
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
if (uiBashTimer <= diff)
while (uint32 eventId = events.ExecuteEvent())
{
DoCastVictim(SPELL_BASH);
uiBashTimer = urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS);
} else uiBashTimer -= diff;
if (uiBoltTimer <= diff)
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_VENOM_BOLT_VOLLEY);
uiBoltTimer = urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS);
} else uiBoltTimer -= diff;
switch (eventId)
{
case EVENT_SPAWN:
SpawnAdds();
events.ScheduleEvent(EVENT_SPAWN, 20*IN_MILLISECONDS);
break;
case EVENT_MINI:
DoCast(SPELL_MINI);
events.ScheduleEvent(EVENT_MINI, urand(25,30)*IN_MILLISECONDS);
break;
case EVENT_ROOT:
DoCast(SelectTarget(SELECT_TARGET_RANDOM,0, 100, true),SPELL_ENTANGLING_ROOTS,true);
events.ScheduleEvent(EVENT_ROOT, urand(10,15)*IN_MILLISECONDS);
break;
case EVENT_BASH:
DoCastVictim(SPELL_BASH);
events.ScheduleEvent(EVENT_BASH, urand(7,12)*IN_MILLISECONDS);
break;
case EVENT_BOLT:
DoCast(SelectTarget(SELECT_TARGET_RANDOM,0, 100, true),SPELL_VENOM_BOLT_VOLLEY,true);
events.ScheduleEvent(EVENT_BOLT, urand(18,22)*IN_MILLISECONDS);
break;
default:
break;
}
}
DoMeleeAttackIfReady();
}
};
@@ -170,30 +186,26 @@ public:
{
mob_amanitar_mushroomsAI(Creature* creature) : Scripted_NoMovementAI(creature) {}
uint32 uiAuraTimer;
uint32 uiDeathTimer;
EventMap events;
void Reset()
{
DoCast(me, SPELL_PUTRID_MUSHROOM, true); // Hack, to make the mushrooms visible, can't find orig. spell...
events.Reset();
events.ScheduleEvent(EVENT_AURA, 1*IN_MILLISECONDS);
me->SetDisplayId(me->GetCreatureTemplate()->Modelid2);
DoCast(SPELL_PUTRID_MUSHROOM);
if (me->GetEntry() == NPC_POISONOUS_MUSHROOM)
DoCast(me, SPELL_POISONOUS_MUSHROOM_VISUAL_AURA, true);
uiAuraTimer = 0;
uiDeathTimer = 30*IN_MILLISECONDS;
DoCast(SPELL_POISONOUS_MUSHROOM_VISUAL_AURA);
else
DoCast(SPELL_POWER_MUSHROOM_VISUAL_AURA);
}
void JustDied(Unit* killer)
void DamageTaken(Unit* /*attacker*/, uint32 &damage)
{
if (!killer)
return;
if (me->GetEntry() == NPC_HEALTHY_MUSHROOM && killer->GetTypeId() == TYPEID_PLAYER)
{
me->InterruptNonMeleeSpells(false);
DoCast(killer, SPELL_HEALTHY_MUSHROOM_POTENT_FUNGUS, false);
}
if (damage >= me->GetHealth() && me->GetEntry() == NPC_HEALTHY_MUSHROOM)
DoCast(me, SPELL_HEALTHY_MUSHROOM_POTENT_FUNGUS, true);
}
void EnterCombat(Unit* /*who*/) {}
@@ -201,18 +213,30 @@ public:
void UpdateAI(const uint32 diff)
{
if (me->GetEntry() == NPC_POISONOUS_MUSHROOM)
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
{
if (uiAuraTimer <= diff)
switch (eventId)
{
DoCast(me, SPELL_POISONOUS_MUSHROOM_VISUAL_AREA, true);
DoCast(me, SPELL_POISONOUS_MUSHROOM_POISON_CLOUD, false);
uiAuraTimer = 7*IN_MILLISECONDS;
} else uiAuraTimer -= diff;
case EVENT_AURA:
if (me->GetEntry() == NPC_POISONOUS_MUSHROOM)
{
DoCast(me, SPELL_POISONOUS_MUSHROOM_VISUAL_AREA, true);
DoCast(me, SPELL_POISONOUS_MUSHROOM_POISON_CLOUD);
}
events.ScheduleEvent(EVENT_AURA, 7*IN_MILLISECONDS);
break;
default:
break;
}
}
if (uiDeathTimer <= diff)
me->DisappearAndDie();
else uiDeathTimer -= diff;
}
};
@@ -224,6 +248,6 @@ public:
void AddSC_boss_amanitar()
{
new boss_amanitar;
new mob_amanitar_mushrooms;
}
new boss_amanitar();
new mob_amanitar_mushrooms();
}
@@ -44,16 +44,13 @@ enum Creatures
MOB_TWISTED_VISAGE = 30625
};
//not in db
enum Yells
{
SAY_AGGRO = -1619030,
SAY_SLAY_1 = -1619031,
SAY_SLAY_2 = -1619032,
SAY_SLAY_3 = -1619033,
SAY_DEATH_1 = -1619034,
SAY_DEATH_2 = -1619035,
SAY_PHASE = -1619036
SAY_AGGRO = 0,
SAY_SLAY = 1,
SAY_DEATH = 2,
SAY_PHASE = 3
};
enum Achievements
@@ -177,7 +174,7 @@ public:
void EnterCombat(Unit* /*who*/)
{
DoScriptText(SAY_AGGRO, me);
Talk(SAY_AGGRO);
if (instance)
{
@@ -300,7 +297,7 @@ public:
void JustDied(Unit* /*killer*/)
{
DoScriptText(SAY_DEATH_1, me);
Talk(SAY_DEATH);
if (instance)
instance->SetData(DATA_HERALD_VOLAZJ, DONE);
@@ -311,7 +308,7 @@ public:
void KilledUnit(Unit* /*victim*/)
{
DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2, SAY_SLAY_3), me);
Talk(SAY_SLAY);
}
};
@@ -23,22 +23,15 @@
#include "ScriptedCreature.h"
#include "ahnkahet.h"
enum Yells
{
TEXT_AGGRO = -1619000,
TEXT_SACRIFICE_1_1 = -1619001,
TEXT_SACRIFICE_1_2 = -1619002,
TEXT_SACRIFICE_2_1 = -1619003,
TEXT_SACRIFICE_2_2 = -1619004,
TEXT_SLAY_1 = -1619005,
TEXT_SLAY_2 = -1619006,
TEXT_SLAY_3 = -1619007,
TEXT_DEATH = -1619008,
TEXT_PREACHING_1 = -1619009,
TEXT_PREACHING_2 = -1619010,
TEXT_PREACHING_3 = -1619011,
TEXT_PREACHING_4 = -1619012,
TEXT_PREACHING_5 = -1619013
TEXT_AGGRO = 0,
TEXT_SACRIFICE_1 = 1,
TEXT_SACRIFICE_2 = 2,
TEXT_SLAY = 3,
TEXT_DEATH = 4,
TEXT_PREACHING = 5
};
enum Spells
@@ -129,7 +122,7 @@ public:
if (!instance || (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == NPC_JEDOGA_CONTROLLER))
return;
DoScriptText(TEXT_AGGRO, me);
Talk(TEXT_AGGRO);
me->SetInCombatWithZone();
instance->SetData(DATA_JEDOGA_SHADOWSEEKER_EVENT, IN_PROGRESS);
}
@@ -147,12 +140,12 @@ public:
if (!Victim || Victim->GetTypeId() != TYPEID_PLAYER)
return;
DoScriptText(RAND(TEXT_SLAY_1, TEXT_SLAY_2, TEXT_SLAY_3), me);
Talk(TEXT_SLAY);
}
void JustDied(Unit* /*killer*/)
{
DoScriptText(TEXT_DEATH, me);
Talk(TEXT_DEATH);
if (instance)
instance->SetData(DATA_JEDOGA_SHADOWSEEKER_EVENT, DONE);
}
@@ -178,7 +171,7 @@ public:
if (!bPreDone && who->GetTypeId() == TYPEID_PLAYER && me->GetDistance(who) < 100.0f)
{
DoScriptText(RAND(TEXT_PREACHING_1, TEXT_PREACHING_2, TEXT_PREACHING_3, TEXT_PREACHING_4, TEXT_PREACHING_5), me);
Talk(TEXT_PREACHING);
bPreDone = true;
}
@@ -270,7 +263,7 @@ public:
if (opfer)
{
DoScriptText(RAND(TEXT_SACRIFICE_1_1, TEXT_SACRIFICE_1_2), me);
Talk(TEXT_SACRIFICE_1);
instance->SetData64(DATA_ADD_JEDOGA_OPFER, opfer);
} else
bCanDown = true;
@@ -278,7 +271,7 @@ public:
void Opfern()
{
DoScriptText(RAND(TEXT_SACRIFICE_2_1, TEXT_SACRIFICE_2_2), me);
Talk(TEXT_SACRIFICE_2);
me->InterruptNonMeleeSpells(false);
DoCast(me, SPELL_GIFT_OF_THE_HERALD, false);
@@ -534,11 +527,11 @@ public:
{
npc_jedogas_aufseher_triggerAI(Creature* creature) : Scripted_NoMovementAI(creature)
{
instance = creature->GetInstanceScript();
bRemoved = false;
bRemoved2 = false;
bCasted = false;
bCasted2 = false;
instance = creature->GetInstanceScript();
bRemoved = false;
bRemoved2 = false;
bCasted = false;
bCasted2 = false;
}
InstanceScript* instance;
@@ -140,8 +140,8 @@ public:
{
float angle, x, y;
angle = pSpheres[0]->GetAngle(pSphereTarget);
x = pSpheres[0]->GetPositionX() + DATA_SPHERE_DISTANCE * cos(angle);
y = pSpheres[0]->GetPositionY() + DATA_SPHERE_DISTANCE * sin(angle);
x = pSpheres[0]->GetPositionX() + DATA_SPHERE_DISTANCE * std::cos(angle);
y = pSpheres[0]->GetPositionY() + DATA_SPHERE_DISTANCE * std::sin(angle);
pSpheres[0]->GetMotionMaster()->MovePoint(0, x, y, pSpheres[0]->GetPositionZ());
}
if (IsHeroic())
@@ -154,12 +154,12 @@ public:
{
float angle, x, y;
angle = pSpheres[1]->GetAngle(pSphereTarget) + DATA_SPHERE_ANGLE_OFFSET;
x = pSpheres[1]->GetPositionX() + DATA_SPHERE_DISTANCE/2 * cos(angle);
y = pSpheres[1]->GetPositionY() + DATA_SPHERE_DISTANCE/2 * sin(angle);
x = pSpheres[1]->GetPositionX() + DATA_SPHERE_DISTANCE/2 * std::cos(angle);
y = pSpheres[1]->GetPositionY() + DATA_SPHERE_DISTANCE/2 * std::sin(angle);
pSpheres[1]->GetMotionMaster()->MovePoint(0, x, y, pSpheres[1]->GetPositionZ());
angle = pSpheres[2]->GetAngle(pSphereTarget) - DATA_SPHERE_ANGLE_OFFSET;
x = pSpheres[2]->GetPositionX() + DATA_SPHERE_DISTANCE/2 * cos(angle);
y = pSpheres[2]->GetPositionY() + DATA_SPHERE_DISTANCE/2 * sin(angle);
x = pSpheres[2]->GetPositionX() + DATA_SPHERE_DISTANCE/2 * std::cos(angle);
y = pSpheres[2]->GetPositionY() + DATA_SPHERE_DISTANCE/2 * std::sin(angle);
pSpheres[2]->GetMotionMaster()->MovePoint(0, x, y, pSpheres[2]->GetPositionZ());
}
}
@@ -25,10 +25,8 @@ enum Spells
SPELL_SUMMON_CARRION_BEETLES = 53521,
SPELL_LEECHING_SWARM = 53467,
SPELL_POUND = 53472,
SPELL_POUND_H = 59433,
SPELL_SUBMERGE = 53421,
SPELL_IMPALE_DMG = 53454,
SPELL_IMPALE_DMG_H = 59446,
SPELL_IMPALE_SHAKEGROUND = 53455,
SPELL_IMPALE_SPIKE = 53539, //this is not the correct visual effect
//SPELL_IMPALE_TARGET = 53458,
@@ -211,7 +209,7 @@ public:
break;
case IMPALE_PHASE_DMG:
if (Creature* impaleTarget = Unit::GetCreature(*me, ImpaleTarget))
me->CastSpell(impaleTarget, DUNGEON_MODE(SPELL_IMPALE_DMG, SPELL_IMPALE_DMG_H), true);
me->CastSpell(impaleTarget, SPELL_IMPALE_DMG, true);
ImpalePhase = IMPALE_PHASE_TARGET;
ImpaleTimer = 9*IN_MILLISECONDS;
break;
@@ -328,7 +326,7 @@ public:
if (Unit* target = me->getVictim())
{
if (Creature* pImpaleTarget = DoSummonImpaleTarget(target))
me->CastSpell(pImpaleTarget, DUNGEON_MODE(SPELL_POUND, SPELL_POUND_H), false);
me->CastSpell(pImpaleTarget, SPELL_POUND, false);
}
PoundTimer = 16500;
} else PoundTimer -= diff;
@@ -42,6 +42,8 @@ enum Events
EVENT_FLIGHT = 2,
EVENT_FLAME_BREATH = 3,
EVENT_CONFLAGRATION = 4,
EVENT_LAND_GROUND = 5,
EVENT_AIR_MOVEMENT = 6,
// Event group
EVENT_GROUP_LAND_PHASE = 1,
@@ -51,6 +53,8 @@ enum MovementPoints
{
POINT_FLIGHT = 1,
POINT_LAND = 2,
POINT_TAKEOFF = 3,
POINT_LAND_GROUND = 4
};
enum Misc
@@ -58,8 +62,9 @@ enum Misc
SOUND_ID_DEATH = 17531,
};
Position const SavianaRagefireFlyPos = {3155.51f, 683.844f, 95.20f, 4.69f};
Position const SavianaRagefireLandPos = {3151.07f, 636.443f, 79.54f, 4.69f};
Position const SavianaRagefireFlyOutPos = {3155.51f, 683.844f, 95.0f, 4.69f};
Position const SavianaRagefireFlyInPos = {3151.07f, 636.443f, 79.540f, 4.69f};
Position const SavianaRagefireLandPos = {3151.07f, 636.443f, 78.649f, 4.69f};
class boss_saviana_ragefire : public CreatureScript
{
@@ -96,7 +101,7 @@ class boss_saviana_ragefire : public CreatureScript
void MovementInform(uint32 type, uint32 point)
{
if (type != POINT_MOTION_TYPE)
if (type != POINT_MOTION_TYPE && type != EFFECT_MOTION_TYPE)
return;
switch (point)
@@ -106,13 +111,18 @@ class boss_saviana_ragefire : public CreatureScript
Talk(SAY_CONFLAGRATION);
break;
case POINT_LAND:
events.ScheduleEvent(EVENT_LAND_GROUND, 1);
break;
case POINT_LAND_GROUND:
me->SetCanFly(false);
me->SetDisableGravity(false);
me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER);
me->SetReactState(REACT_AGGRESSIVE);
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE)
me->GetMotionMaster()->MovementExpired();
DoStartMovement(me->getVictim());
break;
case POINT_TAKEOFF:
events.ScheduleEvent(EVENT_AIR_MOVEMENT, 1);
break;
default:
break;
}
@@ -149,8 +159,13 @@ class boss_saviana_ragefire : public CreatureScript
{
me->SetCanFly(true);
me->SetDisableGravity(true);
me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER);
me->SetReactState(REACT_PASSIVE);
me->GetMotionMaster()->MovePoint(POINT_FLIGHT, SavianaRagefireFlyPos);
me->AttackStop();
Position pos;
pos.Relocate(me);
pos.m_positionZ += 10.0f;
me->GetMotionMaster()->MoveTakeoff(POINT_TAKEOFF, pos);
events.ScheduleEvent(EVENT_FLIGHT, 50000);
events.DelayEvents(12500, EVENT_GROUP_LAND_PHASE);
break;
@@ -167,6 +182,12 @@ class boss_saviana_ragefire : public CreatureScript
DoCastVictim(SPELL_FLAME_BREATH);
events.ScheduleEvent(EVENT_FLAME_BREATH, urand(20000, 30000), EVENT_GROUP_LAND_PHASE);
break;
case EVENT_AIR_MOVEMENT:
me->GetMotionMaster()->MovePoint(POINT_FLIGHT, SavianaRagefireFlyOutPos);
break;
case EVENT_LAND_GROUND:
me->GetMotionMaster()->MoveLand(POINT_LAND_GROUND, SavianaRagefireLandPos);
break;
default:
break;
}
@@ -243,7 +264,7 @@ class spell_saviana_conflagration_throwback : public SpellScriptLoader
{
PreventHitDefaultEffect(effIndex);
GetHitUnit()->CastSpell(GetCaster(), uint32(GetEffectValue()), true);
GetHitUnit()->GetMotionMaster()->MovePoint(POINT_LAND, SavianaRagefireLandPos);
GetHitUnit()->GetMotionMaster()->MovePoint(POINT_LAND, SavianaRagefireFlyInPos);
}
void Register()
@@ -1585,7 +1585,7 @@ class spell_valanar_kinetic_bomb_absorb : public SpellScriptLoader
void OnAbsorb(AuraEffect* aurEff, DamageInfo& dmgInfo, uint32& absorbAmount)
{
absorbAmount = CalculatePctN(dmgInfo.GetDamage(), aurEff->GetAmount());
absorbAmount = CalculatePct(dmgInfo.GetDamage(), aurEff->GetAmount());
RoundToInterval<uint32>(absorbAmount, 0, dmgInfo.GetDamage());
dmgInfo.AbsorbDamage(absorbAmount);
}
@@ -722,7 +722,7 @@ class npc_putricide_oozeAI : public ScriptedAI
{
public:
npc_putricide_oozeAI(Creature* creature, uint32 hitTargetSpellId) : ScriptedAI(creature),
_newTargetSelectTimer(0), _hitTargetSpellId(hitTargetSpellId)
_hitTargetSpellId(hitTargetSpellId), _newTargetSelectTimer(0)
{
}
@@ -207,9 +207,7 @@ class mob_chaotic_rift : public CreatureScript
{
uiChaoticEnergyBurstTimer = 1000;
uiSummonCrazedManaWraithTimer = 5000;
//me->SetDisplayId(25206); //For some reason in DB models for ally and horde are different.
//Model for ally (1126) does not show auras. Horde model works perfect.
//Set model to horde number
me->SetDisplayId(me->GetCreatureTemplate()->Modelid2);
DoCast(me, SPELL_ARCANEFORM, false);
}
@@ -129,14 +129,14 @@ public:
{
if (uiCrystalSpikesTimer2 <= diff)
{
fSpikeXY[0][0] = fBaseX+(SPIKE_DISTANCE*uiCrystalSpikesCount*cos(fBaseO));
fSpikeXY[0][1] = fBaseY+(SPIKE_DISTANCE*uiCrystalSpikesCount*sin(fBaseO));
fSpikeXY[1][0] = fBaseX-(SPIKE_DISTANCE*uiCrystalSpikesCount*cos(fBaseO));
fSpikeXY[1][1] = fBaseY-(SPIKE_DISTANCE*uiCrystalSpikesCount*sin(fBaseO));
fSpikeXY[2][0] = fBaseX+(SPIKE_DISTANCE*uiCrystalSpikesCount*cos(fBaseO-(M_PI/2)));
fSpikeXY[2][1] = fBaseY+(SPIKE_DISTANCE*uiCrystalSpikesCount*sin(fBaseO-(M_PI/2)));
fSpikeXY[3][0] = fBaseX-(SPIKE_DISTANCE*uiCrystalSpikesCount*cos(fBaseO-(M_PI/2)));
fSpikeXY[3][1] = fBaseY-(SPIKE_DISTANCE*uiCrystalSpikesCount*sin(fBaseO-(M_PI/2)));
fSpikeXY[0][0] = fBaseX+(SPIKE_DISTANCE*uiCrystalSpikesCount* std::cos(fBaseO));
fSpikeXY[0][1] = fBaseY+(SPIKE_DISTANCE*uiCrystalSpikesCount* std::sin(fBaseO));
fSpikeXY[1][0] = fBaseX-(SPIKE_DISTANCE*uiCrystalSpikesCount* std::cos(fBaseO));
fSpikeXY[1][1] = fBaseY-(SPIKE_DISTANCE*uiCrystalSpikesCount* std::sin(fBaseO));
fSpikeXY[2][0] = fBaseX+(SPIKE_DISTANCE*uiCrystalSpikesCount* std::cos(fBaseO-(M_PI/2)));
fSpikeXY[2][1] = fBaseY+(SPIKE_DISTANCE*uiCrystalSpikesCount* std::sin(fBaseO-(M_PI/2)));
fSpikeXY[3][0] = fBaseX-(SPIKE_DISTANCE*uiCrystalSpikesCount* std::cos(fBaseO-(M_PI/2)));
fSpikeXY[3][1] = fBaseY-(SPIKE_DISTANCE*uiCrystalSpikesCount* std::sin(fBaseO-(M_PI/2)));
for (uint8 i = 0; i < 4; ++i)
me->SummonCreature(MOB_CRYSTAL_SPIKE, fSpikeXY[i][0], fSpikeXY[i][1], fBaseZ, 0, TEMPSUMMON_TIMED_DESPAWN, 7*IN_MILLISECONDS);
if (++uiCrystalSpikesCount >= 13)
@@ -68,51 +68,6 @@ enum Actions
ACTION_SET_NORMAL_EVENTS = 1
};
/*Ruby Drake,
(npc 27756) (item 37860)
(summoned by spell Ruby Essence = 37860 ---> Call Amber Drake == 49462 ---> Summon 27756)
*/
enum RubyDrake
{
NPC_RUBY_DRAKE_VEHICLE = 27756,
SPELL_RIDE_RUBY_DRAKE_QUE = 49463, //Apply Aura: Periodic Trigger, Interval: 3 seconds ---> 49464
SPELL_RUBY_DRAKE_SADDLE = 49464, //Allows you to ride on the back of an Amber Drake. ---> Dummy
SPELL_RUBY_SEARING_WRATH = 50232, //(60 yds) - Instant - Breathes a stream of fire at an enemy dragon, dealing 6800 to 9200 Fire damage and then jumping to additional dragons within 30 yards. Each jump increases the damage by 50%. Affects up to 5 total targets
SPELL_RUBY_EVASIVE_AURA = 50248, //Instant - Allows the Ruby Drake to generate Evasive Charges when hit by hostile attacks and spells.
SPELL_RUBY_EVASIVE_MANEUVERS = 50240, //Instant - 5 sec. cooldown - Allows your drake to dodge all incoming attacks and spells. Requires Evasive Charges to use. Each attack or spell dodged while this ability is active burns one Evasive Charge. Lasts 30 sec. or until all charges are exhausted.
//you do not have acces to until you kill Mage-Lord Urom
SPELL_RUBY_MARTYR = 50253 //Instant - 10 sec. cooldown - Redirect all harmful spells cast at friendly drakes to yourself for 10 sec.
};
/*Amber Drake,
(npc 27755) (item 37859)
(summoned by spell Amber Essence = 37859 ---> Call Amber Drake == 49461 ---> Summon 27755)
*/
enum AmberDrake
{
NPC_AMBER_DRAKE_VEHICLE = 27755,
SPELL_RIDE_AMBER_DRAKE_QUE = 49459, //Apply Aura: Periodic Trigger, Interval: 3 seconds ---> 49460
SPELL_AMBER_DRAKE_SADDLE = 49460, //Allows you to ride on the back of an Amber Drake. ---> Dummy
SPELL_AMBER_SHOCK_LANCE = 49840, //(60 yds) - Instant - Deals 4822 to 5602 Arcane damage and detonates all Shock Charges on an enemy dragon. Damage is increased by 6525 for each detonated.
// SPELL_AMBER_STOP_TIME //Instant - 1 min cooldown - Halts the passage of time, freezing all enemy dragons in place for 10 sec. This attack applies 5 Shock Charges to each affected target.
//you do not have access to until you kill the Mage-Lord Urom.
SPELL_AMBER_TEMPORAL_RIFT = 49592 //(60 yds) - Channeled - Channels a temporal rift on an enemy dragon for 10 sec. While trapped in the rift, all damage done to the target is increased by 100%. In addition, for every 15, 000 damage done to a target affected by Temporal Rift, 1 Shock Charge is generated.
};
/*Emerald Drake,
(npc 27692) (item 37815),
(summoned by spell Emerald Essence = 37815 ---> Call Emerald Drake == 49345 ---> Summon 27692)
*/
enum EmeraldDrake
{
NPC_EMERALD_DRAKE_VEHICLE = 27692,
SPELL_RIDE_EMERALD_DRAKE_QUE = 49427, //Apply Aura: Periodic Trigger, Interval: 3 seconds ---> 49346
SPELL_EMERALD_DRAKE_SADDLE = 49346, //Allows you to ride on the back of an Amber Drake. ---> Dummy
SPELL_EMERALD_LEECHING_POISON = 50328, //(60 yds) - Instant - Poisons the enemy dragon, leeching 1300 to the caster every 2 sec. for 12 sec. Stacks up to 3 times.
SPELL_EMERALD_TOUCH_THE_NIGHTMARE = 50341, //(60 yds) - Instant - Consumes 30% of the caster's max health to inflict 25, 000 nature damage to an enemy dragon and reduce the damage it deals by 25% for 30 sec.
// you do not have access to until you kill the Mage-Lord Urom
SPELL_EMERALD_DREAM_FUNNEL = 50344 //(60 yds) - Channeled - Transfers 5% of the caster's max health to a friendly drake every second for 10 seconds as long as the caster channels.
};
enum EregosData
{
DATA_RUBY_VOID = 0, // http://www.wowhead.com/achievement=2044
@@ -38,7 +38,8 @@ enum Spells
SPELL_SUMMON_MENAGERIE_3 = 50496,
SPELL_TELEPORT = 51112, //Teleports to the center of Oculus
SPELL_TIME_BOMB = 51121, //Deals arcane damage to a random player, and after 6 seconds, deals zone damage to nearby equal to the health missing of the target afflicted by the debuff.
SPELL_TIME_BOMB_2 = 59376
SPELL_TIME_BOMB_2 = 59376,
SPELL_EVOCATE = 51602 // He always cast it on reset or after teleportation
};
enum Yells
@@ -103,10 +104,9 @@ public:
void Reset()
{
if (instance->GetBossState(DATA_VAROS_EVENT) != DONE)
DoCast(SPELL_ARCANE_SHIELD);
_Reset();
me->CastSpell(me, SPELL_EVOCATE);
_Reset();
if (instance->GetData(DATA_UROM_PLATAFORM) == 0)
{
@@ -307,14 +307,17 @@ public:
case SPELL_SUMMON_MENAGERIE:
me->SetHomePosition(968.66f, 1042.53f, 527.32f, 0.077f);
LeaveCombat();
me->CastSpell(me, SPELL_EVOCATE);
break;
case SPELL_SUMMON_MENAGERIE_2:
me->SetHomePosition(1164.02f, 1170.85f, 527.321f, 3.66f);
LeaveCombat();
me->CastSpell(me, SPELL_EVOCATE);
break;
case SPELL_SUMMON_MENAGERIE_3:
me->SetHomePosition(1118.31f, 1080.377f, 508.361f, 4.25f);
LeaveCombat();
me->CastSpell(me, SPELL_EVOCATE);
break;
case SPELL_TELEPORT:
//! Unconfirmed, previous below
@@ -56,9 +56,13 @@ public:
eregosCacheGUID = 0;
azureDragonsList.clear();
gwhelpList.clear();
gameObjectList.clear();
}
belgaristraszGUID = 0;
eternosGUID = 0;
verdisaGUID = 0;
}
void OnUnitDeath(Unit* unit)
{
@@ -112,17 +116,49 @@ public:
break;
case NPC_VAROS:
varosGUID = creature->GetGUID();
if (GetBossState(DATA_DRAKOS_EVENT) == DONE)
creature->SetPhaseMask(1, true);
break;
case NPC_UROM:
uromGUID = creature->GetGUID();
if (GetBossState(DATA_VAROS_EVENT) == DONE)
creature->SetPhaseMask(1, true);
break;
case NPC_EREGOS:
eregosGUID = creature->GetGUID();
if (GetBossState(DATA_UROM_EVENT) == DONE)
creature->SetPhaseMask(1, true);
break;
case NPC_CENTRIFUGE_CONSTRUCT:
if (creature->isAlive())
DoUpdateWorldState(WORLD_STATE_CENTRIFUGE_CONSTRUCT_AMOUNT, ++centrifugueConstructCounter);
break;
case NPC_BELGARISTRASZ:
belgaristraszGUID = creature->GetGUID();
if (GetBossState(DATA_DRAKOS_EVENT) == DONE)
creature->SetWalk(true),
creature->GetMotionMaster()->MovePoint(0, 941.453f, 1044.1f, 359.967f),
creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
break;
case NPC_ETERNOS:
eternosGUID = creature->GetGUID();
if (GetBossState(DATA_DRAKOS_EVENT) == DONE)
creature->SetWalk(true),
creature->GetMotionMaster()->MovePoint(0, 943.202f, 1059.35f, 359.967f),
creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
break;
case NPC_VERDISA:
verdisaGUID = creature->GetGUID();
if (GetBossState(DATA_DRAKOS_EVENT) == DONE)
creature->SetWalk(true),
creature->GetMotionMaster()->MovePoint(0, 949.188f, 1032.91f, 359.967f),
creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
break;
case NPC_GREATER_WHELP:
if (GetBossState(DATA_UROM_EVENT) == DONE)
creature->SetPhaseMask(1, true);
gwhelpList.push_back(creature->GetGUID());
break;
}
}
@@ -159,11 +195,22 @@ public:
DoUpdateWorldState(WORLD_STATE_CENTRIFUGE_CONSTRUCT_SHOW, 1);
DoUpdateWorldState(WORLD_STATE_CENTRIFUGE_CONSTRUCT_AMOUNT, centrifugueConstructCounter);
OpenCageDoors();
FreeDragons();
if (Creature* varos = instance->GetCreature(varosGUID))
varos->SetPhaseMask(1, true);
}
break;
case DATA_VAROS_EVENT:
if (state == DONE)
DoUpdateWorldState(WORLD_STATE_CENTRIFUGE_CONSTRUCT_SHOW, 0);
if (Creature* urom = instance->GetCreature(uromGUID))
urom->SetPhaseMask(1, true);
break;
case DATA_UROM_EVENT:
if (state == DONE)
if (Creature* eregos = instance->GetCreature(eregosGUID))
eregos->SetPhaseMask(1, true);
GreaterWhelps();
break;
case DATA_EREGOS_EVENT:
if (state == DONE)
@@ -221,6 +268,31 @@ public:
}
}
void FreeDragons()
{
if (Creature* belgaristrasz = instance->GetCreature(belgaristraszGUID))
belgaristrasz->SetWalk(true),
belgaristrasz->GetMotionMaster()->MovePoint(0, 941.453f, 1044.1f, 359.967f);
if (Creature* eternos = instance->GetCreature(eternosGUID))
eternos->SetWalk(true),
eternos->GetMotionMaster()->MovePoint(0, 943.202f, 1059.35f, 359.967f);
if (Creature* verdisa = instance->GetCreature(verdisaGUID))
verdisa->SetWalk(true),
verdisa->GetMotionMaster()->MovePoint(0, 949.188f, 1032.91f, 359.967f);
}
void GreaterWhelps()
{
if (gwhelpList.empty())
return;
for (std::list<uint64>::const_iterator itr = gwhelpList.begin(); itr != gwhelpList.end(); ++itr)
{
if (Creature* gwhelp = instance->GetCreature(*itr))
gwhelp->SetPhaseMask(1, true);
}
}
std::string GetSaveData()
{
OUT_SAVE_INST_DATA;
@@ -269,6 +341,10 @@ public:
uint64 uromGUID;
uint64 eregosGUID;
uint64 belgaristraszGUID;
uint64 eternosGUID;
uint64 verdisaGUID;
uint8 platformUrom;
uint8 centrifugueConstructCounter;
@@ -277,9 +353,8 @@ public:
std::string str_data;
std::list<uint64> gameObjectList;
std::list<uint64> azureDragonsList;
std::list<uint64> gwhelpList;
};
};
void AddSC_instance_oculus()
@@ -20,6 +20,8 @@
#include "ScriptedGossip.h"
#include "SpellScript.h"
#include "SpellAuraEffects.h"
#include "Vehicle.h"
#include "CombatAI.h"
#include "oculus.h"
#define GOSSIP_ITEM_DRAKES "So where do we go from here?"
@@ -32,7 +34,7 @@
#define HAS_ESSENCE(a) ((a)->HasItemCount(ITEM_EMERALD_ESSENCE, 1) || (a)->HasItemCount(ITEM_AMBER_ESSENCE, 1) || (a)->HasItemCount(ITEM_RUBY_ESSENCE, 1))
enum Drakes
enum GossipNPCs
{
GOSSIP_TEXTID_DRAKES = 13267,
GOSSIP_TEXTID_BELGARISTRASZ1 = 12916,
@@ -49,25 +51,67 @@ enum Drakes
ITEM_AMBER_ESSENCE = 37859,
ITEM_RUBY_ESSENCE = 37860,
NPC_VERDISA = 27657,
NPC_BELGARISTRASZ = 27658,
NPC_ETERNOS = 27659,
SPELL_SHOCK_CHARGE = 49836
};
SPELL_SHOCK_CHARGE = 49836,
enum Drakes
{
/*Ruby Drake,
(npc 27756) (item 37860)
(summoned by spell Ruby Essence = 37860 ---> Call Amber Drake == 49462 ---> Summon 27756)
*/
SPELL_RIDE_RUBY_DRAKE_QUE = 49463, //Apply Aura: Periodic Trigger, Interval: 3 seconds ---> 49464
SPELL_RUBY_DRAKE_SADDLE = 49464, //Allows you to ride on the back of an Amber Drake. ---> Dummy
SPELL_RUBY_SEARING_WRATH = 50232, //(60 yds) - Instant - Breathes a stream of fire at an enemy dragon, dealing 6800 to 9200 Fire damage and then jumping to additional dragons within 30 yards. Each jump increases the damage by 50%. Affects up to 5 total targets
SPELL_RUBY_EVASIVE_AURA = 50248, //Instant - Allows the Ruby Drake to generate Evasive Charges when hit by hostile attacks and spells.
SPELL_RUBY_EVASIVE_MANEUVERS = 50240, //Instant - 5 sec. cooldown - Allows your drake to dodge all incoming attacks and spells. Requires Evasive Charges to use. Each attack or spell dodged while this ability is active burns one Evasive Charge. Lasts 30 sec. or until all charges are exhausted.
//you do not have acces to until you kill Mage-Lord Urom
SPELL_RUBY_MARTYR = 50253, //Instant - 10 sec. cooldown - Redirect all harmful spells cast at friendly drakes to yourself for 10 sec.
/*Amber Drake,
(npc 27755) (item 37859)
(summoned by spell Amber Essence = 37859 ---> Call Amber Drake == 49461 ---> Summon 27755)
*/
SPELL_RIDE_AMBER_DRAKE_QUE = 49459, //Apply Aura: Periodic Trigger, Interval: 3 seconds ---> 49460
SPELL_AMBER_DRAKE_SADDLE = 49460, //Allows you to ride on the back of an Amber Drake. ---> Dummy
SPELL_AMBER_SHOCK_LANCE = 49840, //(60 yds) - Instant - Deals 4822 to 5602 Arcane damage and detonates all Shock Charges on an enemy dragon. Damage is increased by 6525 for each detonated.
// SPELL_AMBER_STOP_TIME //Instant - 1 min cooldown - Halts the passage of time, freezing all enemy dragons in place for 10 sec. This attack applies 5 Shock Charges to each affected target.
//you do not have access to until you kill the Mage-Lord Urom.
SPELL_AMBER_TEMPORAL_RIFT = 49592, //(60 yds) - Channeled - Channels a temporal rift on an enemy dragon for 10 sec. While trapped in the rift, all damage done to the target is increased by 100%. In addition, for every 15, 000 damage done to a target affected by Temporal Rift, 1 Shock Charge is generated.
/*Emerald Drake,
(npc 27692) (item 37815),
(summoned by spell Emerald Essence = 37815 ---> Call Emerald Drake == 49345 ---> Summon 27692)
*/
SPELL_RIDE_EMERALD_DRAKE_QUE = 49427, //Apply Aura: Periodic Trigger, Interval: 3 seconds ---> 49346
SPELL_EMERALD_DRAKE_SADDLE = 49346, //Allows you to ride on the back of an Amber Drake. ---> Dummy
SPELL_EMERALD_LEECHING_POISON = 50328, //(60 yds) - Instant - Poisons the enemy dragon, leeching 1300 to the caster every 2 sec. for 12 sec. Stacks up to 3 times.
SPELL_EMERALD_TOUCH_THE_NIGHTMARE = 50341, //(60 yds) - Instant - Consumes 30% of the caster's max health to inflict 25, 000 nature damage to an enemy dragon and reduce the damage it deals by 25% for 30 sec.
// you do not have access to until you kill the Mage-Lord Urom
SPELL_EMERALD_DREAM_FUNNEL = 50344, //(60 yds) - Channeled - Transfers 5% of the caster's max health to a friendly drake every second for 10 seconds as long as the caster channels.
};
enum Says
{
SAY_VAROS = 0,
SAY_UROM = 1
SAY_VAROS = 0,
SAY_UROM = 1,
SAY_BELGARISTRASZ = 0,
SAY_DRAKES_TAKEOFF = 0,
WHISPER_DRAKES_WELCOME = 1,
WHISPER_DRAKES_ABILITIES = 2,
WHISPER_DRAKES_SPECIAL = 3,
WHISPER_DRAKES_LOWHEALTH = 4
};
class npc_oculus_drake : public CreatureScript
class npc_verdisa_beglaristrasz_eternos : public CreatureScript
{
public:
npc_oculus_drake() : CreatureScript("npc_oculus_drake") { }
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
npc_verdisa_beglaristrasz_eternos() : CreatureScript("npc_verdisa_beglaristrasz_eternos") { }
InstanceScript* instance;
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
{
player->PlayerTalkClass->ClearMenus();
switch (creature->GetEntry())
@@ -184,6 +228,28 @@ public:
return true;
}
struct npc_verdisa_beglaristrasz_eternosAI : public ScriptedAI
{
npc_verdisa_beglaristrasz_eternosAI(Creature* creature) : ScriptedAI(creature) { }
void MovementInform(uint32 type, uint32 id)
{
// When Belgaristraz finish his moving say grateful text
if (me->GetEntry() == NPC_BELGARISTRASZ)
if (id == 0)
{
Talk(SAY_BELGARISTRASZ);
}
// The gossip flag should activate when Drakos die and not from DB
if (id == 0)
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new npc_verdisa_beglaristrasz_eternosAI(creature);
}
};
class npc_image_belgaristrasz : public CreatureScript
@@ -193,7 +259,7 @@ public:
struct npc_image_belgaristraszAI : public ScriptedAI
{
npc_image_belgaristraszAI(Creature* creature) : ScriptedAI(creature) {}
npc_image_belgaristraszAI(Creature* creature) : ScriptedAI(creature) { }
void IsSummonedBy(Unit* summoner)
{
@@ -216,6 +282,176 @@ public:
}
};
class npc_ruby_emerald_amber_drake : public CreatureScript
{
public:
npc_ruby_emerald_amber_drake() : CreatureScript("npc_ruby_emerald_amber_drake") { }
struct npc_ruby_emerald_amber_drakeAI : public VehicleAI
{
npc_ruby_emerald_amber_drakeAI(Creature* creature) : VehicleAI(creature)
{
instance = creature->GetInstanceScript();
}
InstanceScript* instance;
uint64 summonerGUID;
uint32 WelcomeTimer;
uint32 WelcomeSequelTimer;
uint32 SpecialTimer;
uint32 WarningTimer;
uint32 TakeOffTimer;
bool WelcomeOff;
bool WelcomeSequelOff;
bool SpecialOff;
bool HealthWarningOff;
bool DisableTakeOff;
void Reset()
{
summonerGUID = 0;
WelcomeTimer = 4500;
WelcomeSequelTimer = 4500;
SpecialTimer = 10000;
WarningTimer = 25000;
TakeOffTimer = 3500;
WelcomeOff = false;
WelcomeSequelOff = false;
SpecialOff = false;
HealthWarningOff = false;
DisableTakeOff = false;
}
void IsSummonedBy(Unit* summoner)
{
if (instance->GetBossState(DATA_EREGOS_EVENT) == IN_PROGRESS)
if (Creature* eregos = me->FindNearestCreature(NPC_EREGOS, 450.0f, true))
{
eregos->DespawnOrUnsummon(); // On retail this kills abusive call of drake during engaged Eregos
}
summonerGUID = summoner->GetGUID();
me->SetFacingToObject(summoner);
// TO DO: Drake Ques should be casted from vehicle to player, however the way core handle triggered spells from auras break it no matter the conditions. So this change the caster and give the same result until someone fix triggered spells from auras that involve implicit targets or make exception for this case.
if (me->GetEntry() == NPC_RUBY_DRAKE_VEHICLE)
summoner->CastSpell(summoner, SPELL_RIDE_RUBY_DRAKE_QUE);
if (me->GetEntry() == NPC_EMERALD_DRAKE_VEHICLE)
summoner->CastSpell(summoner, SPELL_RIDE_EMERALD_DRAKE_QUE);
if (me->GetEntry() == NPC_AMBER_DRAKE_VEHICLE)
summoner->CastSpell(summoner, SPELL_RIDE_AMBER_DRAKE_QUE);
Position pos;
summoner->GetPosition(&pos);
me->GetMotionMaster()->MovePoint(0, pos);
}
void MovementInform(uint32 type, uint32 id)
{
if (type == POINT_MOTION_TYPE && id == 0)
{
me->SetDisableGravity(false); // Needed this for proper animation after spawn, the summon in air fall to ground bug leave no other option for now, if this isn't used the drake will only walk on move.
}
}
void UpdateAI(const uint32 diff)
{
if (!(instance->GetBossState(DATA_VAROS_EVENT) == DONE))
{
if (me->HasAuraType(SPELL_AURA_CONTROL_VEHICLE))
{
if (!(WelcomeOff))
{
if (WelcomeTimer <= diff)
{
Talk(WHISPER_DRAKES_WELCOME, me->GetCreatorGUID());
WelcomeOff = true;
WelcomeSequelOff = true;
}
else WelcomeTimer -= diff;
}
}
}
if (me->HasAuraType(SPELL_AURA_CONTROL_VEHICLE))
{
if (WelcomeSequelOff)
{
if (WelcomeSequelTimer <= diff)
{
Talk(WHISPER_DRAKES_ABILITIES, me->GetCreatorGUID());
WelcomeSequelOff = false;
}
else WelcomeSequelTimer -= diff;
}
}
if (me->HasAuraType(SPELL_AURA_CONTROL_VEHICLE))
{
if (instance->GetBossState(DATA_UROM_EVENT) == DONE)
{
if (!(SpecialOff))
{
if (SpecialTimer <= diff)
{
Talk(WHISPER_DRAKES_SPECIAL, me->GetCreatorGUID());
SpecialOff = true;
}
else SpecialTimer -= diff;
}
}
}
if (me->HasAuraType(SPELL_AURA_CONTROL_VEHICLE))
{
if (!(HealthWarningOff))
{
if (me->GetHealthPct() <= 40.0f)
{
Talk(WHISPER_DRAKES_LOWHEALTH, me->GetCreatorGUID());
HealthWarningOff = true;
}
}
}
if (me->HasAuraType(SPELL_AURA_CONTROL_VEHICLE))
{
if (HealthWarningOff)
{
if (WarningTimer <= diff)
{
HealthWarningOff = false;
WarningTimer = 25000;
}
else WarningTimer -= diff;
}
}
if (!(me->HasAuraType(SPELL_AURA_CONTROL_VEHICLE)))
{
if (!(DisableTakeOff))
{
if (TakeOffTimer <= diff)
{
me->DespawnOrUnsummon(2050);
me->SetOrientation(2.5f);
me->SetSpeed(MOVE_FLIGHT, 1.0f, true);
Talk(SAY_DRAKES_TAKEOFF);
Position pos;
me->GetPosition(&pos);
pos.m_positionX += 10.0f;
pos.m_positionY += 10.0f;
pos.m_positionZ += 12.0f;
me->GetMotionMaster()->MovePoint(1, pos);
DisableTakeOff = true;
}
else TakeOffTimer -= diff;
}
}
};
};
CreatureAI* GetAI(Creature* creature) const
{
return new npc_ruby_emerald_amber_drakeAI(creature);
}
};
class spell_gen_stop_time : public SpellScriptLoader
{
public:
@@ -247,9 +483,50 @@ public:
}
};
class spell_call_ruby_emerald_amber_drake : public SpellScriptLoader
{
public:
spell_call_ruby_emerald_amber_drake() : SpellScriptLoader("spell_call_ruby_emerald_amber_drake") { }
class spell_call_ruby_emerald_amber_drake_SpellScript : public SpellScript
{
PrepareSpellScript(spell_call_ruby_emerald_amber_drake_SpellScript);
void ChangeSummonPos(SpellEffIndex /*effIndex*/)
{
// Adjust effect summon position
WorldLocation summonPos = *GetExplTargetDest();
Position offset = {0.0f, 0.0f, 12.0f, 0.0f};
summonPos.RelocateOffset(offset);
SetExplTargetDest(summonPos);
GetHitDest()->RelocateOffset(offset);
}
void ModDestHeight(SpellEffIndex /*effIndex*/)
{
// Used to cast visual effect at proper position
Position offset = {0.0f, 0.0f, 12.0f, 0.0f};
const_cast<WorldLocation*>(GetExplTargetDest())->RelocateOffset(offset);
}
void Register()
{
OnEffectHit += SpellEffectFn(spell_call_ruby_emerald_amber_drake_SpellScript::ChangeSummonPos, EFFECT_0, SPELL_EFFECT_SUMMON);
OnEffectLaunch += SpellEffectFn(spell_call_ruby_emerald_amber_drake_SpellScript::ModDestHeight, EFFECT_0, SPELL_EFFECT_SUMMON);
}
};
SpellScript* GetSpellScript() const
{
return new spell_call_ruby_emerald_amber_drake_SpellScript();
}
};
void AddSC_oculus()
{
new npc_oculus_drake();
new npc_verdisa_beglaristrasz_eternos();
new npc_image_belgaristrasz();
new npc_ruby_emerald_amber_drake();
new spell_gen_stop_time();
new spell_call_ruby_emerald_amber_drake();
}
@@ -35,15 +35,22 @@ enum Data64
DATA_EREGOS
};
enum Bosses
enum Bosses_NPCs
{
NPC_DRAKOS = 27654,
NPC_VAROS = 27447,
NPC_UROM = 27655,
NPC_EREGOS = 27656,
NPC_AZURE_RING_GUARDIAN = 28236,
NPC_CENTRIFUGE_CONSTRUCT = 27641,
NPC_AZURE_RING_GUARDIAN = 28236,
NPC_CENTRIFUGE_CONSTRUCT = 27641,
NPC_RUBY_DRAKE_VEHICLE = 27756,
NPC_EMERALD_DRAKE_VEHICLE = 27692,
NPC_AMBER_DRAKE_VEHICLE = 27755,
NPC_VERDISA = 27657,
NPC_BELGARISTRASZ = 27658,
NPC_ETERNOS = 27659,
NPC_GREATER_WHELP = 28276
};
enum GameObjects
@@ -521,7 +521,7 @@ class boss_algalon_the_observer : public CreatureScript
if (Creature* wormHole = DoSummon(NPC_WORM_HOLE, CollapsingStarPos[i], TEMPSUMMON_MANUAL_DESPAWN))
wormHole->m_Events.AddEvent(new SummonUnleashedDarkMatter(wormHole), wormHole->m_Events.CalculateTime(i >= 2 ? 8000 : 6000));
}
else if ((int32(me->GetHealth()) - int32(damage)) < CalculatePctF<int32>(int32(me->GetMaxHealth()), 2.5f) && !_fightWon)
else if ((int32(me->GetHealth()) - int32(damage)) < CalculatePct<int32>(int32(me->GetMaxHealth()), 2.5f) && !_fightWon)
{
_fightWon = true;
damage = 0;
@@ -181,8 +181,8 @@ class boss_warp_splinter : public CreatureScript
{
float angle = (M_PI / 3) * i;
float X = Treant_Spawn_Pos_X + TREANT_SPAWN_DIST * cos(angle);
float Y = Treant_Spawn_Pos_Y + TREANT_SPAWN_DIST * sin(angle);
float X = Treant_Spawn_Pos_X + TREANT_SPAWN_DIST * std::cos(angle);
float Y = Treant_Spawn_Pos_Y + TREANT_SPAWN_DIST * std::sin(angle);
float O = - me->GetAngle(X, Y);
if (Creature* pTreant = me->SummonCreature(CREATURE_TREANT, treant_pos[i][0], treant_pos[i][1], treant_pos[i][2], O, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000))
@@ -194,7 +194,7 @@ class spell_mark_of_kazzak : public SpellScriptLoader
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
{
if (Unit* owner = GetUnitOwner())
amount = CalculatePctU(owner->GetPower(POWER_MANA), 5);
amount = CalculatePct(owner->GetPower(POWER_MANA), 5);
}
void OnPeriodic(AuraEffect const* aurEff)
+8 -8
View File
@@ -70,7 +70,7 @@ class spell_dk_anti_magic_shell_raid : public SpellScriptLoader
void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount)
{
absorbAmount = CalculatePctN(dmgInfo.GetDamage(), absorbPct);
absorbAmount = CalculatePct(dmgInfo.GetDamage(), absorbPct);
}
void Register()
@@ -118,7 +118,7 @@ class spell_dk_anti_magic_shell_self : public SpellScriptLoader
void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount)
{
absorbAmount = std::min(CalculatePctN(dmgInfo.GetDamage(), absorbPct), GetTarget()->CountPctFromMaxHealth(hpPct));
absorbAmount = std::min(CalculatePct(dmgInfo.GetDamage(), absorbPct), GetTarget()->CountPctFromMaxHealth(hpPct));
}
void Trigger(AuraEffect* aurEff, DamageInfo & /*dmgInfo*/, uint32 & absorbAmount)
@@ -179,7 +179,7 @@ class spell_dk_anti_magic_zone : public SpellScriptLoader
void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount)
{
absorbAmount = CalculatePctN(dmgInfo.GetDamage(), absorbPct);
absorbAmount = CalculatePct(dmgInfo.GetDamage(), absorbPct);
}
void Register()
@@ -413,7 +413,7 @@ class spell_dk_scourge_strike : public SpellScriptLoader
multiplier = (GetEffectValue() * unitTarget->GetDiseasesByCaster(caster->GetGUID()) / 100.f);
// Death Knight T8 Melee 4P Bonus
if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_DK_ITEM_T8_MELEE_4P_BONUS, EFFECT_0))
AddPctF(multiplier, aurEff->GetAmount());
AddPct(multiplier, aurEff->GetAmount());
}
}
@@ -425,7 +425,7 @@ class spell_dk_scourge_strike : public SpellScriptLoader
int32 bp = GetHitDamage() * multiplier;
if (AuraEffect* aurEff = caster->GetAuraEffectOfRankedSpell(DK_SPELL_BLACK_ICE_R1, EFFECT_0))
AddPctN(bp, aurEff->GetAmount());
AddPct(bp, aurEff->GetAmount());
caster->CastCustomSpell(unitTarget, DK_SPELL_SCOURGE_STRIKE_TRIGGERED, &bp, NULL, NULL, true);
}
@@ -472,7 +472,7 @@ class spell_dk_spell_deflection : public SpellScriptLoader
{
// You have a chance equal to your Parry chance
if ((dmgInfo.GetDamageType() == SPELL_DIRECT_DAMAGE) && roll_chance_f(GetTarget()->GetUnitParryChance()))
absorbAmount = CalculatePctN(dmgInfo.GetDamage(), absorbPct);
absorbAmount = CalculatePct(dmgInfo.GetDamage(), absorbPct);
}
void Register()
@@ -582,7 +582,7 @@ class spell_dk_will_of_the_necropolis : public SpellScriptLoader
// Damage that would take you below [effect0] health or taken while you are at [effect0]
if (remainingHp < minHp)
absorbAmount = CalculatePctN(dmgInfo.GetDamage(), absorbPct);
absorbAmount = CalculatePct(dmgInfo.GetDamage(), absorbPct);
}
void Register()
@@ -722,7 +722,7 @@ class spell_dk_death_strike : public SpellScriptLoader
int32 bp = int32(count * caster->CountPctFromMaxHealth(int32(GetSpellInfo()->Effects[EFFECT_0].DamageMultiplier)));
// Improved Death Strike
if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_AURA_ADD_PCT_MODIFIER, SPELLFAMILY_DEATHKNIGHT, ICON_ID_IMPROVED_DEATH_STRIKE, 0))
AddPctN(bp, caster->CalculateSpellDamage(caster, aurEff->GetSpellInfo(), 2));
AddPct(bp, caster->CalculateSpellDamage(caster, aurEff->GetSpellInfo(), 2));
caster->CastCustomSpell(caster, SPELL_DEATH_STRIKE_HEAL, &bp, NULL, NULL, false);
}
}
+6 -5
View File
@@ -24,6 +24,7 @@
#include "ScriptMgr.h"
#include "SpellScript.h"
#include "SpellAuraEffects.h"
#include "Containers.h"
enum DruidSpells
{
@@ -181,7 +182,7 @@ class spell_dru_lifebloom : public SpellScriptLoader
GetTarget()->CastCustomSpell(GetTarget(), DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff, GetCasterGUID());
// restore mana
int32 returnMana = CalculatePctU(caster->GetCreateMana(), GetSpellInfo()->ManaCostPercentage) * stack / 2;
int32 returnMana = CalculatePct(caster->GetCreateMana(), GetSpellInfo()->ManaCostPercentage) * stack / 2;
caster->CastCustomSpell(caster, DRUID_LIFEBLOOM_ENERGIZE, &returnMana, NULL, NULL, true, NULL, aurEff, GetCasterGUID());
return;
}
@@ -204,7 +205,7 @@ class spell_dru_lifebloom : public SpellScriptLoader
target->CastCustomSpell(target, DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, NULL, GetCasterGUID());
// restore mana
int32 returnMana = CalculatePctU(caster->GetCreateMana(), GetSpellInfo()->ManaCostPercentage) * dispelInfo->GetRemovedCharges() / 2;
int32 returnMana = CalculatePct(caster->GetCreateMana(), GetSpellInfo()->ManaCostPercentage) * dispelInfo->GetRemovedCharges() / 2;
caster->CastCustomSpell(caster, DRUID_LIFEBLOOM_ENERGIZE, &returnMana, NULL, NULL, true, NULL, NULL, GetCasterGUID());
return;
}
@@ -255,7 +256,7 @@ class spell_dru_moonkin_form_passive : public SpellScriptLoader
{
// reduces all damage taken while Stunned in Moonkin Form
if (GetTarget()->GetUInt32Value(UNIT_FIELD_FLAGS) & (UNIT_FLAG_STUNNED) && GetTarget()->HasAuraWithMechanic(1<<MECHANIC_STUN))
absorbAmount = CalculatePctN(dmgInfo.GetDamage(), absorbPct);
absorbAmount = CalculatePct(dmgInfo.GetDamage(), absorbPct);
}
void Register()
@@ -327,7 +328,7 @@ class spell_dru_primal_tenacity : public SpellScriptLoader
{
// reduces all damage taken while Stunned in Cat Form
if (GetTarget()->GetShapeshiftForm() == FORM_CAT && GetTarget()->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED) && GetTarget()->HasAuraWithMechanic(1<<MECHANIC_STUN))
absorbAmount = CalculatePctN(dmgInfo.GetDamage(), absorbPct);
absorbAmount = CalculatePct(dmgInfo.GetDamage(), absorbPct);
}
void Register()
@@ -369,7 +370,7 @@ class spell_dru_savage_defense : public SpellScriptLoader
void Absorb(AuraEffect* aurEff, DamageInfo & /*dmgInfo*/, uint32 & absorbAmount)
{
absorbAmount = uint32(CalculatePctN(GetTarget()->GetTotalAttackPowerValue(BASE_ATTACK), absorbPct));
absorbAmount = uint32(CalculatePct(GetTarget()->GetTotalAttackPowerValue(BASE_ATTACK), absorbPct));
aurEff->SetAmount(0);
}
+1 -1
View File
@@ -1236,7 +1236,7 @@ class spell_gen_lifeblood : public SpellScriptLoader
void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
{
if (Unit* owner = GetUnitOwner())
amount += int32(CalculatePctF(owner->GetMaxHealth(), 1.5f / aurEff->GetTotalTicks()));
amount += int32(CalculatePct(owner->GetMaxHealth(), 1.5f / aurEff->GetTotalTicks()));
}
void Register()
+3 -3
View File
@@ -138,7 +138,7 @@ class spell_hun_chimera_shot : public SpellScriptLoader
int32 TickCount = aurEff->GetTotalTicks();
spellId = HUNTER_SPELL_CHIMERA_SHOT_SERPENT;
basePoint = caster->SpellDamageBonusDone(unitTarget, aura->GetSpellInfo(), aurEff->GetAmount(), DOT, aura->GetStackAmount());
ApplyPctN(basePoint, TickCount * 40);
ApplyPct(basePoint, TickCount * 40);
basePoint = unitTarget->SpellDamageBonusTaken(caster, aura->GetSpellInfo(), basePoint, DOT, aura->GetStackAmount());
}
// Viper Sting - Instantly restores mana to you equal to 60% of the total amount drained by your Viper Sting.
@@ -148,11 +148,11 @@ class spell_hun_chimera_shot : public SpellScriptLoader
spellId = HUNTER_SPELL_CHIMERA_SHOT_VIPER;
// Amount of one aura tick
basePoint = int32(CalculatePctN(unitTarget->GetMaxPower(POWER_MANA), aurEff->GetAmount()));
basePoint = int32(CalculatePct(unitTarget->GetMaxPower(POWER_MANA), aurEff->GetAmount()));
int32 casterBasePoint = aurEff->GetAmount() * unitTarget->GetMaxPower(POWER_MANA) / 50; // TODO: WTF? caster uses unitTarget?
if (basePoint > casterBasePoint)
basePoint = casterBasePoint;
ApplyPctN(basePoint, TickCount * 60);
ApplyPct(basePoint, TickCount * 60);
}
// Scorpid Sting - Attempts to Disarm the target for 10 sec. This effect cannot occur more than once per 1 minute.
else if (familyFlag[0] & 0x00008000)
+1 -1
View File
@@ -292,7 +292,7 @@ class spell_mage_incanters_absorbtion_base_AuraScript : public AuraScript
if (AuraEffect* talentAurEff = target->GetAuraEffectOfRankedSpell(SPELL_MAGE_INCANTERS_ABSORBTION_R1, EFFECT_0))
{
int32 bp = CalculatePctN(absorbAmount, talentAurEff->GetAmount());
int32 bp = CalculatePct(absorbAmount, talentAurEff->GetAmount());
target->CastCustomSpell(target, SPELL_MAGE_INCANTERS_ABSORBTION_TRIGGERED, &bp, NULL, NULL, true, NULL, aurEff);
}
}
+1 -1
View File
@@ -112,7 +112,7 @@ class spell_pal_ardent_defender : public SpellScriptLoader
uint32 damageToReduce = (victim->GetHealth() < allowedHealth)
? dmgInfo.GetDamage()
: allowedHealth - remainingHealth;
absorbAmount = CalculatePctN(damageToReduce, absorbPct);
absorbAmount = CalculatePct(damageToReduce, absorbPct);
}
}
+22 -22
View File
@@ -243,7 +243,7 @@ public:
if (pet->isPet())
if (Unit* owner = pet->ToPet()->GetOwner())
{
float ownerBonus = CalculatePctN(owner->GetStat(STAT_STAMINA), 75);
float ownerBonus = CalculatePct(owner->GetStat(STAT_STAMINA), 75);
amount += ownerBonus;
}
@@ -313,7 +313,7 @@ public:
if (AuraEffect* /* aurEff */ect = owner->GetAuraEffect(56246, EFFECT_0))
{
float base_attPower = pet->GetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE) * pet->GetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_PCT);
amount += CalculatePctN(amount+base_attPower, /* aurEff */ect->GetAmount());
amount += CalculatePct(amount+base_attPower, /* aurEff */ect->GetAmount());
}
}
}
@@ -382,7 +382,7 @@ public:
{
float ownerBonus = 0.0f;
ownerBonus = CalculatePctN(owner->GetStat(STAT_INTELLECT), 30);
ownerBonus = CalculatePct(owner->GetStat(STAT_INTELLECT), 30);
amount += ownerBonus;
_tempBonus = ownerBonus;
@@ -434,7 +434,7 @@ public:
if (Unit* owner = pet->ToPet()->GetOwner())
{
float ownerBonus = 0.0f;
ownerBonus = CalculatePctN(owner->GetArmor(), 35);
ownerBonus = CalculatePct(owner->GetArmor(), 35);
amount += ownerBonus;
}
}
@@ -446,7 +446,7 @@ public:
if (Unit* owner = pet->ToPet()->GetOwner())
{
float ownerBonus = 0.0f;
ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_FIRE), 40);
ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_FIRE), 40);
amount += ownerBonus;
}
}
@@ -493,7 +493,7 @@ public:
if (Unit* owner = pet->ToPet()->GetOwner())
{
float ownerBonus = 0.0f;
ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_FROST), 40);
ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_FROST), 40);
amount += ownerBonus;
}
}
@@ -505,7 +505,7 @@ public:
if (Unit* owner = pet->ToPet()->GetOwner())
{
float ownerBonus = 0.0f;
ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_ARCANE), 40);
ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_ARCANE), 40);
amount += ownerBonus;
}
}
@@ -517,7 +517,7 @@ public:
if (Unit* owner = pet->ToPet()->GetOwner())
{
float ownerBonus = 0.0f;
ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_NATURE), 40);
ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_NATURE), 40);
amount += ownerBonus;
}
}
@@ -560,7 +560,7 @@ public:
if (Unit* owner = pet->ToPet()->GetOwner())
{
float ownerBonus = 0.0f;
ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_SHADOW), 40);
ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_SHADOW), 40);
amount += ownerBonus;
}
}
@@ -686,7 +686,7 @@ public:
if (AuraApplication* improvedDemonicTacticsApp = owner->GetAuraApplicationOfRankedSpell(54347))
if (Aura* improvedDemonicTactics = improvedDemonicTacticsApp->GetBase())
if (AuraEffect* improvedDemonicTacticsEffect = improvedDemonicTactics->GetEffect(EFFECT_0))
amount += CalculatePctN(CritSpell, improvedDemonicTacticsEffect->GetAmount());
amount += CalculatePct(CritSpell, improvedDemonicTacticsEffect->GetAmount());
}
}
@@ -708,7 +708,7 @@ public:
if (AuraApplication* improvedDemonicTacticsApp = owner->GetAuraApplicationOfRankedSpell(54347))
if (Aura* improvedDemonicTactics = improvedDemonicTacticsApp->GetBase())
if (AuraEffect* improvedDemonicTacticsEffect = improvedDemonicTactics->GetEffect(EFFECT_0))
amount += CalculatePctN(CritMelee, improvedDemonicTacticsEffect->GetAmount());
amount += CalculatePct(CritMelee, improvedDemonicTacticsEffect->GetAmount());
}
}
@@ -898,7 +898,7 @@ public:
if (itr != pet->ToPet()->m_spells.end()) // If pet has Wild Hunt
{
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value
AddPctN(mod, spellInfo->Effects[EFFECT_0].CalcValue());
AddPct(mod, spellInfo->Effects[EFFECT_0].CalcValue());
}
ownerBonus = owner->GetStat(STAT_STAMINA)*mod;
@@ -941,7 +941,7 @@ public:
if (itr != pet->ToPet()->m_spells.end()) // If pet has Wild Hunt
{
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value
mod += CalculatePctN(1.0f, spellInfo->Effects[EFFECT_1].CalcValue());
mod += CalculatePct(1.0f, spellInfo->Effects[EFFECT_1].CalcValue());
}
bonusAP = owner->GetTotalAttackPowerValue(RANGED_ATTACK) * 0.22f * mod;
@@ -971,7 +971,7 @@ public:
if (itr != pet->ToPet()->m_spells.end()) // If pet has Wild Hunt
{
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value
mod += CalculatePctN(1.0f, spellInfo->Effects[EFFECT_1].CalcValue());
mod += CalculatePct(1.0f, spellInfo->Effects[EFFECT_1].CalcValue());
}
bonusDamage = owner->GetTotalAttackPowerValue(RANGED_ATTACK) * 0.1287f * mod;
@@ -1028,7 +1028,7 @@ public:
float ownerBonus = 0.0f;
ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_FROST), 40);
ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_FROST), 40);
amount += ownerBonus;
}
@@ -1047,7 +1047,7 @@ public:
float ownerBonus = 0.0f;
ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_FIRE), 40);
ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_FIRE), 40);
amount += ownerBonus;
}
@@ -1066,7 +1066,7 @@ public:
float ownerBonus = 0.0f;
ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_NATURE), 40);
ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_NATURE), 40);
amount += ownerBonus;
}
@@ -1115,7 +1115,7 @@ public:
float ownerBonus = 0.0f;
ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_SHADOW), 40);
ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_SHADOW), 40);
amount += ownerBonus;
}
@@ -1134,7 +1134,7 @@ public:
float ownerBonus = 0.0f;
ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_ARCANE), 40);
ownerBonus = CalculatePct(owner->GetResistance(SPELL_SCHOOL_ARCANE), 40);
amount += ownerBonus;
}
@@ -1153,7 +1153,7 @@ public:
float ownerBonus = 0.0f;
ownerBonus = CalculatePctN(owner->GetArmor(), 35);
ownerBonus = CalculatePct(owner->GetArmor(), 35);
amount += ownerBonus;
}
@@ -1544,12 +1544,12 @@ public:
aurEff = owner->GetAuraEffect(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, SPELLFAMILY_DEATHKNIGHT, 3010, 0);
if (aurEff)
{
mod += CalculatePctN(mod, aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue()); // Ravenous Dead edits the original scale
mod += CalculatePct(mod, aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue()); // Ravenous Dead edits the original scale
}
// Glyph of the Ghoul
aurEff = owner->GetAuraEffect(58686, 0);
if (aurEff)
mod += CalculatePctN(1.0f, aurEff->GetAmount()); // Glyph of the Ghoul adds a flat value to the scale mod
mod += CalculatePct(1.0f, aurEff->GetAmount()); // Glyph of the Ghoul adds a flat value to the scale mod
float ownerBonus = float(owner->GetStat(STAT_STRENGTH)) * mod;
amount += ownerBonus;
}
+3 -3
View File
@@ -278,7 +278,7 @@ class spell_pri_reflective_shield_trigger : public SpellScriptLoader
if (GetCaster())
if (AuraEffect* talentAurEff = target->GetAuraEffectOfRankedSpell(PRIEST_SPELL_REFLECTIVE_SHIELD_R1, EFFECT_0))
{
int32 bp = CalculatePctN(absorbAmount, talentAurEff->GetAmount());
int32 bp = CalculatePct(absorbAmount, talentAurEff->GetAmount());
target->CastCustomSpell(dmgInfo.GetAttacker(), PRIEST_SPELL_REFLECTIVE_SHIELD_TRIGGERED, &bp, NULL, NULL, true, NULL, aurEff);
}
}
@@ -316,7 +316,7 @@ public:
if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_T9_HEALING_2_PIECE, EFFECT_0))
{
int32 heal = GetHitHeal();
AddPctN(heal, aurEff->GetAmount());
AddPct(heal, aurEff->GetAmount());
SetHitHeal(heal);
}
}
@@ -432,7 +432,7 @@ class spell_pri_shadow_word_death : public SpellScriptLoader
// Pain and Suffering reduces damage
if (AuraEffect* aurEff = GetCaster()->GetDummyAuraEffect(SPELLFAMILY_PRIEST, PRIEST_ICON_ID_PAIN_AND_SUFFERING, EFFECT_1))
AddPctN(damage, aurEff->GetAmount());
AddPct(damage, aurEff->GetAmount());
GetCaster()->CastCustomSpell(GetCaster(), PRIEST_SHADOW_WORD_DEATH, &damage, 0, 0, true);
}
+1 -1
View File
@@ -124,7 +124,7 @@ class spell_rog_nerves_of_steel : public SpellScriptLoader
{
// reduces all damage taken while stun or fear
if (GetTarget()->GetUInt32Value(UNIT_FIELD_FLAGS) & (UNIT_FLAG_FLEEING) || (GetTarget()->GetUInt32Value(UNIT_FIELD_FLAGS) & (UNIT_FLAG_STUNNED) && GetTarget()->HasAuraWithMechanic(1<<MECHANIC_STUN)))
absorbAmount = CalculatePctN(dmgInfo.GetDamage(), absorbPct);
absorbAmount = CalculatePct(dmgInfo.GetDamage(), absorbPct);
}
void Register()
+5 -5
View File
@@ -78,7 +78,7 @@ class spell_sha_astral_shift : public SpellScriptLoader
{
// reduces all damage taken while stun, fear or silence
if (GetTarget()->GetUInt32Value(UNIT_FIELD_FLAGS) & (UNIT_FLAG_FLEEING | UNIT_FLAG_SILENCED) || (GetTarget()->GetUInt32Value(UNIT_FIELD_FLAGS) & (UNIT_FLAG_STUNNED) && GetTarget()->HasAuraWithMechanic(1<<MECHANIC_STUN)))
absorbAmount = CalculatePctN(dmgInfo.GetDamage(), absorbPct);
absorbAmount = CalculatePct(dmgInfo.GetDamage(), absorbPct);
}
void Register()
@@ -184,7 +184,7 @@ class spell_sha_mana_tide_totem : public SpellScriptLoader
if (AuraEffect* dummy = owner->GetAuraEffect(SHAMAN_SPELL_GLYPH_OF_MANA_TIDE, 0))
effValue += dummy->GetAmount();
// Regenerate 6% of Total Mana Every 3 secs
int32 effBasePoints0 = int32(CalculatePctN(unitTarget->GetMaxPower(POWER_MANA), effValue));
int32 effBasePoints0 = int32(CalculatePct(unitTarget->GetMaxPower(POWER_MANA), effValue));
caster->CastCustomSpell(unitTarget, SHAMAN_SPELL_MANA_TIDE_TOTEM, &effBasePoints0, NULL, NULL, true, NULL, NULL, GetOriginalCaster()->GetGUID());
}
}
@@ -501,11 +501,11 @@ class spell_sha_healing_stream_totem : public SpellScriptLoader
// Restorative Totems
if (AuraEffect* dummy = owner->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, ICON_ID_RESTORATIVE_TOTEMS, 1))
AddPctN(damage, dummy->GetAmount());
AddPct(damage, dummy->GetAmount());
// Glyph of Healing Stream Totem
if (AuraEffect const* aurEff = owner->GetAuraEffect(SPELL_GLYPH_OF_HEALING_STREAM_TOTEM, EFFECT_0))
AddPctN(damage, aurEff->GetAmount());
AddPct(damage, aurEff->GetAmount());
damage = int32(target->SpellHealingBonusTaken(owner, triggeringSpell, damage, HEAL));
}
@@ -592,7 +592,7 @@ class spell_sha_lava_lash : public SpellScriptLoader
{
// Damage is increased by 25% if your off-hand weapon is enchanted with Flametongue.
if (caster->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, 0x200000, 0, 0))
AddPctN(hitDamage, damage);
AddPct(hitDamage, damage);
SetHitDamage(hitDamage);
}
}
+3 -3
View File
@@ -410,7 +410,7 @@ class spell_warl_life_tap : public SpellScriptLoader
// Improved Life Tap mod
if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_WARLOCK, ICON_ID_IMPROVED_LIFE_TAP, 0))
AddPctN(mana, aurEff->GetAmount());
AddPct(mana, aurEff->GetAmount());
caster->CastCustomSpell(target, SPELL_LIFE_TAP_ENERGIZE, &mana, NULL, NULL, false);
@@ -421,7 +421,7 @@ class spell_warl_life_tap : public SpellScriptLoader
if (manaFeedVal > 0)
{
ApplyPctN(manaFeedVal, mana);
ApplyPct(manaFeedVal, mana);
caster->CastCustomSpell(caster, SPELL_LIFE_TAP_ENERGIZE_2, &manaFeedVal, NULL, NULL, true, NULL);
}
}
@@ -544,7 +544,7 @@ class spell_warl_haunt : public SpellScriptLoader
{
if (Aura* aura = GetHitAura())
if (AuraEffect* aurEff = aura->GetEffect(EFFECT_1))
aurEff->SetAmount(CalculatePctN(aurEff->GetAmount(), GetHitDamage()));
aurEff->SetAmount(CalculatePct(aurEff->GetAmount(), GetHitDamage()));
}
void Register()
+3 -3
View File
@@ -183,7 +183,7 @@ class spell_warr_deep_wounds : public SpellScriptLoader
// apply percent damage mods
damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE);
ApplyPctN(damage, 16 * sSpellMgr->GetSpellRank(GetSpellInfo()->Id));
ApplyPct(damage, 16 * sSpellMgr->GetSpellRank(GetSpellInfo()->Id));
damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE);
@@ -368,7 +368,7 @@ class spell_warr_concussion_blow : public SpellScriptLoader
void HandleDummy(SpellEffIndex /* effIndex */)
{
SetHitDamage(CalculatePctN(GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK), GetEffectValue()));
SetHitDamage(CalculatePct(GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK), GetEffectValue()));
}
void Register()
@@ -400,7 +400,7 @@ class spell_warr_bloodthirst : public SpellScriptLoader
void HandleDamage(SpellEffIndex /*effIndex*/)
{
int32 damage = GetEffectValue();
ApplyPctF(damage, GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK));
ApplyPct(damage, GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK));
if (Unit* target = GetHitUnit())
{
+2 -2
View File
@@ -1954,8 +1954,8 @@ public:
me->AddUnitMovementFlag(MOVEMENTFLAG_CAN_FLY|MOVEMENTFLAG_ASCENDING|MOVEMENTFLAG_FLYING);
me->SetSpeed(MOVE_FLIGHT, 0.75f, true);
me->SetSpeed(MOVE_RUN, 0.75f, true);
float x = me->GetPositionX() + 20 * cos(me->GetOrientation());
float y = me->GetPositionY() + 20 * sin(me->GetOrientation());
float x = me->GetPositionX() + 20 * std::cos(me->GetOrientation());
float y = me->GetPositionY() + 20 * std::sin(me->GetOrientation());
float z = me->GetPositionZ() + 40;
me->GetMotionMaster()->Clear(false);
me->GetMotionMaster()->MovePoint(0, x, y, z);