mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 08:55:32 +01:00
*Add function SummonTrigger and allow to override its AI.
*Remove some trigger scripts. Use default trigger AI and db data instead. *Small fix on eagle boss' electrical storm. --HG-- branch : trunk
This commit is contained in:
14
sql/updates/455_world.sql
Normal file
14
sql/updates/455_world.sql
Normal file
@@ -0,0 +1,14 @@
|
||||
-- demon fire
|
||||
update creature_template set spell1 = 40029, flags_extra = 128, scriptname = '' where entry = 23069;
|
||||
-- pillar of fire
|
||||
update creature_template set spell1 = 43218, flags_extra = 128, scriptname = '' where entry = 24187;
|
||||
-- Broggok Poison Cloud
|
||||
update creature_template set spell1 = 30914, flags_extra = 128, scriptname = '' where entry = 17662;
|
||||
|
||||
|
||||
INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (43468, 44007, 1, 'Storm Eye Safe Zone');
|
||||
INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (43658, 43653, 0, 'Electrical Arc Visual');
|
||||
INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (43658, 43654, 0, 'Electrical Arc Visual');
|
||||
INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (43658, 43655, 0, 'Electrical Arc Visual');
|
||||
INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (43658, 43656, 0, 'Electrical Arc Visual');
|
||||
INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (43658, 43659, 0, 'Electrical Arc Visual');
|
||||
@@ -19,7 +19,6 @@ UPDATE `creature_template` SET `ScriptName` = 'boss_fenstalker' WHERE `entry` =2
|
||||
UPDATE `creature_template` SET `ScriptName` = 'boss_darkheart' WHERE `entry` =24246;
|
||||
UPDATE `creature_template` SET `ScriptName` = 'boss_koragg' WHERE `entry` =24247;
|
||||
UPDATE `creature_template` SET `ScriptName` = 'boss_zuljin' WHERE `entry` =23863;
|
||||
UPDATE `creature_template` SET `ScriptName` = 'do_nothing' WHERE `entry` = '24187';
|
||||
UPDATE `creature_template` SET `ScriptName` = 'mob_zuljin_vortex' WHERE `entry` = '24136';
|
||||
UPDATE `creature_template` SET `ScriptName` = 'npc_zulaman_hostage' WHERE `entry` IN (23790, 23999, 24024, 24001);
|
||||
|
||||
|
||||
@@ -220,10 +220,10 @@ void ScriptedAI::DoStopAttack()
|
||||
|
||||
void ScriptedAI::DoCast(Unit* victim, uint32 spellId, bool triggered)
|
||||
{
|
||||
if (!victim || m_creature->IsNonMeleeSpellCasted(false))
|
||||
if (!victim || m_creature->hasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
m_creature->StopMoving();
|
||||
//m_creature->StopMoving();
|
||||
m_creature->CastSpell(victim, spellId, triggered);
|
||||
}
|
||||
|
||||
|
||||
@@ -183,13 +183,13 @@ struct TRINITY_DLL_DECL Scripted_NoMovementAI : public ScriptedAI
|
||||
void AttackStart(Unit *);
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL NullCreatureAI : public CreatureAI
|
||||
struct TRINITY_DLL_DECL NullCreatureAI : public ScriptedAI
|
||||
{
|
||||
NullCreatureAI(Creature* c) : m_creature(c) {}
|
||||
NullCreatureAI(Creature* c) : ScriptedAI(c) {}
|
||||
~NullCreatureAI() {}
|
||||
|
||||
Creature *m_creature;
|
||||
|
||||
void Reset() {}
|
||||
void Aggro(Unit*) {}
|
||||
void MoveInLineOfSight(Unit *) {}
|
||||
void AttackStart(Unit *) {}
|
||||
void EnterEvadeMode() {}
|
||||
|
||||
@@ -1780,73 +1780,9 @@ struct TRINITY_DLL_DECL mob_parasitic_shadowfiendAI : public ScriptedAI
|
||||
}
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL demonfireAI : public ScriptedAI
|
||||
struct TRINITY_DLL_DECL blade_of_azzinothAI : public NullCreatureAI
|
||||
{
|
||||
demonfireAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = ((ScriptedInstance*)c->GetInstanceData());
|
||||
Reset();
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
uint64 IllidanGUID;
|
||||
bool IsTrigger;
|
||||
bool DemonFire;
|
||||
uint32 CheckTimer;
|
||||
uint32 DespawnTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if(pInstance)
|
||||
IllidanGUID = pInstance->GetData64(DATA_ILLIDANSTORMRAGE);
|
||||
else
|
||||
IllidanGUID = 0;
|
||||
|
||||
IsTrigger = false;
|
||||
DemonFire = false;
|
||||
|
||||
CheckTimer = 5000;
|
||||
DespawnTimer = 78000; //spell duration, core bug, cannot despawn self
|
||||
}
|
||||
|
||||
void Aggro(Unit *who) {}
|
||||
void AttackStart(Unit* who) {}
|
||||
void MoveInLineOfSight(Unit *who){}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if(IsTrigger)
|
||||
return;
|
||||
|
||||
if(!DemonFire)
|
||||
DoCast(m_creature, SPELL_DEMON_FIRE); //duration 60s
|
||||
|
||||
if(CheckTimer < diff)
|
||||
{
|
||||
GETUNIT(Illidan, IllidanGUID);
|
||||
if(!Illidan || !Illidan->HasUnitMovementFlag(MOVEMENTFLAG_LEVITATING))
|
||||
{
|
||||
m_creature->SetVisibility(VISIBILITY_OFF);
|
||||
m_creature->setDeathState(JUST_DIED);
|
||||
return;
|
||||
}else CheckTimer = 5000;
|
||||
}else CheckTimer -= diff;
|
||||
|
||||
if(DespawnTimer < diff)
|
||||
{
|
||||
m_creature->SetVisibility(VISIBILITY_OFF);
|
||||
m_creature->setDeathState(JUST_DIED);
|
||||
}else DespawnTimer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL blade_of_azzinothAI : public ScriptedAI
|
||||
{
|
||||
blade_of_azzinothAI(Creature* c) : ScriptedAI(c) {}
|
||||
void Reset() {}
|
||||
void Aggro(Unit *who) {}
|
||||
void AttackStart(Unit* who) { }
|
||||
void MoveInLineOfSight(Unit* who) { }
|
||||
blade_of_azzinothAI(Creature* c) : NullCreatureAI(c) {}
|
||||
|
||||
void SpellHit(Unit *caster, const SpellEntry *spell)
|
||||
{
|
||||
@@ -2060,15 +1996,14 @@ void boss_illidan_stormrageAI::CastEyeBlast()
|
||||
final.x = 2 * final.x - initial.x;
|
||||
final.y = 2 * final.y - initial.y;
|
||||
|
||||
Creature* Trigger = m_creature->SummonCreature(DEMON_FIRE, initial.x, initial.y, initial.z, 0, TEMPSUMMON_TIMED_DESPAWN, 13000);
|
||||
Creature* Trigger = m_creature->SummonTrigger(initial.x, initial.y, initial.z, 0, 13000);
|
||||
if(!Trigger) return;
|
||||
|
||||
((demonfireAI*)Trigger->AI())->IsTrigger = true;
|
||||
Trigger->SetSpeed(MOVE_WALK, 3);
|
||||
Trigger->SetUnitMovementFlags(MOVEMENTFLAG_WALK_MODE);
|
||||
Trigger->GetMotionMaster()->MovePoint(0, final.x, final.y, final.z);
|
||||
|
||||
Trigger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
//Trigger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
m_creature->SetUInt64Value(UNIT_FIELD_TARGET, Trigger->GetGUID());
|
||||
DoCast(Trigger, SPELL_EYE_BLAST);
|
||||
}
|
||||
@@ -2225,11 +2160,6 @@ CreatureAI* GetAI_shadow_demon(Creature *_Creature)
|
||||
return new shadow_demonAI (_Creature);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_demonfire(Creature *_Creature)
|
||||
{
|
||||
return new demonfireAI (_Creature);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_blade_of_azzinoth(Creature *_Creature)
|
||||
{
|
||||
return new blade_of_azzinothAI (_Creature);
|
||||
@@ -2286,11 +2216,6 @@ void AddSC_boss_illidan()
|
||||
newscript->GetAI = GetAI_shadow_demon;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name="mob_demon_fire";
|
||||
newscript->GetAI = GetAI_demonfire;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "mob_parasitic_shadowfiend";
|
||||
newscript->GetAI = GetAI_parasitic_shadowfiend;
|
||||
|
||||
@@ -79,44 +79,11 @@ struct TRINITY_DLL_DECL boss_broggokAI : public ScriptedAI
|
||||
}
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL mob_broggok_poisoncloudAI : public ScriptedAI
|
||||
{
|
||||
mob_broggok_poisoncloudAI(Creature *c) : ScriptedAI(c) {Reset();}
|
||||
|
||||
bool Start;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
Start = false;
|
||||
}
|
||||
|
||||
void Aggro(Unit* who)
|
||||
{
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if(!Start)
|
||||
{
|
||||
m_creature->SetUInt32Value(UNIT_NPC_FLAGS,0);
|
||||
m_creature->setFaction(45);
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
Start = true;
|
||||
DoCast(m_creature,SPELL_POISON);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_broggokAI(Creature *_Creature)
|
||||
{
|
||||
return new boss_broggokAI (_Creature);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_mob_broggok_poisoncloudAI(Creature *_Creature)
|
||||
{
|
||||
return new mob_broggok_poisoncloudAI (_Creature);
|
||||
}
|
||||
|
||||
void AddSC_boss_broggok()
|
||||
{
|
||||
Script *newscript;
|
||||
@@ -124,9 +91,4 @@ void AddSC_boss_broggok()
|
||||
newscript->Name="boss_broggok";
|
||||
newscript->GetAI = GetAI_boss_broggokAI;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name="mob_broggok_poisoncloud";
|
||||
newscript->GetAI = GetAI_mob_broggok_poisoncloudAI;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
|
||||
@@ -25,7 +25,6 @@ EndScriptData */
|
||||
|
||||
#include "precompiled.h"
|
||||
#include "def_zulaman.h"
|
||||
#include "Spell.h"
|
||||
#include "Weather.h"
|
||||
|
||||
#define SPELL_STATIC_DISRUPTION 43622
|
||||
@@ -34,6 +33,7 @@ EndScriptData */
|
||||
#define SPELL_GUST_OF_WIND 43621
|
||||
#define SPELL_ELECTRICAL_STORM 43648
|
||||
#define SPELL_BERSERK 45078
|
||||
#define SPELL_ELECTRICAL_DAMAGE 43657
|
||||
#define SPELL_ELECTRICAL_OVERLOAD 43658
|
||||
#define SPELL_EAGLE_SWOOP 44732
|
||||
|
||||
@@ -57,15 +57,13 @@ EndScriptData */
|
||||
#define SE_LOC_Y_MAX 1435
|
||||
#define SE_LOC_Y_MIN 1370
|
||||
|
||||
#define MOB_TEMP_TRIGGER 23920
|
||||
|
||||
struct TRINITY_DLL_DECL boss_akilzonAI : public ScriptedAI
|
||||
{
|
||||
boss_akilzonAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_ELECTRICAL_STORM);
|
||||
SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_ELECTRICAL_DAMAGE);
|
||||
if(TempSpell)
|
||||
TempSpell->Effect[1] = 0;//disable bugged lightning until fixed in core
|
||||
TempSpell->EffectBasePoints[1] = 49;//disable bugged lightning until fixed in core
|
||||
pInstance = ((ScriptedInstance*)c->GetInstanceData());
|
||||
Reset();
|
||||
}
|
||||
@@ -214,7 +212,7 @@ struct TRINITY_DLL_DECL boss_akilzonAI : public ScriptedAI
|
||||
{
|
||||
x = 343+rand()%60;
|
||||
y = 1380+rand()%60;
|
||||
if(Unit *trigger = m_creature->SummonCreature(MOB_TEMP_TRIGGER, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN, 2000))
|
||||
if(Unit *trigger = m_creature->SummonTrigger(x, y, z, 0, 2000))
|
||||
{
|
||||
trigger->setFaction(35);
|
||||
trigger->SetMaxHealth(100000);
|
||||
@@ -315,7 +313,7 @@ struct TRINITY_DLL_DECL boss_akilzonAI : public ScriptedAI
|
||||
target->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
|
||||
target->SendMonsterMove(x,y,m_creature->GetPositionZ()+15,0,0,0);
|
||||
}
|
||||
Unit *Cloud = m_creature->SummonCreature(MOB_TEMP_TRIGGER, x, y, m_creature->GetPositionZ()+16, 0, TEMPSUMMON_TIMED_DESPAWN, 15000);
|
||||
Unit *Cloud = m_creature->SummonTrigger(x, y, m_creature->GetPositionZ()+16, 0, 15000);
|
||||
if(Cloud)
|
||||
{
|
||||
CloudGUID = Cloud->GetGUID();
|
||||
|
||||
@@ -226,9 +226,9 @@ struct TRINITY_DLL_DECL boss_janalaiAI : public ScriptedAI
|
||||
for(uint8 j = 0; j < WallNum; j++)
|
||||
{
|
||||
if(WallNum == 3)
|
||||
wall = m_creature->SummonCreature(MOB_FIRE_BOMB, FireWallCoords[i][0],FireWallCoords[i][1]+5*(j-1),FireWallCoords[i][2],FireWallCoords[i][3],TEMPSUMMON_TIMED_DESPAWN,15000);
|
||||
wall = m_creature->SummonTrigger(FireWallCoords[i][0],FireWallCoords[i][1]+5*(j-1),FireWallCoords[i][2],FireWallCoords[i][3],15000);
|
||||
else
|
||||
wall = m_creature->SummonCreature(MOB_FIRE_BOMB, FireWallCoords[i][0]-2+4*j,FireWallCoords[i][1],FireWallCoords[i][2],FireWallCoords[i][3],TEMPSUMMON_TIMED_DESPAWN,15000);
|
||||
wall = m_creature->SummonTrigger(FireWallCoords[i][0]-2+4*j,FireWallCoords[i][1],FireWallCoords[i][2],FireWallCoords[i][3],15000);
|
||||
if(wall) wall->CastSpell(wall, SPELL_FIRE_WALL, true);
|
||||
}
|
||||
}
|
||||
@@ -683,14 +683,9 @@ CreatureAI* GetAI_mob_hatchlingAI(Creature *_Creature)
|
||||
return new mob_hatchlingAI(_Creature);
|
||||
}
|
||||
|
||||
struct TRINITY_DLL_DECL mob_eggAI : public ScriptedAI
|
||||
struct TRINITY_DLL_DECL mob_eggAI : public NullCreatureAI
|
||||
{
|
||||
mob_eggAI(Creature *c) : ScriptedAI(c){}
|
||||
void Reset() {}
|
||||
void Aggro(Unit* who) {}
|
||||
void AttackStart(Unit* who) {}
|
||||
void MoveInLineOfSight(Unit* who) {}
|
||||
void UpdateAI(const uint32 diff) {}
|
||||
mob_eggAI(Creature *c) : NullCreatureAI(c){}
|
||||
|
||||
void SpellHit(Unit *caster, const SpellEntry *spell)
|
||||
{
|
||||
|
||||
@@ -546,23 +546,15 @@ struct TRINITY_DLL_DECL boss_zuljinAI : public ScriptedAI
|
||||
if(Pillar_Of_Fire_Timer < diff)
|
||||
{
|
||||
if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
{
|
||||
float x, y, z;
|
||||
target->GetPosition(x, y, z);
|
||||
Creature* Pillar = m_creature->SummonCreature(CREATURE_COLUMN_OF_FIRE, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN, 30000);
|
||||
if(Pillar)
|
||||
{
|
||||
Pillar->CastSpell(Pillar, SPELL_PILLAR_TRIGGER, true);
|
||||
Pillar->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
}
|
||||
DoCast(target, SPELL_SUMMON_PILLAR);
|
||||
Pillar_Of_Fire_Timer = 10000;
|
||||
}else Pillar_Of_Fire_Timer -= diff;
|
||||
|
||||
if(Flame_Breath_Timer < diff)
|
||||
{
|
||||
if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
m_creature->CastSpell(m_creature, SPELL_FLAME_BREATH, false);
|
||||
m_creature->SetInFront(target);
|
||||
DoCast(m_creature, SPELL_FLAME_BREATH);
|
||||
Flame_Breath_Timer = 10000;
|
||||
}else Flame_Breath_Timer -= diff;
|
||||
break;
|
||||
@@ -581,21 +573,6 @@ CreatureAI* GetAI_boss_zuljin(Creature *_Creature)
|
||||
return new boss_zuljinAI (_Creature);
|
||||
}
|
||||
|
||||
struct TRINITY_DLL_DECL do_nothingAI : public ScriptedAI
|
||||
{
|
||||
do_nothingAI(Creature *c) : ScriptedAI(c) {}
|
||||
void Reset() {}
|
||||
void Aggro(Unit* who) {}
|
||||
void AttackStart(Unit* who) {}
|
||||
void MoveInLineOfSight(Unit* who) {}
|
||||
void UpdateAI(const uint32 diff) {}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_do_nothing(Creature *_Creature)
|
||||
{
|
||||
return new do_nothingAI (_Creature);
|
||||
}
|
||||
|
||||
struct TRINITY_DLL_DECL feather_vortexAI : public ScriptedAI
|
||||
{
|
||||
feather_vortexAI(Creature *c) : ScriptedAI(c) {}
|
||||
@@ -631,11 +608,6 @@ void AddSC_boss_zuljin()
|
||||
newscript->GetAI = GetAI_boss_zuljin;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name="do_nothing";
|
||||
newscript->GetAI = GetAI_do_nothing;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name="mob_zuljin_vortex";
|
||||
newscript->GetAI = GetAI_feather_vortexAI;
|
||||
|
||||
@@ -347,10 +347,10 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData *data )
|
||||
m_spells[3] = GetCreatureInfo()->spell4;
|
||||
|
||||
// HACK: trigger creature is always not selectable
|
||||
if(GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_TRIGGER)
|
||||
if(isTrigger())
|
||||
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
|
||||
if(isTotem() || GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_TRIGGER
|
||||
if(isTotem() || isTrigger()
|
||||
|| GetCreatureType() == CREATURE_TYPE_CRITTER)
|
||||
SetReactState(REACT_PASSIVE);
|
||||
else if(isCivilian())
|
||||
@@ -563,7 +563,7 @@ void Creature::RegenerateHealth()
|
||||
ModifyHealth(addvalue);
|
||||
}
|
||||
|
||||
bool Creature::AIM_Initialize()
|
||||
bool Creature::AIM_Initialize(CreatureAI* ai)
|
||||
{
|
||||
// make sure nothing can change the AI during AI update
|
||||
if(m_AI_locked)
|
||||
@@ -578,7 +578,7 @@ bool Creature::AIM_Initialize()
|
||||
|
||||
CreatureAI * oldAI = i_AI;
|
||||
i_motionMaster.Initialize();
|
||||
i_AI = FactorySelector::selectAI(this);
|
||||
i_AI = ai ? ai : FactorySelector::selectAI(this);
|
||||
if (oldAI)
|
||||
delete oldAI;
|
||||
return true;
|
||||
|
||||
@@ -426,6 +426,7 @@ class TRINITY_DLL_SPEC Creature : public Unit
|
||||
bool isTotem() const { return m_isTotem; }
|
||||
bool isRacialLeader() const { return GetCreatureInfo()->RacialLeader; }
|
||||
bool isCivilian() const { return GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_CIVILIAN; }
|
||||
bool isTrigger() const { return GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_TRIGGER; }
|
||||
bool canWalk() const { return GetCreatureInfo()->InhabitType & INHABIT_GROUND; }
|
||||
bool canSwim() const { return GetCreatureInfo()->InhabitType & INHABIT_WATER; }
|
||||
bool canFly() const { return GetCreatureInfo()->InhabitType & INHABIT_AIR; }
|
||||
@@ -462,7 +463,7 @@ class TRINITY_DLL_SPEC Creature : public Unit
|
||||
|
||||
bool IsInEvadeMode() const;
|
||||
|
||||
bool AIM_Initialize();
|
||||
bool AIM_Initialize(CreatureAI* ai = NULL);
|
||||
void InitPossessedAI();
|
||||
void DisablePossessedAI();
|
||||
|
||||
|
||||
@@ -1277,7 +1277,7 @@ void GameObject::Use(Unit* user)
|
||||
void GameObject::CastSpell(Unit* target, uint32 spell)
|
||||
{
|
||||
//summon world trigger
|
||||
Creature *trigger = SummonCreature(12999, GetPositionX(), GetPositionY(), GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 1);
|
||||
Creature *trigger = SummonTrigger(GetPositionX(), GetPositionY(), GetPositionZ(), 0, 1);
|
||||
if(!trigger) return;
|
||||
|
||||
trigger->SetVisibility(VISIBILITY_OFF); //should this be true?
|
||||
|
||||
@@ -1534,6 +1534,25 @@ GameObject* WorldObject::SummonGameObject(uint32 entry, float x, float y, float
|
||||
return go;
|
||||
}
|
||||
|
||||
Creature* WorldObject::SummonTrigger(float x, float y, float z, float ang, uint32 duration, CreatureAI* (*GetAI)(Creature*))
|
||||
{
|
||||
TempSummonType summonType = (duration == 0) ? TEMPSUMMON_DEAD_DESPAWN : TEMPSUMMON_TIMED_DESPAWN;
|
||||
Creature* summon = SummonCreature(WORLD_TRIGGER, x, y, z, ang, summonType, 0);
|
||||
if(!summon)
|
||||
return NULL;
|
||||
|
||||
//summon->SetName(GetName());
|
||||
if(GetTypeId()==TYPEID_PLAYER || GetTypeId()==TYPEID_UNIT)
|
||||
{
|
||||
summon->setFaction(((Unit*)this)->getFaction());
|
||||
summon->SetLevel(((Unit*)this)->getLevel());
|
||||
}
|
||||
|
||||
if(GetAI)
|
||||
summon->AIM_Initialize(GetAI(summon));
|
||||
return summon;
|
||||
}
|
||||
|
||||
void WorldObject::GetNearPoint2D(float &x, float &y, float distance2d, float absAngle ) const
|
||||
{
|
||||
x = GetPositionX() + (GetObjectSize() + distance2d) * cos(absAngle);
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "GameSystem/GridReference.h"
|
||||
#include "ObjectDefines.h"
|
||||
#include "GridDefines.h"
|
||||
#include "CreatureAI.h"
|
||||
|
||||
#include <set>
|
||||
#include <string>
|
||||
@@ -457,6 +458,7 @@ class TRINITY_DLL_SPEC WorldObject : public Object
|
||||
Map const* GetBaseMap() const;
|
||||
Creature* SummonCreature(uint32 id, float x, float y, float z, float ang,TempSummonType spwtype,uint32 despwtime);
|
||||
GameObject* SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime);
|
||||
Creature* SummonTrigger(float x, float y, float z, float ang, uint32 dur, CreatureAI* (*GetAI)(Creature*) = NULL);
|
||||
bool isActive() const { return m_isActive; }
|
||||
void setActive(bool isActive);
|
||||
protected:
|
||||
|
||||
@@ -2079,6 +2079,13 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// electrical storm safe zone
|
||||
if (GetId() == 44007)
|
||||
{
|
||||
m_target->ApplySpellImmune(44007, IMMUNITY_ID, 43657, apply);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SPELLFAMILY_MAGE:
|
||||
|
||||
@@ -37,6 +37,8 @@
|
||||
#include "Database/DBCStructure.h"
|
||||
#include <list>
|
||||
|
||||
#define WORLD_TRIGGER 12999
|
||||
|
||||
enum SpellInterruptFlags
|
||||
{
|
||||
SPELL_INTERRUPT_FLAG_MOVEMENT = 0x01, // why need this for instant?
|
||||
|
||||
Reference in New Issue
Block a user