mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-28 12:52:25 +01:00
*More update about positions.
*Ulduar: do not allow demolisher to regenerate pyrite. Player must shoot down and grab the containers to refill pyrite. --HG-- branch : trunk
This commit is contained in:
@@ -81,19 +81,19 @@ struct MANGOS_DLL_DECL npc_00x09hlAI : public npc_escortAI
|
||||
case 27:
|
||||
for(uint8 i = 0; i < 3; ++i)
|
||||
{
|
||||
float fX, fY, fZ;
|
||||
m_creature->GetRandomPoint(147.927444f, -3851.513428f, 130.893f, 7.0f, fX, fY, fZ);
|
||||
|
||||
m_creature->SummonCreature(NPC_MARAUDING_OWL, fX, fY, fZ, 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 25000);
|
||||
const Position src = {147.927444f, -3851.513428f, 130.893f, 0};
|
||||
Position pos;
|
||||
me->GetRandomNearPosition(pos, 7.0f);
|
||||
DoSummon(NPC_MARAUDING_OWL, pos, 25000, TEMPSUMMON_CORPSE_TIMED_DESPAWN);
|
||||
}
|
||||
break;
|
||||
case 44:
|
||||
for(uint8 i = 0; i < 3; ++i)
|
||||
{
|
||||
float fX, fY, fZ;
|
||||
m_creature->GetRandomPoint(-141.151581f, -4291.213867f, 120.130f, 7.0f, fX, fY, fZ);
|
||||
|
||||
m_creature->SummonCreature(NPC_VILE_AMBUSHER, fX, fY, fZ, 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 25000);
|
||||
const Position src = {-141.151581f, -4291.213867f, 120.130f, 0};
|
||||
Position dst;
|
||||
m_creature->GetRandomPoint(src, 7.0f, dst);
|
||||
m_creature->SummonCreature(NPC_VILE_AMBUSHER, dst, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 25000);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -339,23 +339,18 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI
|
||||
void SummonInfernal(const uint32 diff)
|
||||
{
|
||||
InfernalPoint *point = NULL;
|
||||
float posX,posY,posZ;
|
||||
Position pos;
|
||||
if ((m_creature->GetMapId() != 532) || positions.empty())
|
||||
{
|
||||
m_creature->GetRandomPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 60, posX, posY, posZ);
|
||||
}
|
||||
me->GetRandomNearPosition(pos, 60);
|
||||
else
|
||||
{
|
||||
std::vector<InfernalPoint*>::iterator itr = positions.begin()+rand()%positions.size();
|
||||
point = *itr;
|
||||
positions.erase(itr);
|
||||
|
||||
posX = point->x;
|
||||
posY = point->y;
|
||||
posZ = INFERNAL_Z;
|
||||
pos.Relocate(point->x, point->y, INFERNAL_Z);
|
||||
}
|
||||
|
||||
Creature *Infernal = m_creature->SummonCreature(NETHERSPITE_INFERNAL, posX, posY, posZ, 0, TEMPSUMMON_TIMED_DESPAWN, 180000);
|
||||
Creature *Infernal = m_creature->SummonCreature(NETHERSPITE_INFERNAL, pos, TEMPSUMMON_TIMED_DESPAWN, 180000);
|
||||
|
||||
if (Infernal)
|
||||
{
|
||||
|
||||
@@ -654,11 +654,9 @@ struct TRINITY_DLL_DECL mob_cycloneAI : public ScriptedAI
|
||||
|
||||
if (MoveTimer < diff)
|
||||
{
|
||||
float x,y,z;
|
||||
m_creature->GetPosition(x,y,z);
|
||||
float PosX, PosY, PosZ;
|
||||
m_creature->GetRandomPoint(x,y,z,10, PosX, PosY, PosZ);
|
||||
m_creature->GetMotionMaster()->MovePoint(0, PosX, PosY, PosZ);
|
||||
Position pos;
|
||||
m_creature->GetRandomNearPosition(pos, 10);
|
||||
m_creature->GetMotionMaster()->MovePoint(0, pos);
|
||||
MoveTimer = 5000 + rand()%3000;
|
||||
}else MoveTimer -= diff;
|
||||
}
|
||||
|
||||
@@ -205,13 +205,10 @@ struct TRINITY_DLL_DECL mobs_spectral_ghostly_citizenAI : public ScriptedAI
|
||||
{
|
||||
for(uint32 i = 1; i <= 4; ++i)
|
||||
{
|
||||
float x,y,z;
|
||||
m_creature->GetRandomPoint(m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),20.0f,x,y,z);
|
||||
|
||||
//100%, 50%, 33%, 25% chance to spawn
|
||||
uint32 j = urand(1,i);
|
||||
if (j==1)
|
||||
m_creature->SummonCreature(ENTRY_RESTLESS,x,y,z,0,TEMPSUMMON_CORPSE_DESPAWN,600000);
|
||||
DoSummon(ENTRY_RESTLESS, me, 20.0f, 600000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,16 +63,8 @@ struct TRINITY_DLL_DECL npc_lady_sylvanas_windrunnerAI : public ScriptedAI
|
||||
bool LamentEvent;
|
||||
uint64 targetGUID;
|
||||
|
||||
float myX;
|
||||
float myY;
|
||||
float myZ;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
myX = m_creature->GetPositionX();
|
||||
myY = m_creature->GetPositionY();
|
||||
myZ = m_creature->GetPositionZ();
|
||||
|
||||
LamentEvent_Timer = 5000;
|
||||
LamentEvent = false;
|
||||
targetGUID = 0;
|
||||
@@ -86,8 +78,8 @@ struct TRINITY_DLL_DECL npc_lady_sylvanas_windrunnerAI : public ScriptedAI
|
||||
{
|
||||
if (Unit* target = Unit::GetUnit(*summoned,targetGUID))
|
||||
{
|
||||
target->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), myZ+15.0,0);
|
||||
target->GetMap()->CreatureRelocation(m_creature, target->GetPositionX(), target->GetPositionY(), myZ+15.0, 0.0f);
|
||||
target->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), me->GetPositionZ()+15.0,0);
|
||||
target->GetMap()->CreatureRelocation(m_creature, target->GetPositionX(), target->GetPositionY(), me->GetPositionZ()+15.0, 0.0f);
|
||||
summoned->CastSpell(target, SPELL_RIBBON_OF_SOULS, false);
|
||||
}
|
||||
|
||||
@@ -102,12 +94,7 @@ struct TRINITY_DLL_DECL npc_lady_sylvanas_windrunnerAI : public ScriptedAI
|
||||
{
|
||||
if (LamentEvent_Timer < diff)
|
||||
{
|
||||
float raX = myX;
|
||||
float raY = myY;
|
||||
float raZ = myZ;
|
||||
|
||||
m_creature->GetRandomPoint(myX, myY, myZ, 20.0, raX, raY, raZ);
|
||||
m_creature->SummonCreature(ENTRY_HIGHBORNE_BUNNY, raX, raY, myZ, 0, TEMPSUMMON_TIMED_DESPAWN, 3000);
|
||||
DoSummon(ENTRY_HIGHBORNE_BUNNY, me, 10.0f, 3000, TEMPSUMMON_TIMED_DESPAWN);
|
||||
|
||||
LamentEvent_Timer = 2000;
|
||||
if (!m_creature->HasAura(SPELL_SYLVANAS_CAST))
|
||||
|
||||
@@ -286,20 +286,15 @@ struct TRINITY_DLL_DECL npc_time_riftAI : public ScriptedAI
|
||||
return;
|
||||
}
|
||||
|
||||
float x,y,z;
|
||||
m_creature->GetRandomPoint(m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),10.0f,x,y,z);
|
||||
Position pos;
|
||||
m_creature->GetRandomNearPosition(pos, 10.0f);
|
||||
|
||||
//normalize Z-level if we can, if rift is not at ground level.
|
||||
z = std::max(m_creature->GetMap()->GetHeight(x, y, MAX_HEIGHT), m_creature->GetMap()->GetWaterLevel(x, y));
|
||||
pos.m_positionZ = std::max(m_creature->GetMap()->GetHeight(pos.m_positionX, pos.m_positionY, MAX_HEIGHT), m_creature->GetMap()->GetWaterLevel(pos.m_positionX, pos.m_positionY));
|
||||
|
||||
Unit *Summon = m_creature->SummonCreature(creature_entry,x,y,z,m_creature->GetOrientation(),
|
||||
TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000);
|
||||
|
||||
if (Summon)
|
||||
{
|
||||
if(Unit *Summon = DoSummon(creature_entry, pos, 30000, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT))
|
||||
if (Unit *temp = Unit::GetUnit(*m_creature, pInstance ? pInstance->GetData64(DATA_MEDIVH) : 0))
|
||||
Summon->AddThreat(temp,0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void DoSelectSummon()
|
||||
|
||||
@@ -245,25 +245,23 @@ struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance
|
||||
return 0;
|
||||
}
|
||||
|
||||
Creature* SummonedPortalBoss(Creature* pSource)
|
||||
Creature* SummonedPortalBoss(Creature* m_creature)
|
||||
{
|
||||
uint32 entry = RiftWaves[GetRiftWaveId()].PortalBoss;
|
||||
|
||||
if (entry == RIFT_BOSS)
|
||||
entry = RandRiftBoss();
|
||||
|
||||
float x,y,z;
|
||||
pSource->GetRandomPoint(pSource->GetPositionX(),pSource->GetPositionY(),pSource->GetPositionZ(),10.0f,x,y,z);
|
||||
//normalize Z-level if we can, if rift is not at ground level.
|
||||
z = std::max(instance->GetHeight(x, y, MAX_HEIGHT), instance->GetWaterLevel(x, y));
|
||||
|
||||
debug_log("TSCR: Instance Dark Portal: Summoning rift boss entry %u.",entry);
|
||||
|
||||
Creature* pSummoned = pSource->SummonCreature(entry,x,y,z,pSource->GetOrientation(),
|
||||
TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000);
|
||||
Position pos;
|
||||
m_creature->GetRandomNearPosition(pos, 10.0f);
|
||||
|
||||
if (pSummoned)
|
||||
return pSummoned;
|
||||
//normalize Z-level if we can, if rift is not at ground level.
|
||||
pos.m_positionZ = std::max(m_creature->GetMap()->GetHeight(pos.m_positionX, pos.m_positionY, MAX_HEIGHT), m_creature->GetMap()->GetWaterLevel(pos.m_positionX, pos.m_positionY));
|
||||
|
||||
if(Creature *summon = m_creature->SummonCreature(entry, pos, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000))
|
||||
return summon;
|
||||
|
||||
debug_log("TSCR: Instance Dark Portal: what just happened there? No boss, no loot, no fun...");
|
||||
return NULL;
|
||||
|
||||
@@ -165,9 +165,9 @@ struct TRINITY_DLL_DECL mob_doomfire_targettingAI : public ScriptedAI
|
||||
}
|
||||
else
|
||||
{
|
||||
float x,y,z = 0.0;
|
||||
m_creature->GetRandomPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 40, x, y, z);
|
||||
m_creature->GetMotionMaster()->MovePoint(0, x, y, z);
|
||||
Position pos;
|
||||
m_creature->GetRandomNearPosition(pos, 40);
|
||||
m_creature->GetMotionMaster()->MovePoint(0, pos.m_positionX, pos.m_positionY, pos.m_positionZ);
|
||||
}
|
||||
|
||||
ChangeTargetTimer = 5000;
|
||||
|
||||
@@ -255,9 +255,7 @@ struct TRINITY_DLL_DECL boss_sapphironAI : public BossAI
|
||||
case EVENT_BLIZZARD:
|
||||
{
|
||||
//DoCastAOE(SPELL_SUMMON_BLIZZARD);
|
||||
float x, y, z;
|
||||
me->GetGroundPointAroundUnit(x, y, z, rand_norm()*20, rand_norm()*2*M_PI);
|
||||
if (Creature *summon = me->SummonCreature(MOB_BLIZZARD, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN, 25000+rand()%5000))
|
||||
if(Creature *summon = DoSummon(MOB_BLIZZARD, me, 25000+rand()%5000, TEMPSUMMON_TIMED_DESPAWN))
|
||||
summon->GetMotionMaster()->MoveRandom(40);
|
||||
events.ScheduleEvent(EVENT_BLIZZARD, HEROIC(20000,7000), 0, PHASE_GROUND);
|
||||
break;
|
||||
|
||||
@@ -295,12 +295,7 @@ struct TRINITY_DLL_DECL boss_flame_leviathan_safety_containerAI : public Passive
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if(!me->GetVehicle() && me->isSummon() && me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE)
|
||||
{
|
||||
//me->AddUnitMovementFlag(MOVEMENTFLAG_FALLING);
|
||||
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
|
||||
me->SendMovementFlagUpdate();
|
||||
me->GetMotionMaster()->MovePoint(me->GetEntry(), me->GetPositionX(), me->GetPositionY(), 409.8f);
|
||||
}
|
||||
me->GetMotionMaster()->MoveFall(409.8f, me->GetEntry());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -44,7 +44,20 @@ struct TRINITY_DLL_DECL boss_kologarnAI : public BossAI
|
||||
|
||||
void AttackStart(Unit *who)
|
||||
{
|
||||
me->Attack(who, false);
|
||||
me->Attack(who, true);
|
||||
if(leftArm)
|
||||
leftArm->Attack(who, true);
|
||||
if(rightArm)
|
||||
rightArm->Attack(who, true);
|
||||
}
|
||||
|
||||
void MeleeSwing(WeaponAttackType type)
|
||||
{
|
||||
me->AttackerStateUpdate(me->getVictim(), type);
|
||||
if(leftArm)
|
||||
leftArm->AttackerStateUpdate(me->getVictim(), type);
|
||||
if(rightArm)
|
||||
rightArm->AttackerStateUpdate(me->getVictim(), type);
|
||||
}
|
||||
|
||||
void PassengerBoarded(Unit *who, int8 seatId, bool apply)
|
||||
@@ -66,10 +79,9 @@ struct TRINITY_DLL_DECL boss_kologarnAI : public BossAI
|
||||
//If we are within range melee the target
|
||||
if (me->IsWithinMeleeRange(me->getVictim()))
|
||||
{
|
||||
Unit *attacker = me;
|
||||
if(leftArm) attacker = leftArm;
|
||||
if(rightArm && rand()%2) attacker = rightArm;
|
||||
attacker->AttackerStateUpdate(me->getVictim());
|
||||
WeaponAttackType type = BASE_ATTACK;
|
||||
if(leftArm && (!rightArm || rand()%2)) type = OFF_ATTACK;
|
||||
MeleeSwing(type);
|
||||
me->resetAttackTimer();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -274,19 +274,17 @@ struct TRINITY_DLL_DECL mob_enslaved_netherwing_drakeAI : public ScriptedAI
|
||||
m_creature->GetRandomPoint(x, y, z, 20, dx, dy, dz);
|
||||
dz += 20; // so it's in the air, not ground*/
|
||||
|
||||
float dx, dy, dz;
|
||||
|
||||
Unit* EscapeDummy = me->FindNearestCreature(CREATURE_ESCAPE_DUMMY, 30);
|
||||
if (EscapeDummy)
|
||||
EscapeDummy->GetPosition(dx, dy, dz);
|
||||
Position pos;
|
||||
if(Unit* EscapeDummy = me->FindNearestCreature(CREATURE_ESCAPE_DUMMY, 30))
|
||||
EscapeDummy->GetPosition(&pos);
|
||||
else
|
||||
{
|
||||
m_creature->GetRandomPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 20, dx, dy, dz);
|
||||
dz += 25;
|
||||
m_creature->GetRandomNearPosition(pos, 20);
|
||||
pos.m_positionZ += 25;
|
||||
}
|
||||
|
||||
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
|
||||
m_creature->GetMotionMaster()->MovePoint(1, dx, dy, dz);
|
||||
m_creature->GetMotionMaster()->MovePoint(1, pos);
|
||||
}
|
||||
}
|
||||
}else FlyTimer -= diff;
|
||||
@@ -962,10 +960,7 @@ struct TRINITY_DLL_DECL npc_earthmender_wildaAI : public npc_escortAI
|
||||
void DoSpawnAssassin()
|
||||
{
|
||||
//unknown where they actually appear
|
||||
float fX, fY, fZ;
|
||||
m_creature->GetRandomPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 15.0f, fX, fY, fZ);
|
||||
|
||||
m_creature->SummonCreature(NPC_COILSKAR_ASSASSIN, fX, fY, fZ, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
|
||||
DoSummon(NPC_COILSKAR_ASSASSIN, me, 15.0f, 5000, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT);
|
||||
}
|
||||
|
||||
void Aggro(Unit* pWho)
|
||||
|
||||
Reference in New Issue
Block a user