converted all tabs to 4 spaces

This commit is contained in:
Yehonal
2016-06-26 19:23:57 +02:00
parent 52f305111c
commit f6eefedcd5
717 changed files with 132388 additions and 132388 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -20,12 +20,12 @@
enum Spells
{
SPELL_GOBLIN_DISGUISE = 71450,
SPELL_GOBLIN_ALLY_COMPLETE = 71522,
SPELL_GOBLIN_HORDE_COMPLETE = 71539,
SPELL_GOBLIN_CARRY_CRATE = 71459,
SPELL_GOBLIN_DISGUISE = 71450,
SPELL_GOBLIN_ALLY_COMPLETE = 71522,
SPELL_GOBLIN_HORDE_COMPLETE = 71539,
SPELL_GOBLIN_CARRY_CRATE = 71459,
NPC_SOMETHING_STINKS_CREDIT = 37558,
NPC_SOMETHING_STINKS_CREDIT = 37558,
};
class npc_love_in_air_supply_sentry : public CreatureScript
@@ -39,31 +39,31 @@ class npc_love_in_air_supply_sentry : public CreatureScript
{
}
uint32 lock;
uint32 lock;
void MoveInLineOfSight(Unit* who)
{
if (lock > 1000 && me->GetDistance(who) < 10.0f && who->GetTypeId() == TYPEID_PLAYER && who->HasAura(SPELL_GOBLIN_DISGUISE) && !who->HasAura(SPELL_GOBLIN_CARRY_CRATE))
{
lock = 0;
if (urand(0,1))
me->MonsterSay("Time is money, friend. Go go go!", LANG_UNIVERSAL, who->ToPlayer());
else
me->MonsterSay("That crate won't deliver itself, friend. Get a move on!", LANG_UNIVERSAL, who->ToPlayer());
{
if (lock > 1000 && me->GetDistance(who) < 10.0f && who->GetTypeId() == TYPEID_PLAYER && who->HasAura(SPELL_GOBLIN_DISGUISE) && !who->HasAura(SPELL_GOBLIN_CARRY_CRATE))
{
lock = 0;
if (urand(0,1))
me->MonsterSay("Time is money, friend. Go go go!", LANG_UNIVERSAL, who->ToPlayer());
else
me->MonsterSay("That crate won't deliver itself, friend. Get a move on!", LANG_UNIVERSAL, who->ToPlayer());
if (who->ToPlayer()->GetTeamId() == TEAM_ALLIANCE)
who->CastSpell(who, SPELL_GOBLIN_ALLY_COMPLETE, true);
else
who->CastSpell(who, SPELL_GOBLIN_HORDE_COMPLETE, true);
if (who->ToPlayer()->GetTeamId() == TEAM_ALLIANCE)
who->CastSpell(who, SPELL_GOBLIN_ALLY_COMPLETE, true);
else
who->CastSpell(who, SPELL_GOBLIN_HORDE_COMPLETE, true);
me->CastSpell(who, SPELL_GOBLIN_CARRY_CRATE, true);
}
}
me->CastSpell(who, SPELL_GOBLIN_CARRY_CRATE, true);
}
}
void UpdateAI(uint32 diff)
{
lock += diff;
}
void UpdateAI(uint32 diff)
{
lock += diff;
}
};
CreatureAI* GetAI(Creature* creature) const
@@ -74,15 +74,15 @@ class npc_love_in_air_supply_sentry : public CreatureScript
enum hotOnTrail
{
QUEST_HOT_ON_TRAIL_ALLY = 24849,
QUEST_HOT_ON_TRAIL_HORDE = 24851,
QUEST_HOT_ON_TRAIL_ALLY = 24849,
QUEST_HOT_ON_TRAIL_HORDE = 24851,
NPC_SNIVEL_ALLY = 38334,
NPC_SNIVEL_COUNTER = 38340,
NPC_SNIVEL_ALLY = 38334,
NPC_SNIVEL_COUNTER = 38340,
NPC_SNIVEL_HORDE = 38337,
NPC_SNIVEL_HORDE = 38337,
SPELL_SNIVEL_GUN = 71715,
SPELL_SNIVEL_GUN = 71715,
};
const uint32 spellTable[6] = {71713, 71745, 71752, 71759, 71760, 71758};
@@ -98,46 +98,46 @@ class npc_love_in_air_snivel : public CreatureScript
{
}
int32 delay;
int32 delay;
void Reset()
{
delay = 0;
me->SetReactState(REACT_AGGRESSIVE);
}
void Reset()
{
delay = 0;
me->SetReactState(REACT_AGGRESSIVE);
}
bool AllowAction(Player* player)
{
uint16 slot = player->FindQuestSlot(player->GetTeamId() == TEAM_ALLIANCE ? QUEST_HOT_ON_TRAIL_ALLY : QUEST_HOT_ON_TRAIL_HORDE);
if (slot >= MAX_QUEST_LOG_SIZE)
return false;
bool AllowAction(Player* player)
{
uint16 slot = player->FindQuestSlot(player->GetTeamId() == TEAM_ALLIANCE ? QUEST_HOT_ON_TRAIL_ALLY : QUEST_HOT_ON_TRAIL_HORDE);
if (slot >= MAX_QUEST_LOG_SIZE)
return false;
QuestStatusData& qData = player->getQuestStatusMap()[(player->GetTeamId() == TEAM_ALLIANCE ? QUEST_HOT_ON_TRAIL_ALLY : QUEST_HOT_ON_TRAIL_HORDE)];
if (qData.CreatureOrGOCount[me->GetEntry() - NPC_SNIVEL_COUNTER] == 0)
return true;
QuestStatusData& qData = player->getQuestStatusMap()[(player->GetTeamId() == TEAM_ALLIANCE ? QUEST_HOT_ON_TRAIL_ALLY : QUEST_HOT_ON_TRAIL_HORDE)];
if (qData.CreatureOrGOCount[me->GetEntry() - NPC_SNIVEL_COUNTER] == 0)
return true;
return false;
}
return false;
}
void MoveInLineOfSight(Unit* who)
{
if (delay == 0 && me->GetDistance(who) < 7.0f && who->GetTypeId() == TYPEID_PLAYER)
{
Player* plr = who->ToPlayer();
if (AllowAction(plr))
{
delay = 25000;
uint8 index = plr->GetTeamId()*3 + (me->GetEntry() - NPC_SNIVEL_COUNTER);
plr->CastSpell(plr, spellTable[index], true);
}
}
}
{
if (delay == 0 && me->GetDistance(who) < 7.0f && who->GetTypeId() == TYPEID_PLAYER)
{
Player* plr = who->ToPlayer();
if (AllowAction(plr))
{
delay = 25000;
uint8 index = plr->GetTeamId()*3 + (me->GetEntry() - NPC_SNIVEL_COUNTER);
plr->CastSpell(plr, spellTable[index], true);
}
}
}
void UpdateAI(uint32 diff)
{
if (delay > 0)
delay -= std::min<int32>(delay, diff);
}
void UpdateAI(uint32 diff)
{
if (delay > 0)
delay -= std::min<int32>(delay, diff);
}
};
CreatureAI* GetAI(Creature* creature) const
@@ -155,73 +155,73 @@ class npc_love_in_air_snivel_real : public CreatureScript
{
npc_love_in_air_snivel_realAI(Creature* creature) : ScriptedAI(creature)
{
actionTimer = 7000;
actionCounter = 0;
actionTimer = 7000;
actionCounter = 0;
}
uint32 actionTimer;
uint32 actionCounter;
uint32 actionTimer;
uint32 actionCounter;
bool Talk(uint32 time)
{
switch (me->GetEntry())
{
case NPC_SNIVEL_ALLY:
case NPC_SNIVEL_HORDE:
{
switch (time)
{
case 1: me->MonsterSay("What are you staring at? Haven't you ever seen a genius before?", LANG_UNIVERSAL, 0); return false;
case 2: me->MonsterSay("This'll teach you to mind your own business!", LANG_UNIVERSAL, 0); return true;
}
break;
}
case NPC_SNIVEL_ALLY+1:
case NPC_SNIVEL_HORDE+1:
{
switch (time)
{
case 1: me->MonsterSay("That's right. I'd like to list some of these 'fireworks'.", LANG_UNIVERSAL, 0); return false;
case 2: me->MonsterSay("Those'll net me a nice profit when I return from the South Seas.", LANG_UNIVERSAL, 0); return false;
case 3: me->MonsterSay("You... Don't think I don't see you. Leave me alone!", LANG_UNIVERSAL, 0); return true;
}
break;
}
bool Talk(uint32 time)
{
switch (me->GetEntry())
{
case NPC_SNIVEL_ALLY:
case NPC_SNIVEL_HORDE:
{
switch (time)
{
case 1: me->MonsterSay("What are you staring at? Haven't you ever seen a genius before?", LANG_UNIVERSAL, 0); return false;
case 2: me->MonsterSay("This'll teach you to mind your own business!", LANG_UNIVERSAL, 0); return true;
}
break;
}
case NPC_SNIVEL_ALLY+1:
case NPC_SNIVEL_HORDE+1:
{
switch (time)
{
case 1: me->MonsterSay("That's right. I'd like to list some of these 'fireworks'.", LANG_UNIVERSAL, 0); return false;
case 2: me->MonsterSay("Those'll net me a nice profit when I return from the South Seas.", LANG_UNIVERSAL, 0); return false;
case 3: me->MonsterSay("You... Don't think I don't see you. Leave me alone!", LANG_UNIVERSAL, 0); return true;
}
break;
}
case NPC_SNIVEL_ALLY+2:
case NPC_SNIVEL_HORDE+2:
{
switch (time)
{
case 1: me->MonsterSay("Thanks for the great cut and shave, buddy.", LANG_UNIVERSAL, 0); return false;
case 2: me->MonsterSay("Here's a little something extra since I'll be away.", LANG_UNIVERSAL, 0); return false;
case 3: me->MonsterSay("On second thought, keep the whole bag. I have to, uh, get going.", LANG_UNIVERSAL, 0); return false;
case 4: me->MonsterSay("Did you really think you could corner me this easily?", LANG_UNIVERSAL, 0); return true;
}
break;
}
}
case NPC_SNIVEL_ALLY+2:
case NPC_SNIVEL_HORDE+2:
{
switch (time)
{
case 1: me->MonsterSay("Thanks for the great cut and shave, buddy.", LANG_UNIVERSAL, 0); return false;
case 2: me->MonsterSay("Here's a little something extra since I'll be away.", LANG_UNIVERSAL, 0); return false;
case 3: me->MonsterSay("On second thought, keep the whole bag. I have to, uh, get going.", LANG_UNIVERSAL, 0); return false;
case 4: me->MonsterSay("Did you really think you could corner me this easily?", LANG_UNIVERSAL, 0); return true;
}
break;
}
}
return true;
}
return true;
}
void UpdateAI(uint32 diff)
{
actionTimer += diff;
if (actionTimer >= 7000)
{
actionTimer = 0;
actionCounter++;
if (Talk(actionCounter))
{
if (me->ToTempSummon())
if (Unit* owner = me->ToTempSummon()->GetSummoner())
me->CastSpell(owner, SPELL_SNIVEL_GUN, true);
void UpdateAI(uint32 diff)
{
actionTimer += diff;
if (actionTimer >= 7000)
{
actionTimer = 0;
actionCounter++;
if (Talk(actionCounter))
{
if (me->ToTempSummon())
if (Unit* owner = me->ToTempSummon()->GetSummoner())
me->CastSpell(owner, SPELL_SNIVEL_GUN, true);
me->DespawnOrUnsummon(1000);
}
}
}
me->DespawnOrUnsummon(1000);
}
}
}
};
CreatureAI* GetAI(Creature* creature) const
@@ -236,31 +236,31 @@ class npc_love_in_air_snivel_real : public CreatureScript
enum hummel
{
QUEST_YOUVE_BEEN_SERVED = 14488,
NPC_APOTHECARY_HUMMEL = 36296,
NPC_APOTHECARY_FRYE = 36272,
NPC_APOTHECARY_BAXTER = 36565,
QUEST_YOUVE_BEEN_SERVED = 14488,
NPC_APOTHECARY_HUMMEL = 36296,
NPC_APOTHECARY_FRYE = 36272,
NPC_APOTHECARY_BAXTER = 36565,
SPELL_COLOGNE_IMMUNE = 68530,
SPELL_COLOGNE_PASSIVE_DAMAGE = 68947,
SPELL_PERFUME_PASSIVE_DAMAGE = 68641,
SPELL_COLOGNE_IMMUNE = 68530,
SPELL_COLOGNE_PASSIVE_DAMAGE = 68947,
SPELL_PERFUME_PASSIVE_DAMAGE = 68641,
SPELL_THROW_COLOGNE = 68614,
SPELL_THROW_PERFUME = 68798,
SPELL_THROW_COLOGNE = 68614,
SPELL_THROW_PERFUME = 68798,
// Real fight
SPELL_COLOGNE_SPRAY = 68948,
SPELL_ALLURING_PERFUME_SPRAY = 68607,
SPELL_CHAIN_REACTION = 68821,
// Real fight
SPELL_COLOGNE_SPRAY = 68948,
SPELL_ALLURING_PERFUME_SPRAY = 68607,
SPELL_CHAIN_REACTION = 68821,
ACTION_START_EVENT = 1,
ACTION_RELEASE_HELPER = 2,
ACTION_START_EVENT = 1,
ACTION_RELEASE_HELPER = 2,
EVENT_CALL_BAXTER = 1,
EVENT_CALL_FRYE = 2,
EVENT_SPELL_PERFUME_SPRAY = 3,
EVENT_SPELL_CHAIN_REACTION = 4,
EVENT_SPELL_THROW = 5,
EVENT_CALL_BAXTER = 1,
EVENT_CALL_FRYE = 2,
EVENT_SPELL_PERFUME_SPRAY = 3,
EVENT_SPELL_CHAIN_REACTION = 4,
EVENT_SPELL_THROW = 5,
};
class npc_love_in_air_hummel : public CreatureScript
@@ -274,112 +274,112 @@ class npc_love_in_air_hummel : public CreatureScript
{
}
SummonList summons;
EventMap events;
uint32 speachTimer;
SummonList summons;
EventMap events;
uint32 speachTimer;
void Reset()
{
speachTimer = 0;
me->setFaction(35);
summons.DespawnAll();
events.Reset();
me->SummonCreature(NPC_APOTHECARY_FRYE, -205.449f, 2219.56f, 79.7633f, 0.7f);
me->SummonCreature(NPC_APOTHECARY_BAXTER, -209.602f, 2215.42f, 79.7633f, 0.723503f);
}
void Reset()
{
speachTimer = 0;
me->setFaction(35);
summons.DespawnAll();
events.Reset();
me->SummonCreature(NPC_APOTHECARY_FRYE, -205.449f, 2219.56f, 79.7633f, 0.7f);
me->SummonCreature(NPC_APOTHECARY_BAXTER, -209.602f, 2215.42f, 79.7633f, 0.723503f);
}
void DoAction(int32 param)
{
if (param == ACTION_START_EVENT)
speachTimer = 1;
}
void DoAction(int32 param)
{
if (param == ACTION_START_EVENT)
speachTimer = 1;
}
void JustDied(Unit* )
{
me->MonsterSay("...please don't think less of me.", LANG_UNIVERSAL, 0);
Map::PlayerList const& players = me->GetMap()->GetPlayers();
if (!players.isEmpty() && players.begin()->GetSource() && players.begin()->GetSource()->GetGroup())
sLFGMgr->FinishDungeon(players.begin()->GetSource()->GetGroup()->GetGUID(), 288, me->FindMap());
}
void JustDied(Unit* )
{
me->MonsterSay("...please don't think less of me.", LANG_UNIVERSAL, 0);
Map::PlayerList const& players = me->GetMap()->GetPlayers();
if (!players.isEmpty() && players.begin()->GetSource() && players.begin()->GetSource()->GetGroup())
sLFGMgr->FinishDungeon(players.begin()->GetSource()->GetGroup()->GetGUID(), 288, me->FindMap());
}
void JustSummoned(Creature* cr)
{
summons.Summon(cr);
cr->setFaction(35);
cr->SetControlled(true, UNIT_STATE_STUNNED);
cr->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
void JustSummoned(Creature* cr)
{
summons.Summon(cr);
cr->setFaction(35);
cr->SetControlled(true, UNIT_STATE_STUNNED);
cr->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
void UpdateAI(uint32 diff)
{
if (speachTimer)
{
speachTimer += diff;
if (speachTimer < 10000)
{
me->MonsterSay("Did they bother to tell you who I am and why I am doing this?", LANG_UNIVERSAL, 0);
speachTimer = 10000;
}
else if (speachTimer >= 16000 && speachTimer < 20000)
{
me->MonsterSay("...or are they just using you like they do everybody else?", LANG_UNIVERSAL, 0);
speachTimer = 20000;
}
else if (speachTimer >= 26000 && speachTimer < 30000)
{
me->MonsterSay("But what does it matter. It is time for this to end.", LANG_UNIVERSAL, 0);
speachTimer = 0;
me->setFaction(16);
me->SetInCombatWithZone();
if (Unit* target = SelectTargetFromPlayerList(40.0f))
{
AttackStart(target);
events.ScheduleEvent(EVENT_CALL_BAXTER, 10000);
events.ScheduleEvent(EVENT_CALL_FRYE, 20000);
events.ScheduleEvent(EVENT_SPELL_PERFUME_SPRAY, 7000);
events.ScheduleEvent(EVENT_SPELL_CHAIN_REACTION, 12000);
}
else
EnterEvadeMode();
}
return;
}
void UpdateAI(uint32 diff)
{
if (speachTimer)
{
speachTimer += diff;
if (speachTimer < 10000)
{
me->MonsterSay("Did they bother to tell you who I am and why I am doing this?", LANG_UNIVERSAL, 0);
speachTimer = 10000;
}
else if (speachTimer >= 16000 && speachTimer < 20000)
{
me->MonsterSay("...or are they just using you like they do everybody else?", LANG_UNIVERSAL, 0);
speachTimer = 20000;
}
else if (speachTimer >= 26000 && speachTimer < 30000)
{
me->MonsterSay("But what does it matter. It is time for this to end.", LANG_UNIVERSAL, 0);
speachTimer = 0;
me->setFaction(16);
me->SetInCombatWithZone();
if (Unit* target = SelectTargetFromPlayerList(40.0f))
{
AttackStart(target);
events.ScheduleEvent(EVENT_CALL_BAXTER, 10000);
events.ScheduleEvent(EVENT_CALL_FRYE, 20000);
events.ScheduleEvent(EVENT_SPELL_PERFUME_SPRAY, 7000);
events.ScheduleEvent(EVENT_SPELL_CHAIN_REACTION, 12000);
}
else
EnterEvadeMode();
}
return;
}
if (!UpdateVictim())
return;
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch (events.GetEvent())
{
case EVENT_CALL_BAXTER:
{
EntryCheckPredicate pred(NPC_APOTHECARY_BAXTER);
summons.DoAction(ACTION_RELEASE_HELPER, pred);
events.PopEvent();
break;
}
case EVENT_CALL_FRYE:
{
EntryCheckPredicate pred(NPC_APOTHECARY_FRYE);
summons.DoAction(ACTION_RELEASE_HELPER, pred);
events.PopEvent();
break;
}
case EVENT_SPELL_PERFUME_SPRAY:
me->CastSpell(me->GetVictim(), SPELL_ALLURING_PERFUME_SPRAY, false);
events.RepeatEvent(6000);
break;
case EVENT_SPELL_CHAIN_REACTION:
me->CastSpell(me->GetVictim(), SPELL_CHAIN_REACTION, false);
events.RepeatEvent(12000);
break;
}
switch (events.GetEvent())
{
case EVENT_CALL_BAXTER:
{
EntryCheckPredicate pred(NPC_APOTHECARY_BAXTER);
summons.DoAction(ACTION_RELEASE_HELPER, pred);
events.PopEvent();
break;
}
case EVENT_CALL_FRYE:
{
EntryCheckPredicate pred(NPC_APOTHECARY_FRYE);
summons.DoAction(ACTION_RELEASE_HELPER, pred);
events.PopEvent();
break;
}
case EVENT_SPELL_PERFUME_SPRAY:
me->CastSpell(me->GetVictim(), SPELL_ALLURING_PERFUME_SPRAY, false);
events.RepeatEvent(6000);
break;
case EVENT_SPELL_CHAIN_REACTION:
me->CastSpell(me->GetVictim(), SPELL_CHAIN_REACTION, false);
events.RepeatEvent(12000);
break;
}
DoMeleeAttackIfReady();
}
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI(Creature* creature) const
@@ -387,13 +387,13 @@ class npc_love_in_air_hummel : public CreatureScript
return new npc_love_in_air_hummelAI(creature);
}
bool OnQuestReward(Player* /*player*/, Creature* creature, const Quest *_Quest, uint32 /*slot*/)
{
if (_Quest->GetQuestId() == QUEST_YOUVE_BEEN_SERVED)
creature->AI()->DoAction(ACTION_START_EVENT);
bool OnQuestReward(Player* /*player*/, Creature* creature, const Quest *_Quest, uint32 /*slot*/)
{
if (_Quest->GetQuestId() == QUEST_YOUVE_BEEN_SERVED)
creature->AI()->DoAction(ACTION_START_EVENT);
return true;
}
return true;
}
};
class npc_love_in_air_hummel_helper : public CreatureScript
@@ -407,69 +407,69 @@ class npc_love_in_air_hummel_helper : public CreatureScript
{
}
EventMap events;
EventMap events;
void Reset()
{
}
void Reset()
{
}
void DoAction(int32 param)
{
if (param == ACTION_RELEASE_HELPER)
{
me->SetControlled(false, UNIT_STATE_STUNNED);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->setFaction(16);
me->SetInCombatWithZone();
if (Unit* target = SelectTargetFromPlayerList(40.0f))
AttackStart(target);
void DoAction(int32 param)
{
if (param == ACTION_RELEASE_HELPER)
{
me->SetControlled(false, UNIT_STATE_STUNNED);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->setFaction(16);
me->SetInCombatWithZone();
if (Unit* target = SelectTargetFromPlayerList(40.0f))
AttackStart(target);
if (me->GetEntry() == NPC_APOTHECARY_BAXTER)
{
events.ScheduleEvent(EVENT_SPELL_PERFUME_SPRAY, 7000);
events.ScheduleEvent(EVENT_SPELL_CHAIN_REACTION, 12000);
}
else
events.ScheduleEvent(EVENT_SPELL_THROW, 5000);
}
}
if (me->GetEntry() == NPC_APOTHECARY_BAXTER)
{
events.ScheduleEvent(EVENT_SPELL_PERFUME_SPRAY, 7000);
events.ScheduleEvent(EVENT_SPELL_CHAIN_REACTION, 12000);
}
else
events.ScheduleEvent(EVENT_SPELL_THROW, 5000);
}
}
void JustDied(Unit* ) { me->MonsterSay("...please don't think less of me.", LANG_UNIVERSAL, 0); }
void JustDied(Unit* ) { me->MonsterSay("...please don't think less of me.", LANG_UNIVERSAL, 0); }
void UpdateAI(uint32 diff)
{
if (!UpdateVictim())
return;
void UpdateAI(uint32 diff)
{
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch (events.GetEvent())
{
case EVENT_SPELL_PERFUME_SPRAY:
me->CastSpell(me->GetVictim(), SPELL_COLOGNE_SPRAY, false);
events.RepeatEvent(6000);
break;
case EVENT_SPELL_CHAIN_REACTION:
me->CastSpell(me->GetVictim(), SPELL_CHAIN_REACTION, false);
events.RepeatEvent(12000);
break;
case EVENT_SPELL_THROW:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
{
Position pos(*me);
me->Relocate(target);
me->CastSpell(me, RAND(SPELL_THROW_COLOGNE, SPELL_THROW_PERFUME), true, NULL, NULL, me->GetGUID());
me->Relocate(pos);
}
events.RepeatEvent(10000);
break;
}
switch (events.GetEvent())
{
case EVENT_SPELL_PERFUME_SPRAY:
me->CastSpell(me->GetVictim(), SPELL_COLOGNE_SPRAY, false);
events.RepeatEvent(6000);
break;
case EVENT_SPELL_CHAIN_REACTION:
me->CastSpell(me->GetVictim(), SPELL_CHAIN_REACTION, false);
events.RepeatEvent(12000);
break;
case EVENT_SPELL_THROW:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
{
Position pos(*me);
me->Relocate(target);
me->CastSpell(me, RAND(SPELL_THROW_COLOGNE, SPELL_THROW_PERFUME), true, NULL, NULL, me->GetGUID());
me->Relocate(pos);
}
events.RepeatEvent(10000);
break;
}
DoMeleeAttackIfReady();
}
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI(Creature* creature) const
@@ -483,55 +483,55 @@ class spell_love_in_air_perfume_immune : public SpellScriptLoader
public:
spell_love_in_air_perfume_immune() : SpellScriptLoader("spell_love_in_air_perfume_immune") { }
class spell_love_in_air_perfume_immune_AuraScript : public AuraScript
{
PrepareAuraScript(spell_love_in_air_perfume_immune_AuraScript);
class spell_love_in_air_perfume_immune_AuraScript : public AuraScript
{
PrepareAuraScript(spell_love_in_air_perfume_immune_AuraScript);
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* target = GetTarget();
if (GetId() == SPELL_COLOGNE_IMMUNE)
{
target->ApplySpellImmune(SPELL_COLOGNE_PASSIVE_DAMAGE, IMMUNITY_ID, SPELL_COLOGNE_PASSIVE_DAMAGE, true);
target->ApplySpellImmune(SPELL_COLOGNE_PASSIVE_DAMAGE, IMMUNITY_ID, SPELL_COLOGNE_SPRAY, true);
target->ApplySpellImmune(68934, IMMUNITY_ID, 68934, true);
}
else
{
target->ApplySpellImmune(SPELL_PERFUME_PASSIVE_DAMAGE, IMMUNITY_ID, SPELL_PERFUME_PASSIVE_DAMAGE, true);
target->ApplySpellImmune(SPELL_ALLURING_PERFUME_SPRAY, IMMUNITY_ID, SPELL_ALLURING_PERFUME_SPRAY, true);
target->ApplySpellImmune(68927, IMMUNITY_ID, 68927, true);
}
}
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* target = GetTarget();
if (GetId() == SPELL_COLOGNE_IMMUNE)
{
target->ApplySpellImmune(SPELL_COLOGNE_PASSIVE_DAMAGE, IMMUNITY_ID, SPELL_COLOGNE_PASSIVE_DAMAGE, true);
target->ApplySpellImmune(SPELL_COLOGNE_PASSIVE_DAMAGE, IMMUNITY_ID, SPELL_COLOGNE_SPRAY, true);
target->ApplySpellImmune(68934, IMMUNITY_ID, 68934, true);
}
else
{
target->ApplySpellImmune(SPELL_PERFUME_PASSIVE_DAMAGE, IMMUNITY_ID, SPELL_PERFUME_PASSIVE_DAMAGE, true);
target->ApplySpellImmune(SPELL_ALLURING_PERFUME_SPRAY, IMMUNITY_ID, SPELL_ALLURING_PERFUME_SPRAY, true);
target->ApplySpellImmune(68927, IMMUNITY_ID, 68927, true);
}
}
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* target = GetTarget();
if (GetId() == SPELL_COLOGNE_IMMUNE)
{
target->ApplySpellImmune(SPELL_COLOGNE_PASSIVE_DAMAGE, IMMUNITY_ID, SPELL_COLOGNE_PASSIVE_DAMAGE, false);
target->ApplySpellImmune(SPELL_COLOGNE_PASSIVE_DAMAGE, IMMUNITY_ID, SPELL_COLOGNE_SPRAY, false);
target->ApplySpellImmune(68934, IMMUNITY_ID, 68934, false);
}
else
{
target->ApplySpellImmune(SPELL_PERFUME_PASSIVE_DAMAGE, IMMUNITY_ID, SPELL_PERFUME_PASSIVE_DAMAGE, false);
target->ApplySpellImmune(SPELL_PERFUME_PASSIVE_DAMAGE, IMMUNITY_ID, SPELL_ALLURING_PERFUME_SPRAY, false);
target->ApplySpellImmune(68927, IMMUNITY_ID, 68927, false);
}
}
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* target = GetTarget();
if (GetId() == SPELL_COLOGNE_IMMUNE)
{
target->ApplySpellImmune(SPELL_COLOGNE_PASSIVE_DAMAGE, IMMUNITY_ID, SPELL_COLOGNE_PASSIVE_DAMAGE, false);
target->ApplySpellImmune(SPELL_COLOGNE_PASSIVE_DAMAGE, IMMUNITY_ID, SPELL_COLOGNE_SPRAY, false);
target->ApplySpellImmune(68934, IMMUNITY_ID, 68934, false);
}
else
{
target->ApplySpellImmune(SPELL_PERFUME_PASSIVE_DAMAGE, IMMUNITY_ID, SPELL_PERFUME_PASSIVE_DAMAGE, false);
target->ApplySpellImmune(SPELL_PERFUME_PASSIVE_DAMAGE, IMMUNITY_ID, SPELL_ALLURING_PERFUME_SPRAY, false);
target->ApplySpellImmune(68927, IMMUNITY_ID, 68927, false);
}
}
void Register()
{
OnEffectApply += AuraEffectApplyFn(spell_love_in_air_perfume_immune_AuraScript::HandleEffectApply, EFFECT_2, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
OnEffectRemove += AuraEffectRemoveFn(spell_love_in_air_perfume_immune_AuraScript::HandleEffectRemove, EFFECT_2, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
void Register()
{
OnEffectApply += AuraEffectApplyFn(spell_love_in_air_perfume_immune_AuraScript::HandleEffectApply, EFFECT_2, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
OnEffectRemove += AuraEffectRemoveFn(spell_love_in_air_perfume_immune_AuraScript::HandleEffectRemove, EFFECT_2, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const
{
return new spell_love_in_air_perfume_immune_AuraScript();
}
AuraScript* GetAuraScript() const
{
return new spell_love_in_air_perfume_immune_AuraScript();
}
};
class spell_love_in_air_periodic_perfumes : public SpellScriptLoader
@@ -539,33 +539,33 @@ class spell_love_in_air_periodic_perfumes : public SpellScriptLoader
public:
spell_love_in_air_periodic_perfumes() : SpellScriptLoader("spell_love_in_air_periodic_perfumes") { }
class spell_love_in_air_periodic_perfumes_AuraScript : public AuraScript
{
PrepareAuraScript(spell_love_in_air_periodic_perfumes_AuraScript);
class spell_love_in_air_periodic_perfumes_AuraScript : public AuraScript
{
PrepareAuraScript(spell_love_in_air_periodic_perfumes_AuraScript);
void PeriodicTick(AuraEffect const* /*aurEff*/)
void PeriodicTick(AuraEffect const* /*aurEff*/)
{
uint64 guid = (GetCaster() ? GetCaster()->GetGUID() : 0);
uint64 guid = (GetCaster() ? GetCaster()->GetGUID() : 0);
if (Unit* target = GetTarget())
{
uint32 spellId = (GetId() == SPELL_THROW_COLOGNE ? 68934 : 68927);
if (target->IsImmunedToSpell(sSpellMgr->GetSpellInfo(spellId)))
return;
{
uint32 spellId = (GetId() == SPELL_THROW_COLOGNE ? 68934 : 68927);
if (target->IsImmunedToSpell(sSpellMgr->GetSpellInfo(spellId)))
return;
target->CastSpell(target, spellId, true, NULL, NULL, guid);
}
target->CastSpell(target, spellId, true, NULL, NULL, guid);
}
}
void Register()
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_love_in_air_periodic_perfumes_AuraScript::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
}
};
};
AuraScript* GetAuraScript() const
{
return new spell_love_in_air_periodic_perfumes_AuraScript();
}
AuraScript* GetAuraScript() const
{
return new spell_love_in_air_periodic_perfumes_AuraScript();
}
};
///////////////////////////////////////
@@ -759,19 +759,19 @@ class spell_gen_aura_service_uniform : public SpellScriptLoader
void AddSC_event_love_in_the_air()
{
// Npcs
new npc_love_in_air_supply_sentry();
new npc_love_in_air_snivel();
new npc_love_in_air_snivel_real();
// Npcs
new npc_love_in_air_supply_sentry();
new npc_love_in_air_snivel();
new npc_love_in_air_snivel_real();
// Boss
new npc_love_in_air_hummel();
new npc_love_in_air_hummel_helper();
new spell_love_in_air_perfume_immune();
new spell_love_in_air_periodic_perfumes();
// Boss
new npc_love_in_air_hummel();
new npc_love_in_air_hummel_helper();
new spell_love_in_air_perfume_immune();
new spell_love_in_air_periodic_perfumes();
// Spells
new spell_item_create_heart_candy();
new spell_love_is_in_the_air_romantic_picnic();
new spell_gen_aura_service_uniform();
// Spells
new spell_item_create_heart_candy();
new spell_love_is_in_the_air_romantic_picnic();
new spell_gen_aura_service_uniform();
}

View File

@@ -10,10 +10,10 @@
enum eBonfire
{
GO_MIDSUMMER_BONFIRE = 181288,
GO_MIDSUMMER_BONFIRE = 181288,
SPELL_STAMP_OUT_BONFIRE = 45437,
SPELL_LIGHT_BONFIRE = 29831,
SPELL_STAMP_OUT_BONFIRE = 45437,
SPELL_LIGHT_BONFIRE = 29831,
};
class go_midsummer_bonfire : public GameObjectScript
@@ -24,8 +24,8 @@ public:
bool OnGossipSelect(Player* player, GameObject* go, uint32 /*sender*/, uint32 action)
{
player->CLOSE_GOSSIP_MENU();
// we know that there is only one gossip.
player->CastSpell(player, SPELL_STAMP_OUT_BONFIRE, true);
// we know that there is only one gossip.
player->CastSpell(player, SPELL_STAMP_OUT_BONFIRE, true);
return true;
}
};
@@ -38,39 +38,39 @@ class npc_midsummer_bonfire : public CreatureScript
struct npc_midsummer_bonfireAI : public ScriptedAI
{
npc_midsummer_bonfireAI(Creature* c) : ScriptedAI(c)
{
me->IsAIEnabled = true;
goGUID = 0;
if (GameObject* go = me->SummonGameObject(GO_MIDSUMMER_BONFIRE, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 0))
{
goGUID = go->GetGUID();
me->RemoveGameObject(go, false);
}
}
uint64 goGUID;
{
me->IsAIEnabled = true;
goGUID = 0;
if (GameObject* go = me->SummonGameObject(GO_MIDSUMMER_BONFIRE, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 0))
{
goGUID = go->GetGUID();
me->RemoveGameObject(go, false);
}
}
uint64 goGUID;
void SpellHit(Unit*, SpellInfo const* spellInfo)
{
if (!goGUID)
return;
void SpellHit(Unit*, SpellInfo const* spellInfo)
{
if (!goGUID)
return;
// Extinguish fire
if (spellInfo->Id == SPELL_STAMP_OUT_BONFIRE)
{
if (GameObject* go = ObjectAccessor::GetGameObject(*me, goGUID))
go->SetPhaseMask(2, true);
}
else if (spellInfo->Id == SPELL_LIGHT_BONFIRE)
{
if (GameObject* go = ObjectAccessor::GetGameObject(*me, goGUID))
{
go->SetPhaseMask(1, true);
go->SendCustomAnim(1);
}
}
// Extinguish fire
if (spellInfo->Id == SPELL_STAMP_OUT_BONFIRE)
{
if (GameObject* go = ObjectAccessor::GetGameObject(*me, goGUID))
go->SetPhaseMask(2, true);
}
else if (spellInfo->Id == SPELL_LIGHT_BONFIRE)
{
if (GameObject* go = ObjectAccessor::GetGameObject(*me, goGUID))
{
go->SetPhaseMask(1, true);
go->SendCustomAnim(1);
}
}
}
}
};
CreatureAI* GetAI(Creature* creature) const
@@ -87,107 +87,107 @@ class npc_midsummer_torch_target : public CreatureScript
struct npc_midsummer_torch_targetAI : public ScriptedAI
{
npc_midsummer_torch_targetAI(Creature* c) : ScriptedAI(c)
{
teleTimer = 0;
startTimer = 1;
posVec.clear();
playerGUID = 0;
me->CastSpell(me, 43313, true);
counter = 0;
maxCount = 0;
}
{
teleTimer = 0;
startTimer = 1;
posVec.clear();
playerGUID = 0;
me->CastSpell(me, 43313, true);
counter = 0;
maxCount = 0;
}
uint64 playerGUID;
uint32 startTimer;
uint32 teleTimer;
std::vector<Position> posVec;
uint8 counter;
uint8 maxCount;
uint64 playerGUID;
uint32 startTimer;
uint32 teleTimer;
std::vector<Position> posVec;
uint8 counter;
uint8 maxCount;
void SetPlayerGUID(uint64 guid, uint8 cnt)
{
playerGUID = guid;
maxCount = cnt;
}
void SetPlayerGUID(uint64 guid, uint8 cnt)
{
playerGUID = guid;
maxCount = cnt;
}
bool CanBeSeen(Player const* seer)
{
return seer->GetGUID() == playerGUID;
}
void SpellHit(Unit* caster, SpellInfo const* spellInfo)
{
if (posVec.empty())
return;
// Triggered spell from torch
if (spellInfo->Id == 46054 && caster->GetTypeId() == TYPEID_PLAYER)
{
me->CastSpell(me, 45724, true); // hit visual anim
if (++counter >= maxCount)
{
caster->CastSpell(caster, (caster->ToPlayer()->GetTeamId() ? 46651 : 45719), true); // quest complete spell
me->DespawnOrUnsummon(1);
return;
}
bool CanBeSeen(Player const* seer)
{
return seer->GetGUID() == playerGUID;
}
void SpellHit(Unit* caster, SpellInfo const* spellInfo)
{
if (posVec.empty())
return;
// Triggered spell from torch
if (spellInfo->Id == 46054 && caster->GetTypeId() == TYPEID_PLAYER)
{
me->CastSpell(me, 45724, true); // hit visual anim
if (++counter >= maxCount)
{
caster->CastSpell(caster, (caster->ToPlayer()->GetTeamId() ? 46651 : 45719), true); // quest complete spell
me->DespawnOrUnsummon(1);
return;
}
teleTimer = 1;
}
}
teleTimer = 1;
}
}
void UpdateAI(uint32 diff)
{
if (startTimer)
{
startTimer += diff;
if (startTimer >= 200)
{
startTimer = 0;
FillPositions();
SelectPosition();
}
}
if (teleTimer)
{
teleTimer += diff;
if (teleTimer >= 750 && teleTimer < 10000)
{
teleTimer = 10000;
SelectPosition();
}
else if (teleTimer >= 10500)
{
if (Player* plr = ObjectAccessor::GetPlayer(*me, playerGUID))
plr->UpdateTriggerVisibility();
void UpdateAI(uint32 diff)
{
if (startTimer)
{
startTimer += diff;
if (startTimer >= 200)
{
startTimer = 0;
FillPositions();
SelectPosition();
}
}
if (teleTimer)
{
teleTimer += diff;
if (teleTimer >= 750 && teleTimer < 10000)
{
teleTimer = 10000;
SelectPosition();
}
else if (teleTimer >= 10500)
{
if (Player* plr = ObjectAccessor::GetPlayer(*me, playerGUID))
plr->UpdateTriggerVisibility();
teleTimer = 0;
}
}
}
teleTimer = 0;
}
}
}
void FillPositions()
{
std::list<GameObject*> gobjList;
me->GetGameObjectListWithEntryInGrid(gobjList, 187708 /*TORCH_GO*/, 30.0f);
for (std::list<GameObject*>::const_iterator itr = gobjList.begin(); itr != gobjList.end(); ++itr)
{
Position pos;
pos.Relocate(*itr);
posVec.push_back(pos);
}
}
void FillPositions()
{
std::list<GameObject*> gobjList;
me->GetGameObjectListWithEntryInGrid(gobjList, 187708 /*TORCH_GO*/, 30.0f);
for (std::list<GameObject*>::const_iterator itr = gobjList.begin(); itr != gobjList.end(); ++itr)
{
Position pos;
pos.Relocate(*itr);
posVec.push_back(pos);
}
}
void SelectPosition()
{
if (posVec.empty())
return;
int8 num = urand(0, posVec.size()-1);
Position pos;
pos.Relocate(posVec.at(num));
me->m_last_notify_position.Relocate(0.0f, 0.0f, 0.0f);
me->m_last_notify_mstime = World::GetGameTimeMS() + 10000;
void SelectPosition()
{
if (posVec.empty())
return;
int8 num = urand(0, posVec.size()-1);
Position pos;
pos.Relocate(posVec.at(num));
me->m_last_notify_position.Relocate(0.0f, 0.0f, 0.0f);
me->m_last_notify_mstime = World::GetGameTimeMS() + 10000;
me->NearTeleportTo(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation());
}
me->NearTeleportTo(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation());
}
};
CreatureAI* GetAI(Creature* creature) const
@@ -203,11 +203,11 @@ class npc_midsummer_torch_target : public CreatureScript
enum RibbonPole
{
SPELL_RIBBON_POLE_CHANNEL_VISUAL = 29172,
SPELL_RIBBON_POLE_XP = 29175,
SPELL_RIBBON_POLE_FIREWORKS = 46971,
SPELL_RIBBON_POLE_CHANNEL_VISUAL = 29172,
SPELL_RIBBON_POLE_XP = 29175,
SPELL_RIBBON_POLE_FIREWORKS = 46971,
NPC_RIBBON_POLE_DEBUG_TARGET = 17066,
NPC_RIBBON_POLE_DEBUG_TARGET = 17066,
};
class spell_midsummer_ribbon_pole : public SpellScriptLoader
@@ -219,47 +219,47 @@ public:
{
PrepareAuraScript(spell_midsummer_ribbon_pole_AuraScript)
void HandleEffectPeriodic(AuraEffect const * aurEff)
void HandleEffectPeriodic(AuraEffect const * aurEff)
{
PreventDefaultAction();
if (Unit *target = GetTarget())
{
Creature* cr = target->FindNearestCreature(NPC_RIBBON_POLE_DEBUG_TARGET, 10.0f);
if (!cr)
{
target->RemoveAura(SPELL_RIBBON_POLE_CHANNEL_VISUAL);
SetDuration(1);
return;
}
PreventDefaultAction();
if (Unit *target = GetTarget())
{
Creature* cr = target->FindNearestCreature(NPC_RIBBON_POLE_DEBUG_TARGET, 10.0f);
if (!cr)
{
target->RemoveAura(SPELL_RIBBON_POLE_CHANNEL_VISUAL);
SetDuration(1);
return;
}
if (Aura* aur = target->GetAura(SPELL_RIBBON_POLE_XP))
aur->SetDuration(std::min(aur->GetDuration()+3*MINUTE*IN_MILLISECONDS, 60*MINUTE*IN_MILLISECONDS));
else
target->CastSpell(target, SPELL_RIBBON_POLE_XP, true);
if (Aura* aur = target->GetAura(SPELL_RIBBON_POLE_XP))
aur->SetDuration(std::min(aur->GetDuration()+3*MINUTE*IN_MILLISECONDS, 60*MINUTE*IN_MILLISECONDS));
else
target->CastSpell(target, SPELL_RIBBON_POLE_XP, true);
if (roll_chance_i(5))
{
cr->Relocate(cr->GetPositionX(), cr->GetPositionY(), cr->GetPositionZ()-6.5f);
cr->CastSpell(cr, SPELL_RIBBON_POLE_FIREWORKS, true);
cr->Relocate(cr->GetPositionX(), cr->GetPositionY(), cr->GetPositionZ()+6.5f);
}
if (roll_chance_i(5))
{
cr->Relocate(cr->GetPositionX(), cr->GetPositionY(), cr->GetPositionZ()-6.5f);
cr->CastSpell(cr, SPELL_RIBBON_POLE_FIREWORKS, true);
cr->Relocate(cr->GetPositionX(), cr->GetPositionY(), cr->GetPositionZ()+6.5f);
}
// Achievement
if ((time(NULL) - GetApplyTime()) > 60 && target->GetTypeId() == TYPEID_PLAYER)
target->ToPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, 58934, 0, target);
}
// Achievement
if ((time(NULL) - GetApplyTime()) > 60 && target->GetTypeId() == TYPEID_PLAYER)
target->ToPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, 58934, 0, target);
}
}
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* ar = GetTarget();
ar->CastSpell(ar, SPELL_RIBBON_POLE_CHANNEL_VISUAL, true);
Unit* ar = GetTarget();
ar->CastSpell(ar, SPELL_RIBBON_POLE_CHANNEL_VISUAL, true);
}
void Register()
{
OnEffectApply += AuraEffectApplyFn(spell_midsummer_ribbon_pole_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
OnEffectPeriodic += AuraEffectPeriodicFn(spell_midsummer_ribbon_pole_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
OnEffectApply += AuraEffectApplyFn(spell_midsummer_ribbon_pole_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
OnEffectPeriodic += AuraEffectPeriodicFn(spell_midsummer_ribbon_pole_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
}
};
@@ -278,34 +278,34 @@ public:
{
PrepareAuraScript(spell_midsummer_torch_quest_AuraScript)
bool Load()
{
torchGUID = 0;
return true;
}
uint64 torchGUID;
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
bool Load()
{
Unit* ar = GetTarget();
if (Creature* cr = ar->SummonCreature(25535, ar->GetPositionX(), ar->GetPositionY(), ar->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 90000))
{
torchGUID = cr->GetGUID();
CAST_AI(npc_midsummer_torch_target::npc_midsummer_torch_targetAI, cr->AI())->SetPlayerGUID(ar->GetGUID(), (GetId() == 45716 ? 8 : 20));
}
torchGUID = 0;
return true;
}
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
uint64 torchGUID;
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (Creature* cr = ObjectAccessor::GetCreature(*GetTarget(), torchGUID))
cr->DespawnOrUnsummon(1);
Unit* ar = GetTarget();
if (Creature* cr = ar->SummonCreature(25535, ar->GetPositionX(), ar->GetPositionY(), ar->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 90000))
{
torchGUID = cr->GetGUID();
CAST_AI(npc_midsummer_torch_target::npc_midsummer_torch_targetAI, cr->AI())->SetPlayerGUID(ar->GetGUID(), (GetId() == 45716 ? 8 : 20));
}
}
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (Creature* cr = ObjectAccessor::GetCreature(*GetTarget(), torchGUID))
cr->DespawnOrUnsummon(1);
}
void Register()
{
OnEffectApply += AuraEffectApplyFn(spell_midsummer_torch_quest_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DETECT_AMORE, AURA_EFFECT_HANDLE_REAL);
OnEffectRemove += AuraEffectRemoveFn(spell_midsummer_torch_quest_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DETECT_AMORE, AURA_EFFECT_HANDLE_REAL);
OnEffectApply += AuraEffectApplyFn(spell_midsummer_torch_quest_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DETECT_AMORE, AURA_EFFECT_HANDLE_REAL);
OnEffectRemove += AuraEffectRemoveFn(spell_midsummer_torch_quest_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DETECT_AMORE, AURA_EFFECT_HANDLE_REAL);
}
};
@@ -317,12 +317,12 @@ public:
enum flingTorch
{
NPC_TORCH_TARGET = 26188,
NPC_TORCH_TARGET = 26188,
SPELL_FLING_TORCH = 45669,
SPELL_FLING_TORCH_DUMMY = 46747,
SPELL_MISSED_TORCH = 45676,
SPELL_TORCH_COUNTER = 45693,
SPELL_FLING_TORCH = 45669,
SPELL_FLING_TORCH_DUMMY = 46747,
SPELL_MISSED_TORCH = 45676,
SPELL_TORCH_COUNTER = 45693,
};
class spell_midsummer_fling_torch : public SpellScriptLoader
@@ -334,95 +334,95 @@ class spell_midsummer_fling_torch : public SpellScriptLoader
{
PrepareSpellScript(spell_midsummer_fling_torch_SpellScript);
bool handled;
bool Load() { handled = false; return true; }
bool handled;
bool Load() { handled = false; return true; }
void ThrowNextTorch(Unit* caster)
{
std::list<Creature*> crList;
caster->GetCreaturesWithEntryInRange(crList, 100.0f, NPC_TORCH_TARGET);
uint8 rand = urand(0, crList.size()-1);
Position pos;
pos.Relocate(0.0f, 0.0f, 0.0f);
for (std::list<Creature*>::const_iterator itr = crList.begin(); itr != crList.end(); ++itr, --rand)
{
if (caster->GetDistance(*itr) < 5)
{
if (!rand)
rand++;
continue;
}
if (!rand)
{
pos.Relocate(*itr);
break;
}
}
// we have any pos
if (pos.GetPositionX())
caster->CastSpell(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), SPELL_FLING_TORCH, true);
}
void HandleFinish()
{
Unit* caster = GetCaster();
if (!caster || !caster->ToPlayer()) // caster cant be null, but meh :p
return;
if (GetSpellInfo()->Id != SPELL_FLING_TORCH_DUMMY)
{
if (!handled)
if (const WorldLocation* loc = GetExplTargetDest())
{
caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_MISSED_TORCH, true);
caster->RemoveAurasDueToSpell(SPELL_TORCH_COUNTER);
}
return;
}
ThrowNextTorch(caster);
}
void HandleScript(SpellEffIndex effIndex)
void ThrowNextTorch(Unit* caster)
{
PreventHitDefaultEffect(effIndex);
if (Player* target = GetHitPlayer())
{
if (target->GetGUID() != GetCaster()->GetGUID())
return;
std::list<Creature*> crList;
caster->GetCreaturesWithEntryInRange(crList, 100.0f, NPC_TORCH_TARGET);
handled = true;
if (Aura* aur = target->GetAura(SPELL_TORCH_COUNTER))
{
aur->ModStackAmount(1);
uint8 count = 4;
if (target->GetQuestStatus(target->GetTeamId() ? 11925 : 11924) == QUEST_STATUS_INCOMPLETE) // More Torch Catching quests
count = 10;
uint8 rand = urand(0, crList.size()-1);
Position pos;
pos.Relocate(0.0f, 0.0f, 0.0f);
for (std::list<Creature*>::const_iterator itr = crList.begin(); itr != crList.end(); ++itr, --rand)
{
if (caster->GetDistance(*itr) < 5)
{
if (!rand)
rand++;
continue;
}
if (aur->GetStackAmount() >= count)
{
//target->CastSpell(target, 46711, true); // Set Flag: all torch returning quests are complete
target->CastSpell(target, (target->GetTeamId() ? 46654 : 46081), true); // Quest completion
aur->SetDuration(1);
return;
}
}
else
target->CastSpell(target, SPELL_TORCH_COUNTER, true);
if (!rand)
{
pos.Relocate(*itr);
break;
}
}
ThrowNextTorch(GetCaster());
}
// we have any pos
if (pos.GetPositionX())
caster->CastSpell(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), SPELL_FLING_TORCH, true);
}
void Register()
{
AfterCast += SpellCastFn(spell_midsummer_fling_torch_SpellScript::HandleFinish);
if (m_scriptSpellId == 45671)
OnEffectHitTarget += SpellEffectFn(spell_midsummer_fling_torch_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
void HandleFinish()
{
Unit* caster = GetCaster();
if (!caster || !caster->ToPlayer()) // caster cant be null, but meh :p
return;
if (GetSpellInfo()->Id != SPELL_FLING_TORCH_DUMMY)
{
if (!handled)
if (const WorldLocation* loc = GetExplTargetDest())
{
caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_MISSED_TORCH, true);
caster->RemoveAurasDueToSpell(SPELL_TORCH_COUNTER);
}
return;
}
ThrowNextTorch(caster);
}
void HandleScript(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
if (Player* target = GetHitPlayer())
{
if (target->GetGUID() != GetCaster()->GetGUID())
return;
handled = true;
if (Aura* aur = target->GetAura(SPELL_TORCH_COUNTER))
{
aur->ModStackAmount(1);
uint8 count = 4;
if (target->GetQuestStatus(target->GetTeamId() ? 11925 : 11924) == QUEST_STATUS_INCOMPLETE) // More Torch Catching quests
count = 10;
if (aur->GetStackAmount() >= count)
{
//target->CastSpell(target, 46711, true); // Set Flag: all torch returning quests are complete
target->CastSpell(target, (target->GetTeamId() ? 46654 : 46081), true); // Quest completion
aur->SetDuration(1);
return;
}
}
else
target->CastSpell(target, SPELL_TORCH_COUNTER, true);
ThrowNextTorch(GetCaster());
}
}
void Register()
{
AfterCast += SpellCastFn(spell_midsummer_fling_torch_SpellScript::HandleFinish);
if (m_scriptSpellId == 45671)
OnEffectHitTarget += SpellEffectFn(spell_midsummer_fling_torch_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const
@@ -433,14 +433,14 @@ class spell_midsummer_fling_torch : public SpellScriptLoader
enum eJuggle
{
SPELL_JUGGLE_SELF = 45638,
SPELL_JUGGLE_SLOW = 45792,
SPELL_JUGGLE_MED = 45806,
SPELL_JUGGLE_FAST = 45816,
SPELL_JUGGLE_SELF = 45638,
SPELL_JUGGLE_SLOW = 45792,
SPELL_JUGGLE_MED = 45806,
SPELL_JUGGLE_FAST = 45816,
SPELL_TORCH_CHECK = 45644,
SPELL_GIVE_TORCH = 45280,
QUEST_CHECK = 11937,
SPELL_TORCH_CHECK = 45644,
SPELL_GIVE_TORCH = 45280,
QUEST_CHECK = 11937,
};
class spell_midsummer_juggling_torch : public SpellScriptLoader
@@ -452,51 +452,51 @@ class spell_midsummer_juggling_torch : public SpellScriptLoader
{
PrepareSpellScript(spell_midsummer_juggling_torch_SpellScript);
bool handled;
bool Load() { handled = false; return true; }
void HandleFinish()
bool handled;
bool Load() { handled = false; return true; }
void HandleFinish()
{
Unit* caster = GetCaster();
if (!caster || caster->GetTypeId() != TYPEID_PLAYER)
return;
Unit* caster = GetCaster();
if (!caster || caster->GetTypeId() != TYPEID_PLAYER)
return;
if (const WorldLocation* loc = GetExplTargetDest())
{
if (loc->GetExactDist(caster) < 3.0f)
caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_JUGGLE_SELF, true);
else if (loc->GetExactDist(caster) < 10.0f)
caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_JUGGLE_SLOW, true);
else if (loc->GetExactDist(caster) < 25.0f)
caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_JUGGLE_MED, true);
else
caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_JUGGLE_FAST, true);
}
else
caster->CastSpell(caster, SPELL_JUGGLE_SELF, true);
if (const WorldLocation* loc = GetExplTargetDest())
{
if (loc->GetExactDist(caster) < 3.0f)
caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_JUGGLE_SELF, true);
else if (loc->GetExactDist(caster) < 10.0f)
caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_JUGGLE_SLOW, true);
else if (loc->GetExactDist(caster) < 25.0f)
caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_JUGGLE_MED, true);
else
caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_JUGGLE_FAST, true);
}
else
caster->CastSpell(caster, SPELL_JUGGLE_SELF, true);
}
void HandleDummy(SpellEffIndex effIndex)
void HandleDummy(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
Unit* caster = GetCaster();
if (!caster || caster->GetTypeId() != TYPEID_PLAYER)
return;
Unit* caster = GetCaster();
if (!caster || caster->GetTypeId() != TYPEID_PLAYER)
return;
if (Player* target = GetHitPlayer())
if (!handled && target->GetQuestRewardStatus(target->GetTeamId() == TEAM_ALLIANCE ? 11657 : 11923))
{
handled = true;
caster->CastSpell(target, SPELL_GIVE_TORCH, true);
}
if (Player* target = GetHitPlayer())
if (!handled && target->GetQuestRewardStatus(target->GetTeamId() == TEAM_ALLIANCE ? 11657 : 11923))
{
handled = true;
caster->CastSpell(target, SPELL_GIVE_TORCH, true);
}
}
void Register()
{
if (m_scriptSpellId == SPELL_TORCH_CHECK)
OnEffectHitTarget += SpellEffectFn(spell_midsummer_juggling_torch_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
else
AfterCast += SpellCastFn(spell_midsummer_juggling_torch_SpellScript::HandleFinish);
}
void Register()
{
if (m_scriptSpellId == SPELL_TORCH_CHECK)
OnEffectHitTarget += SpellEffectFn(spell_midsummer_juggling_torch_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
else
AfterCast += SpellCastFn(spell_midsummer_juggling_torch_SpellScript::HandleFinish);
}
};
SpellScript* GetSpellScript() const
@@ -507,14 +507,14 @@ class spell_midsummer_juggling_torch : public SpellScriptLoader
void AddSC_event_midsummer_scripts()
{
// NPCs
new go_midsummer_bonfire();
new npc_midsummer_bonfire();
new npc_midsummer_torch_target();
// NPCs
new go_midsummer_bonfire();
new npc_midsummer_bonfire();
new npc_midsummer_torch_target();
// Spells
new spell_midsummer_ribbon_pole();
new spell_midsummer_torch_quest();
new spell_midsummer_fling_torch();
new spell_midsummer_juggling_torch();
// Spells
new spell_midsummer_ribbon_pole();
new spell_midsummer_torch_quest();
new spell_midsummer_fling_torch();
new spell_midsummer_juggling_torch();
}

File diff suppressed because it is too large Load Diff

View File

@@ -60,10 +60,10 @@ class spell_winter_veil_mistletoe : public SpellScriptLoader
enum winterWondervoltTrap
{
SPELL_WINTER_WONDERVOLT_GREEN_WOMEN = 26272,
SPELL_WINTER_WONDERVOLT_GREEN_MAN = 26157,
SPELL_WINTER_WONDERVOLT_RED_WOMEN = 26274,
SPELL_WINTER_WONDERVOLT_RED_MAN = 26273,
SPELL_WINTER_WONDERVOLT_GREEN_WOMEN = 26272,
SPELL_WINTER_WONDERVOLT_GREEN_MAN = 26157,
SPELL_WINTER_WONDERVOLT_RED_WOMEN = 26274,
SPELL_WINTER_WONDERVOLT_RED_MAN = 26273,
};
class spell_winter_wondervolt_trap : public SpellScriptLoader
@@ -83,11 +83,11 @@ class spell_winter_wondervolt_trap : public SpellScriptLoader
if (target->HasAuraType(SPELL_AURA_TRANSFORM))
return;
uint32 spellId = 0;
if (target->getGender() == GENDER_MALE)
spellId = RAND<uint32>(SPELL_WINTER_WONDERVOLT_RED_MAN, SPELL_WINTER_WONDERVOLT_GREEN_MAN);
else
spellId = RAND<uint32>(SPELL_WINTER_WONDERVOLT_RED_WOMEN, SPELL_WINTER_WONDERVOLT_GREEN_WOMEN);
uint32 spellId = 0;
if (target->getGender() == GENDER_MALE)
spellId = RAND<uint32>(SPELL_WINTER_WONDERVOLT_RED_MAN, SPELL_WINTER_WONDERVOLT_GREEN_MAN);
else
spellId = RAND<uint32>(SPELL_WINTER_WONDERVOLT_RED_WOMEN, SPELL_WINTER_WONDERVOLT_GREEN_WOMEN);
// cast
target->CastSpell(target, spellId, true);
@@ -109,18 +109,18 @@ class spell_winter_wondervolt_trap : public SpellScriptLoader
enum crashinTrashin
{
SPELL_BLUE_CAR_VISUAL = 75110,
SPELL_RED_CAR_VISUAL = 49384,
NPC_RED_RACER = 27664,
NPC_BLUE_RACER = 40281,
SPELL_BLUE_CAR_VISUAL = 75110,
SPELL_RED_CAR_VISUAL = 49384,
NPC_RED_RACER = 27664,
NPC_BLUE_RACER = 40281,
SPELL_RACER_DEATH_VISUAL = 49337,
SPELL_RACER_CHARGE_TO_OBJECT = 49302,
SPELL_RACER_KILL_COUNTER = 49444,
SPELL_RACER_SLAM_HIT = 49324,
SPELL_RACER_FLAMES = 49328,
SPELL_RACER_DEATH_VISUAL = 49337,
SPELL_RACER_CHARGE_TO_OBJECT = 49302,
SPELL_RACER_KILL_COUNTER = 49444,
SPELL_RACER_SLAM_HIT = 49324,
SPELL_RACER_FLAMES = 49328,
RACER_ACHI_CRITERIA = 4090,
RACER_ACHI_CRITERIA = 4090,
};
class spell_winter_veil_racer_rocket_slam : public SpellScriptLoader
@@ -135,46 +135,46 @@ class spell_winter_veil_racer_rocket_slam : public SpellScriptLoader
void HandleTriggerSpell(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
PreventHitEffect(EFFECT_0);
PreventHitEffect(EFFECT_1);
PreventHitEffect(EFFECT_0);
PreventHitEffect(EFFECT_1);
std::list<Creature*> unitList;
Unit* target = NULL;
caster->GetCreaturesWithEntryInRange(unitList, 30.0f, NPC_BLUE_RACER);
if (!unitList.empty())
for (std::list<Creature*>::const_iterator itr = unitList.begin(); itr != unitList.end(); ++itr)
if (caster->HasInLine((*itr), 1.0f) && (*itr)->GetGUID() != caster->GetGUID())
{
target = (*itr);
break;
}
if (!target)
{
unitList.clear();
caster->GetCreaturesWithEntryInRange(unitList, 30.0f, NPC_RED_RACER);
if (!unitList.empty())
for (std::list<Creature*>::const_iterator itr = unitList.begin(); itr != unitList.end(); ++itr)
if (caster->HasInLine((*itr), 1.0f) && (*itr)->GetGUID() != caster->GetGUID())
{
target = (*itr);
break;
}
}
std::list<Creature*> unitList;
Unit* target = NULL;
caster->GetCreaturesWithEntryInRange(unitList, 30.0f, NPC_BLUE_RACER);
if (!unitList.empty())
for (std::list<Creature*>::const_iterator itr = unitList.begin(); itr != unitList.end(); ++itr)
if (caster->HasInLine((*itr), 1.0f) && (*itr)->GetGUID() != caster->GetGUID())
{
target = (*itr);
break;
}
if (!target)
{
unitList.clear();
caster->GetCreaturesWithEntryInRange(unitList, 30.0f, NPC_RED_RACER);
if (!unitList.empty())
for (std::list<Creature*>::const_iterator itr = unitList.begin(); itr != unitList.end(); ++itr)
if (caster->HasInLine((*itr), 1.0f) && (*itr)->GetGUID() != caster->GetGUID())
{
target = (*itr);
break;
}
}
if (target)
{
caster->CastSpell(target, SPELL_RACER_CHARGE_TO_OBJECT, true);
caster->CastSpell(target, SPELL_RACER_SLAM_HIT, true);
}
else
{
Position pos;
float x = caster->GetPositionX()+30*cos(caster->GetOrientation());
float y = caster->GetPositionY()+30*sin(caster->GetOrientation());
pos.Relocate(x, y, caster->GetMap()->GetHeight(x, y, MAX_HEIGHT)+0.5f);
//caster->GetFirstCollisionPosition(pos, 30.0f, caster->GetOrientation());
caster->CastSpell(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), SPELL_RACER_CHARGE_TO_OBJECT, true);
}
if (target)
{
caster->CastSpell(target, SPELL_RACER_CHARGE_TO_OBJECT, true);
caster->CastSpell(target, SPELL_RACER_SLAM_HIT, true);
}
else
{
Position pos;
float x = caster->GetPositionX()+30*cos(caster->GetOrientation());
float y = caster->GetPositionY()+30*sin(caster->GetOrientation());
pos.Relocate(x, y, caster->GetMap()->GetHeight(x, y, MAX_HEIGHT)+0.5f);
//caster->GetFirstCollisionPosition(pos, 30.0f, caster->GetOrientation());
caster->CastSpell(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), SPELL_RACER_CHARGE_TO_OBJECT, true);
}
}
void Register()
@@ -201,20 +201,20 @@ class spell_winter_veil_racer_slam_hit : public SpellScriptLoader
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
Creature* target = GetHitCreature();
if (!target || caster == target)
return;
Creature* target = GetHitCreature();
if (!target || caster == target)
return;
target->CastSpell(target->GetPositionX()+irand(-10, 10), target->GetPositionY()+irand(-10, 10), target->GetPositionZ() , SPELL_RACER_DEATH_VISUAL, true);
target->DespawnOrUnsummon(3000);
target->CastSpell(target, SPELL_RACER_FLAMES, true);
caster->CastSpell(caster, SPELL_RACER_KILL_COUNTER, true);
target->CastSpell(target->GetPositionX()+irand(-10, 10), target->GetPositionY()+irand(-10, 10), target->GetPositionZ() , SPELL_RACER_DEATH_VISUAL, true);
target->DespawnOrUnsummon(3000);
target->CastSpell(target, SPELL_RACER_FLAMES, true);
caster->CastSpell(caster, SPELL_RACER_KILL_COUNTER, true);
if (Player* targetSummoner = target->GetCharmerOrOwnerPlayerOrPlayerItself())
{
//targetSummoner->RemoveCriteriaProgress(sAchievementCriteriaStore.LookupEntry(RACER_ACHI_CRITERIA)); !ZOMG, ADD ACCESSOR
targetSummoner->RemoveAurasDueToSpell(SPELL_RACER_KILL_COUNTER);
}
if (Player* targetSummoner = target->GetCharmerOrOwnerPlayerOrPlayerItself())
{
//targetSummoner->RemoveCriteriaProgress(sAchievementCriteriaStore.LookupEntry(RACER_ACHI_CRITERIA)); !ZOMG, ADD ACCESSOR
targetSummoner->RemoveAurasDueToSpell(SPELL_RACER_KILL_COUNTER);
}
}
void Register()
@@ -231,11 +231,11 @@ class spell_winter_veil_racer_slam_hit : public SpellScriptLoader
enum airRifle
{
SPELL_AIR_RIFLE_RIGHT_IN_THE_EYE = 65577,
SPELL_AIR_RIFLE_STARLED = 61862,
SPELL_AIR_RIFLE_HIT = 61866,
SPELL_AIR_RIFLE_HIT_TRIGGER = 65576,
SPELL_AIR_RIFLE_PELTED_DAMAGE = 67531,
SPELL_AIR_RIFLE_RIGHT_IN_THE_EYE = 65577,
SPELL_AIR_RIFLE_STARLED = 61862,
SPELL_AIR_RIFLE_HIT = 61866,
SPELL_AIR_RIFLE_HIT_TRIGGER = 65576,
SPELL_AIR_RIFLE_PELTED_DAMAGE = 67531,
};
class spell_winter_veil_shoot_air_rifle : public SpellScriptLoader
@@ -249,34 +249,34 @@ class spell_winter_veil_shoot_air_rifle : public SpellScriptLoader
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetOriginalCaster();
Unit* target = GetHitUnit();
if (!target)
return;
Unit* caster = GetOriginalCaster();
Unit* target = GetHitUnit();
if (!target)
return;
if (GetSpellInfo()->Id == SPELL_AIR_RIFLE_HIT_TRIGGER)
{
if (!caster->IsFriendlyTo(target))
caster->CastSpell(target, SPELL_AIR_RIFLE_PELTED_DAMAGE, true, NULL, NULL, caster->GetGUID());
}
else
{
uint8 rand = urand(0, 99);
if (rand < 15)
caster->CastSpell(caster, SPELL_AIR_RIFLE_RIGHT_IN_THE_EYE, true, NULL, NULL, caster->GetGUID());
else if (rand < 35)
caster->CastSpell(target, SPELL_AIR_RIFLE_STARLED, true, NULL, NULL, caster->GetGUID());
else
caster->CastSpell(target, SPELL_AIR_RIFLE_HIT, true, NULL, NULL, caster->GetGUID());
}
if (GetSpellInfo()->Id == SPELL_AIR_RIFLE_HIT_TRIGGER)
{
if (!caster->IsFriendlyTo(target))
caster->CastSpell(target, SPELL_AIR_RIFLE_PELTED_DAMAGE, true, NULL, NULL, caster->GetGUID());
}
else
{
uint8 rand = urand(0, 99);
if (rand < 15)
caster->CastSpell(caster, SPELL_AIR_RIFLE_RIGHT_IN_THE_EYE, true, NULL, NULL, caster->GetGUID());
else if (rand < 35)
caster->CastSpell(target, SPELL_AIR_RIFLE_STARLED, true, NULL, NULL, caster->GetGUID());
else
caster->CastSpell(target, SPELL_AIR_RIFLE_HIT, true, NULL, NULL, caster->GetGUID());
}
}
void Register()
{
if (m_scriptSpellId == SPELL_AIR_RIFLE_HIT_TRIGGER)
OnEffectHitTarget += SpellEffectFn(spell_winter_veil_shoot_air_rifle_SpellScript::HandleScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
else
OnEffectHitTarget += SpellEffectFn(spell_winter_veil_shoot_air_rifle_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
if (m_scriptSpellId == SPELL_AIR_RIFLE_HIT_TRIGGER)
OnEffectHitTarget += SpellEffectFn(spell_winter_veil_shoot_air_rifle_SpellScript::HandleScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
else
OnEffectHitTarget += SpellEffectFn(spell_winter_veil_shoot_air_rifle_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
@@ -288,10 +288,10 @@ class spell_winter_veil_shoot_air_rifle : public SpellScriptLoader
void AddSC_event_winter_veil_scripts()
{
// Spells
new spell_winter_veil_mistletoe();
new spell_winter_wondervolt_trap();
new spell_winter_veil_racer_rocket_slam();
new spell_winter_veil_racer_slam_hit();
new spell_winter_veil_shoot_air_rifle();
// Spells
new spell_winter_veil_mistletoe();
new spell_winter_wondervolt_trap();
new spell_winter_veil_racer_rocket_slam();
new spell_winter_veil_racer_slam_hit();
new spell_winter_veil_shoot_air_rifle();
}