Refactor(Core/Gossip): Replacing old macros with new (#1338)

* Correct support new macro
This commit is contained in:
Kargatum
2019-03-25 21:10:57 +07:00
committed by GitHub
parent 4abe082190
commit b6cb9247ba
99 changed files with 2840 additions and 2775 deletions

View File

@@ -272,7 +272,7 @@ public:
}
else
me->GetMotionMaster()->MovePoint(MovePhase, IntroWay[MovePhase][0], IntroWay[MovePhase][1], IntroWay[MovePhase][2]);
MovePhase = 0;
}
@@ -295,14 +295,14 @@ public:
{
DoCastVictim(SPELL_BELLOWING_ROAR);
BellowingRoarTimer = urand(30000, 40000);
} else
} else
BellowingRoarTimer -= diff;
if (SmolderingBreathTimer <= diff)
{
DoCastVictim(SPELL_SMOLDERING_BREATH);
SmolderingBreathTimer = 20000;
} else
} else
SmolderingBreathTimer -= diff;
if (CharredEarthTimer <= diff)
@@ -310,7 +310,7 @@ public:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_CHARRED_EARTH);
CharredEarthTimer = 20000;
} else
} else
CharredEarthTimer -= diff;
if (TailSweepTimer <= diff)
@@ -319,7 +319,7 @@ public:
if (!me->HasInArc(M_PI, target))
DoCast(target, SPELL_TAIL_SWEEP);
TailSweepTimer = 15000;
} else
} else
TailSweepTimer -= diff;
if (SearingCindersTimer <= diff)
@@ -327,7 +327,7 @@ public:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_SEARING_CINDERS);
SearingCindersTimer = 10000;
} else
} else
SearingCindersTimer -= diff;
uint32 Prozent = uint32(me->GetHealthPct());
@@ -363,7 +363,7 @@ public:
DoCastVictim(SPELL_RAIN_OF_BONES);
RainBones = true;
SmokingBlastTimer = 20000;
} else
} else
RainofBonesTimer -= diff;
if (DistractingAshTimer <= diff)
@@ -371,7 +371,7 @@ public:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_DISTRACTING_ASH);
DistractingAshTimer = 2000; //timer wrong
} else
} else
DistractingAshTimer -= diff;
}
@@ -381,7 +381,7 @@ public:
{
DoCastVictim(SPELL_SMOKING_BLAST);
SmokingBlastTimer = 1500; //timer wrong
} else
} else
SmokingBlastTimer -= diff;
}
@@ -390,7 +390,7 @@ public:
if (Unit* target = SelectTarget(SELECT_TARGET_FARTHEST, 0))
DoCast(target, SPELL_FIREBALL_BARRAGE);
FireballBarrageTimer = 20000;
} else
} else
FireballBarrageTimer -= diff;
if (FlyTimer <= diff) //landing
@@ -401,7 +401,7 @@ public:
me->GetMotionMaster()->MovePoint(3, IntroWay[3][0], IntroWay[3][1], IntroWay[3][2]);
Flying = true;
} else
} else
FlyTimer -= diff;
}
}
@@ -414,14 +414,15 @@ class go_blackened_urn : public GameObjectScript
public:
go_blackened_urn() : GameObjectScript("go_blackened_urn") { }
bool OnGossipHello(Player* pPlayer, GameObject *pGo)
bool OnGossipHello(Player* player, GameObject* go) override
{
if (InstanceScript* pInstance = pGo->GetInstanceScript())
if (InstanceScript* pInstance = go->GetInstanceScript())
{
if (pInstance->GetData(DATA_NIGHTBANE) != DONE && !pGo->FindNearestCreature(NPC_NIGHTBANE, 40.0f))
if (Creature *cr = ObjectAccessor::GetCreature(*pPlayer, pInstance->GetData64(DATA_NIGHTBANE)))
if (pInstance->GetData(DATA_NIGHTBANE) != DONE && !go->FindNearestCreature(NPC_NIGHTBANE, 40.0f))
if (Creature *cr = ObjectAccessor::GetCreature(*player, pInstance->GetData64(DATA_NIGHTBANE)))
cr->GetMotionMaster()->MovePoint(0, IntroWay[0][0], IntroWay[0][1], IntroWay[0][2]);
}
return false;
}
};

View File

