Merge [SD2]
r1106 Prevent abuse of item 44222. Apply some SD2 code style r1107 Add health modification for phase and correct phase value for kael(TK) r1108 Remove scripted function SetSheathState() and use mangos function instead. Fix one typo and apply sd2 code style for one script. r1109 Remove old makefile* files not needed. r1110 Some minor adjustments to sharkkis, add one spell and also add distance to MoveChase. Not kill boss' advisors on Reset when not needed. r1111 Check pointers and avoid possible crash r1112 Added script for friendly Kael in MgT (movement to orb-platform, transform and gossip) r1113 Correct misunderstanding added in 1112, and use timer for transformation instead (creature are expected to spawn/fly down once player use orb). --HG-- branch : trunk
This commit is contained in:
@@ -208,6 +208,7 @@ SET(trinityscript_LIB_SRCS
|
||||
scripts/zone/magisters_terrace/boss_vexallus.cpp
|
||||
scripts/zone/magisters_terrace/def_magisters_terrace.h
|
||||
scripts/zone/magisters_terrace/instance_magisters_terrace.cpp
|
||||
scripts/zone/magisters_terrace/magisters_terrace.cpp
|
||||
scripts/zone/maraudon/boss_celebras_the_cursed.cpp
|
||||
scripts/zone/maraudon/boss_landslide.cpp
|
||||
scripts/zone/maraudon/boss_noxxion.cpp
|
||||
|
||||
@@ -356,6 +356,7 @@ extern void AddSC_boss_selin_fireheart();
|
||||
extern void AddSC_boss_vexallus();
|
||||
extern void AddSC_boss_priestess_delrissa();
|
||||
extern void AddSC_instance_magisters_terrace();
|
||||
extern void AddSC_magisters_terrace();
|
||||
|
||||
//Maraudon
|
||||
extern void AddSC_boss_celebras_the_cursed();
|
||||
@@ -1260,6 +1261,7 @@ void ScriptsInit(char const* cfg_file = "trinitycore.conf")
|
||||
AddSC_boss_vexallus();
|
||||
AddSC_boss_priestess_delrissa();
|
||||
AddSC_instance_magisters_terrace();
|
||||
AddSC_magisters_terrace();
|
||||
|
||||
//Maraudon
|
||||
AddSC_boss_celebras_the_cursed();
|
||||
|
||||
@@ -1102,6 +1102,10 @@
|
||||
RelativePath="..\scripts\zone\magisters_terrace\instance_magisters_terrace.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\zone\magisters_terrace\magisters_terrace.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Loch Modan"
|
||||
|
||||
@@ -1103,6 +1103,10 @@
|
||||
RelativePath="..\scripts\zone\magisters_terrace\instance_magisters_terrace.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\zone\magisters_terrace\magisters_terrace.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Loch Modan"
|
||||
|
||||
@@ -572,11 +572,6 @@ void ScriptedAI::SetEquipmentSlots(bool bLoadDefault, int32 uiMainHand, int32 ui
|
||||
m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, uint32(uiRanged));
|
||||
}
|
||||
|
||||
void ScriptedAI::SetSheathState(SheathState newState)
|
||||
{
|
||||
m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, newState);
|
||||
}
|
||||
|
||||
void ScriptedAI::SetCombatMovement(bool CombatMove)
|
||||
{
|
||||
CombatMovement = CombatMove;
|
||||
|
||||
@@ -189,8 +189,6 @@ struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI
|
||||
bool CanCast(Unit* Target, SpellEntry const *Spell, bool Triggered = false);
|
||||
|
||||
void SetEquipmentSlots(bool bLoadDefault, int32 uiMainHand = EQUIP_NO_CHANGE, int32 uiOffHand = EQUIP_NO_CHANGE, int32 uiRanged = EQUIP_NO_CHANGE);
|
||||
|
||||
void SetSheathState(SheathState newState);
|
||||
|
||||
void SetCombatMovement(bool CombatMove);
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ EndScriptData */
|
||||
item_area_52_special(i28132) Prevents abuse of this item
|
||||
item_attuned_crystal_cores(i34368) Prevent abuse(quest 11524 & 11525)
|
||||
item_blackwhelp_net(i31129) Quest Whelps of the Wyrmcult (q10747). Prevents abuse
|
||||
item_dart_gun Prevent quest provided item instakill anything but the expected
|
||||
item_draenei_fishing_net(i23654) Hacklike implements chance to spawn item or creature
|
||||
item_disciplinary_rod Prevents abuse
|
||||
item_nether_wraith_beacon(i31742) Summons creatures for quest Becoming a Spellfire Tailor (q10832)
|
||||
@@ -129,6 +130,25 @@ bool ItemUse_item_blackwhelp_net(Player *player, Item* _Item, SpellCastTargets c
|
||||
return true;
|
||||
}
|
||||
|
||||
/*#####
|
||||
# item_dart_gun
|
||||
#####*/
|
||||
|
||||
enum
|
||||
{
|
||||
NPC_HAMMER_SCOUT = 32201
|
||||
};
|
||||
|
||||
bool ItemUse_item_dart_gun(Player* pPlayer, Item* pItem, const SpellCastTargets &pTargets)
|
||||
{
|
||||
if (pTargets.getUnitTarget() && pTargets.getUnitTarget()->GetTypeId() == TYPEID_UNIT &&
|
||||
pTargets.getUnitTarget()->GetEntry() == NPC_HAMMER_SCOUT)
|
||||
return false;
|
||||
|
||||
pPlayer->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pItem, NULL);
|
||||
return true;
|
||||
}
|
||||
|
||||
/*#####
|
||||
# item_draenei_fishing_net
|
||||
#####*/
|
||||
@@ -530,6 +550,11 @@ void AddSC_item_scripts()
|
||||
newscript->pItemUse = &ItemUse_item_blackwhelp_net;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "item_dart_gun";
|
||||
newscript->pItemUse = &ItemUse_item_dart_gun;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name="item_disciplinary_rod";
|
||||
newscript->pItemUse = &ItemUse_item_disciplinary_rod;
|
||||
|
||||
@@ -144,7 +144,7 @@ float KaelthasWeapons[7][5] =
|
||||
#define GRAVITY_Z 70.0f
|
||||
|
||||
#define TIME_PHASE_2_3 120000
|
||||
#define TIME_PHASE_3_4 120000
|
||||
#define TIME_PHASE_3_4 180000
|
||||
|
||||
#define KAEL_VISIBLE_RANGE 50.0f
|
||||
#define ROOM_BASE_Z 49.0f
|
||||
@@ -160,6 +160,7 @@ struct TRINITY_DLL_DECL advisorbase_ai : public ScriptedAI
|
||||
advisorbase_ai(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
FakeDeath = false;
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit *who)
|
||||
@@ -180,6 +181,9 @@ struct TRINITY_DLL_DECL advisorbase_ai : public ScriptedAI
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if (FakeDeath)
|
||||
m_creature->SetMaxHealth(m_creature->GetMaxHealth() / 2);
|
||||
|
||||
m_creature->SetNoCallAssistance(true);
|
||||
FakeDeath = false;
|
||||
DelayRes_Timer = 0;
|
||||
@@ -238,7 +242,10 @@ struct TRINITY_DLL_DECL advisorbase_ai : public ScriptedAI
|
||||
m_creature->SetUInt64Value(UNIT_FIELD_TARGET,0);
|
||||
m_creature->GetMotionMaster()->Clear();
|
||||
m_creature->GetMotionMaster()->MoveIdle();
|
||||
m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,UNIT_STAND_STATE_DEAD);
|
||||
m_creature->SetStandState(UNIT_STAND_STATE_DEAD);
|
||||
|
||||
// Double health for Phase 3
|
||||
m_creature->SetMaxHealth(m_creature->GetMaxHealth() * 2);
|
||||
|
||||
if (pInstance->GetData(DATA_KAELTHASEVENT) == 3)
|
||||
JustDied(pKiller);
|
||||
|
||||
@@ -84,24 +84,23 @@ struct TRINITY_DLL_DECL npc_daphne_stilwellAI : public npc_escortAI
|
||||
{
|
||||
case 4:
|
||||
SetEquipmentSlots(false, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE, EQUIP_ID_RIFLE);
|
||||
SetSheathState(SHEATH_STATE_RANGED);
|
||||
m_creature->SetSheath(SHEATH_STATE_RANGED);
|
||||
m_creature->HandleEmoteCommand(EMOTE_STATE_USESTANDING_NOSHEATHE);
|
||||
break;
|
||||
case 6:
|
||||
SetCombatMovement(false);
|
||||
break;
|
||||
case 7:
|
||||
m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11450.836, 1569.755, 54.267, 4.230, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
|
||||
m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11449.697, 1569.124, 54.421, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
|
||||
m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11448.237, 1568.307, 54.620, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
|
||||
break;
|
||||
case 8:
|
||||
m_creature->SetSheath(SHEATH_STATE_RANGED);
|
||||
m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11450.836, 1569.755, 54.267, 4.230, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
|
||||
m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11449.697, 1569.124, 54.421, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
|
||||
m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11448.237, 1568.307, 54.620, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
|
||||
m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11448.037, 1570.213, 54.961, 4.283, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
|
||||
break;
|
||||
case 9:
|
||||
m_creature->SetSheath(SHEATH_STATE_RANGED);
|
||||
m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11450.836, 1569.755, 54.267, 4.230, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
|
||||
m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11449.697, 1569.124, 54.421, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
|
||||
m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11448.237, 1568.307, 54.620, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
|
||||
@@ -115,9 +114,9 @@ struct TRINITY_DLL_DECL npc_daphne_stilwellAI : public npc_escortAI
|
||||
DoScriptText(SAY_DS_PROLOGUE, m_creature);
|
||||
break;
|
||||
case 13:
|
||||
SetSheathState(SHEATH_STATE_UNARMED);
|
||||
m_creature->HandleEmoteCommand(EMOTE_STATE_USESTANDING_NOSHEATHE);
|
||||
SetEquipmentSlots(true);
|
||||
m_creature->SetSheath(SHEATH_STATE_UNARMED);
|
||||
m_creature->HandleEmoteCommand(EMOTE_STATE_USESTANDING_NOSHEATHE);
|
||||
break;
|
||||
case 17:
|
||||
pPlayer->GroupEventHappens(QUEST_TOME_VALOR, m_creature);
|
||||
@@ -125,6 +124,21 @@ struct TRINITY_DLL_DECL npc_daphne_stilwellAI : public npc_escortAI
|
||||
}
|
||||
}
|
||||
|
||||
void AttackStart(Unit* pWho)
|
||||
{
|
||||
if (!pWho)
|
||||
return;
|
||||
|
||||
if (m_creature->Attack(pWho, false))
|
||||
{
|
||||
m_creature->AddThreat(pWho, 0.0f);
|
||||
m_creature->SetInCombatWith(pWho);
|
||||
pWho->SetInCombatWith(m_creature);
|
||||
|
||||
m_creature->GetMotionMaster()->MoveChase(pWho, 30.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* pSummoned)
|
||||
{
|
||||
pSummoned->AI()->AttackStart(m_creature);
|
||||
@@ -148,14 +162,10 @@ struct TRINITY_DLL_DECL npc_daphne_stilwellAI : public npc_escortAI
|
||||
|
||||
if (uiShootTimer < diff)
|
||||
{
|
||||
if (m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
|
||||
SetCombatMovement(true);
|
||||
else
|
||||
SetCombatMovement(false);
|
||||
|
||||
uiShootTimer = 1500;
|
||||
|
||||
DoCast(m_creature->getVictim(), SPELL_SHOOT);
|
||||
if (!m_creature->IsWithinDist(m_creature->getVictim(), ATTACK_DISTANCE))
|
||||
DoCast(m_creature->getVictim(), SPELL_SHOOT);
|
||||
}else uiShootTimer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -117,8 +117,7 @@ struct TRINITY_DLL_DECL boss_thekalAI : public ScriptedAI
|
||||
if(pInstance->GetData(DATA_LORKHANISDEAD))
|
||||
{
|
||||
//Resurrect LorKhan
|
||||
Unit *pLorKhan = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_LORKHAN));
|
||||
if(pLorKhan)
|
||||
if(Unit *pLorKhan = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_LORKHAN)))
|
||||
{
|
||||
pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
|
||||
pLorKhan->setFaction(14);
|
||||
@@ -336,8 +335,7 @@ struct TRINITY_DLL_DECL mob_zealot_lorkhanAI : public ScriptedAI
|
||||
if(pInstance->GetData(DATA_THEKALISFAKEDEAD))
|
||||
{
|
||||
//Resurrect Thekal
|
||||
Unit *pThekal = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THEKAL));
|
||||
if(pThekal)
|
||||
if(Unit *pThekal = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THEKAL)))
|
||||
{
|
||||
pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
|
||||
pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
@@ -349,8 +347,7 @@ struct TRINITY_DLL_DECL mob_zealot_lorkhanAI : public ScriptedAI
|
||||
if(pInstance->GetData(DATA_ZATHISDEAD))
|
||||
{
|
||||
//Resurrect Zath
|
||||
Unit *pZath = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ZATH));
|
||||
if(pZath)
|
||||
if(Unit *pZath = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ZATH)))
|
||||
{
|
||||
pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
|
||||
pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
@@ -473,8 +470,7 @@ struct TRINITY_DLL_DECL mob_zealot_zathAI : public ScriptedAI
|
||||
if(pInstance->GetData(DATA_LORKHANISDEAD))
|
||||
{
|
||||
//Resurrect LorKhan
|
||||
Unit *pLorKhan = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_LORKHAN));
|
||||
if(pLorKhan)
|
||||
if(Unit *pLorKhan = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_LORKHAN)))
|
||||
{
|
||||
pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
|
||||
pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
@@ -486,8 +482,7 @@ struct TRINITY_DLL_DECL mob_zealot_zathAI : public ScriptedAI
|
||||
if(pInstance->GetData(DATA_THEKALISFAKEDEAD))
|
||||
{
|
||||
//Resurrect Thekal
|
||||
Unit *pThekal = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THEKAL));
|
||||
if(pThekal)
|
||||
if(Unit *pThekal = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THEKAL)))
|
||||
{
|
||||
pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
|
||||
pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
|
||||
Reference in New Issue
Block a user