@@ -193,7 +193,7 @@ public:
{
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
AggroTimer = 0;
} else
} else
AggroTimer -= diff;
}
@@ -204,21 +204,21 @@ public:
{
DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0), SPELL_WATERBOLT);
WaterBoltTimer = TitoDied ? 1500 : 5000;
} else
} else
WaterBoltTimer -= diff;
if (FearTimer <= diff)
{
DoCastVictim(SPELL_SCREAM);
FearTimer = 30000;
} else
} else
FearTimer -= diff;
if (!SummonedTito)
{
if (SummonTitoTimer <= diff)
SummonTito();
else
else
SummonTitoTimer -= diff;
}
@@ -250,7 +250,7 @@ public:
YipTimer = 10000;
}
void EnterCombat(Unit* /*who*/)
void EnterCombat(Unit* /*who*/)
{
DoZoneInCombat();
}
@@ -277,7 +277,7 @@ public:
{
DoCastVictim(SPELL_YIPPING);
YipTimer = 10000;
} else
} else
YipTimer -= diff;
DoMeleeAttackIfReady();
@@ -388,7 +388,7 @@ public:
{
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
AggroTimer = 0;
} else
} else
AggroTimer -= diff;
}
@@ -399,7 +399,7 @@ public:
{
DoCastVictim(SPELL_BRAIN_BASH);
BrainBashTimer = 15000;
} else
} else
BrainBashTimer -= diff;
if (BrainWipeTimer <= diff)
@@ -407,7 +407,7 @@ public:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_BRAIN_WIPE);
BrainWipeTimer = 20000;
} else
} else
BrainWipeTimer -= diff;
DoMeleeAttackIfReady();
@@ -497,7 +497,7 @@ public:
{
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
AggroTimer = 0;
} else
} else
AggroTimer -= diff;
}
@@ -508,7 +508,7 @@ public:
{
DoCastVictim(SPELL_CLEAVE);
CleaveTimer = 5000;
} else
} else
CleaveTimer -= diff;
if (RustCount < 8)
@@ -519,7 +519,7 @@ public:
Talk(EMOTE_RUST);
DoCast(me, SPELL_RUST);
RustTimer = 6000;
} else
} else
RustTimer -= diff;
}
@@ -608,7 +608,7 @@ public:
{
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
AggroTimer = 0;
} else
} else
AggroTimer -= diff;
}
@@ -619,21 +619,21 @@ public:
{
DoCastVictim(SPELL_MANGLE);
MangleTimer = urand(5000, 8000);
} else
} else
MangleTimer -= diff;
if (ShredTimer <= diff)
{
DoCastVictim(SPELL_SHRED);
ShredTimer = urand(10000, 15000);
} else
} else
ShredTimer -= diff;
if (ScreamTimer <= diff)
{
DoCastVictim(SPELL_FRIGHTENED_SCREAM);
ScreamTimer = urand(20000, 30000);
} else
} else
ScreamTimer -= diff;
DoMeleeAttackIfReady();
@@ -710,14 +710,14 @@ public:
if (Creature* Cyclone = DoSpawnCreature(CREATURE_CYCLONE, float(urand(0, 9)), float(urand(0, 9)), 0, 0, TEMPSUMMON_TIMED_DESPAWN, 15000))
Cyclone->CastSpell(Cyclone, SPELL_CYCLONE_VISUAL, true);
CycloneTimer = 22000;
} else
} else
CycloneTimer -= diff;
if (ChainLightningTimer <= diff)
{
DoCastVictim(SPELL_CHAIN_LIGHTNING);
ChainLightningTimer = 8000;
} else
} else
ChainLightningTimer -= diff;
DoMeleeAttackIfReady();
@@ -764,7 +764,7 @@ public:
me->GetRandomNearPosition(pos, 10);
me->GetMotionMaster()->MovePoint(0, pos);
MoveTimer = urand(3000, 5000);
} else
} else
MoveTimer -= diff;
}
};
@@ -797,9 +797,9 @@ class npc_grandmother : public CreatureScript
public:
npc_grandmother() : CreatureScript("npc_grandmother") { }
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
{
player->PlayerTalkClass->ClearMenus();
ClearGossipMenuFor(player);
if (action == GOSSIP_ACTION_INFO_DEF)
{
if (Creature* pBigBadWolf = creature->SummonCreature(CREATURE_BIG_BAD_WOLF, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILLISECONDS))
@@ -811,10 +811,10 @@ public:
return true;
}
bool OnGossipHello(Player* player, Creature* creature)
bool OnGossipHello(Player* player, Creature* creature) override
{
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_GRANDMA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
player->SEND_GOSSIP_MENU(8990, creature->GetGUID());
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_GRANDMA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
SendGossipMenuFor(player, 8990, creature->GetGUID());
return true;
}
@@ -927,7 +927,7 @@ public:
ChaseTimer = 40000;
}
} else
} else
ChaseTimer -= diff;
if (IsChasing)
@@ -937,14 +937,14 @@ public:
{
DoCastVictim(SPELL_TERRIFYING_HOWL);
FearTimer = urand(25000, 35000);
} else
} else
FearTimer -= diff;
if (SwipeTimer <= diff)
{
DoCastVictim(SPELL_WIDE_SWIPE);
SwipeTimer = urand(25000, 30000);
} else
} else
SwipeTimer -= diff;
}
};
@@ -1314,7 +1314,7 @@ public:
JulianneDead = false;
ResurrectTimer = 10000;
}
} else
} else
ResurrectTimer -= diff;
}
@@ -1326,14 +1326,14 @@ public:
DoCast(target, SPELL_BACKWARD_LUNGE);
BackwardLungeTimer = urand(15000, 30000);
}
} else
} else
BackwardLungeTimer -= diff;
if (DaringTimer <= diff)
{
DoCast(me, SPELL_DARING);
DaringTimer = urand(20000, 40000);
} else
} else
DaringTimer -= diff;
if (DeadlySwatheTimer <= diff)
@@ -1341,14 +1341,14 @@ public:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_DEADLY_SWATHE);
DeadlySwatheTimer = urand(15000, 25000);
} else
} else
DeadlySwatheTimer -= diff;
if (PoisonThrustTimer <= diff)
{
DoCastVictim(SPELL_POISON_THRUST);
PoisonThrustTimer = urand(10000, 20000);
} else
} else
PoisonThrustTimer -= diff;
DoMeleeAttackIfReady();
@@ -1364,7 +1364,7 @@ void boss_julianne::boss_julianneAI::UpdateAI(uint32 diff)
{
Talk(SAY_JULIANNE_ENTER);
EntryYellTimer = 0;
} else
} else
EntryYellTimer -= diff;
}
@@ -1376,7 +1376,7 @@ void boss_julianne::boss_julianneAI::UpdateAI(uint32 diff)
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->setFaction(16);
AggroYellTimer = 0;
} else
} else
AggroYellTimer -= diff;
}
@@ -1389,7 +1389,7 @@ void boss_julianne::boss_julianneAI::UpdateAI(uint32 diff)
Phase = PHASE_ROMULO;
SummonRomuloTimer = 10000;
DrinkPoisonTimer = 0;
} else
} else
DrinkPoisonTimer -= diff;
}
@@ -1407,7 +1407,7 @@ void boss_julianne::boss_julianneAI::UpdateAI(uint32 diff)
pRomulo->setFaction(16);
}
SummonedRomulo = true;
} else
} else
SummonRomuloTimer -= diff;
}
@@ -1424,7 +1424,7 @@ void boss_julianne::boss_julianneAI::UpdateAI(uint32 diff)
ResurrectSelfTimer = 0;
ResurrectTimer = 1000;
} else
} else
ResurrectSelfTimer -= diff;
}
@@ -1444,7 +1444,7 @@ void boss_julianne::boss_julianneAI::UpdateAI(uint32 diff)
RomuloDead = false;
ResurrectTimer = 10000;
}
} else
} else
ResurrectTimer -= diff;
}
@@ -1453,21 +1453,21 @@ void boss_julianne::boss_julianneAI::UpdateAI(uint32 diff)
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_BLINDING_PASSION);
BlindingPassionTimer = urand(30000, 45000);
} else
} else
BlindingPassionTimer -= diff;
if (DevotionTimer <= diff)
{
DoCast(me, SPELL_DEVOTION);
DevotionTimer = urand(15000, 45000);
} else
} else
DevotionTimer -= diff;
if (PowerfulAttractionTimer <= diff)
{
DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0), SPELL_POWERFUL_ATTRACTION);
PowerfulAttractionTimer = urand(5000, 30000);
} else
} else
PowerfulAttractionTimer -= diff;
if (EternalAffectionTimer <= diff)
@@ -1480,7 +1480,7 @@ void boss_julianne::boss_julianneAI::UpdateAI(uint32 diff)
} else DoCast(me, SPELL_ETERNAL_AFFECTION);
EternalAffectionTimer = urand(45000, 60000);
} else
} else
EternalAffectionTimer -= diff;
DoMeleeAttackIfReady();

View File

@@ -136,7 +136,7 @@ public:
bool PerformanceReady;
bool RaidWiped;
void Reset()
void Reset() override
{
m_uiSpotlightGUID = 0;
@@ -160,9 +160,9 @@ public:
Start(false, false);
}
void EnterCombat(Unit* /*who*/) { }
void EnterCombat(Unit* /*who*/) override { }
void WaypointReached(uint32 waypointId)
void WaypointReached(uint32 waypointId) override
{
switch (waypointId)
{
@@ -266,7 +266,7 @@ public:
RaidWiped = false;
}
void UpdateAI(uint32 diff)
void UpdateAI(uint32 diff) override
{
npc_escortAI::UpdateAI(diff);
@@ -326,31 +326,31 @@ public:
}
};
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
{
player->PlayerTalkClass->ClearMenus();
ClearGossipMenuFor(player);
npc_barnesAI* pBarnesAI = CAST_AI(npc_barnes::npc_barnesAI, creature->AI());
switch (action)
{
case GOSSIP_ACTION_INFO_DEF+1:
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, OZ_GOSSIP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
player->SEND_GOSSIP_MENU(8971, creature->GetGUID());
AddGossipItemFor(player, GOSSIP_ICON_CHAT, OZ_GOSSIP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
SendGossipMenuFor(player, 8971, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+2:
player->CLOSE_GOSSIP_MENU();
CloseGossipMenuFor(player);
pBarnesAI->StartEvent();
break;
case GOSSIP_ACTION_INFO_DEF+3:
player->CLOSE_GOSSIP_MENU();
CloseGossipMenuFor(player);
pBarnesAI->m_uiEventId = EVENT_OZ;
break;
case GOSSIP_ACTION_INFO_DEF+4:
player->CLOSE_GOSSIP_MENU();
CloseGossipMenuFor(player);
pBarnesAI->m_uiEventId = EVENT_HOOD;
break;
case GOSSIP_ACTION_INFO_DEF+5:
player->CLOSE_GOSSIP_MENU();
CloseGossipMenuFor(player);
pBarnesAI->m_uiEventId = EVENT_RAJ;
break;
}
@@ -358,39 +358,39 @@ public:
return true;
}
bool OnGossipHello(Player* player, Creature* creature)
bool OnGossipHello(Player* player, Creature* creature) override
{
if (InstanceScript* instance = creature->GetInstanceScript())
{
// Check for death of Moroes and if opera event is not done already
if (instance->GetBossState(DATA_MOROES) == DONE && instance->GetBossState(DATA_OPERA_PERFORMANCE) != DONE)
{
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, OZ_GOSSIP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
AddGossipItemFor(player, GOSSIP_ICON_CHAT, OZ_GOSSIP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
if (player->IsGameMaster())
{
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, OZ_GM_GOSSIP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, OZ_GM_GOSSIP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, OZ_GM_GOSSIP3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
AddGossipItemFor(player, GOSSIP_ICON_DOT, OZ_GM_GOSSIP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
AddGossipItemFor(player, GOSSIP_ICON_DOT, OZ_GM_GOSSIP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
AddGossipItemFor(player, GOSSIP_ICON_DOT, OZ_GM_GOSSIP3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
}
if (npc_barnesAI* pBarnesAI = CAST_AI(npc_barnes::npc_barnesAI, creature->AI()))
{
if (!pBarnesAI->RaidWiped)
player->SEND_GOSSIP_MENU(8970, creature->GetGUID());
SendGossipMenuFor(player, 8970, creature->GetGUID());
else
player->SEND_GOSSIP_MENU(8975, creature->GetGUID());
SendGossipMenuFor(player, 8975, creature->GetGUID());
return true;
}
}
}
player->SEND_GOSSIP_MENU(8978, creature->GetGUID());
SendGossipMenuFor(player, 8978, creature->GetGUID());
return true;
}
CreatureAI* GetAI(Creature* creature) const
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_barnesAI(creature);
}
@@ -550,7 +550,7 @@ public:
arca->DespawnOrUnsummon(100);
return 5000;
default:
default:
return 2000;
}