aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKudlaty <none@none>2009-07-25 22:16:21 +0200
committerKudlaty <none@none>2009-07-25 22:16:21 +0200
commitd62da4cc16c3498674450d5751d18bbe9f9b4f6f (patch)
tree71be3f8b7359fcb7618bdea73687f5c8e1ed3a4e
parent96f814ea20b6ba5932bf635e6a78b5e7a2e68597 (diff)
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
-rw-r--r--sql/FULL/world_scripts_full.sql2
-rw-r--r--src/bindings/scripts/CMakeLists.txt1
-rw-r--r--src/bindings/scripts/ScriptMgr.cpp2
-rw-r--r--src/bindings/scripts/VC80/80ScriptDev2.vcproj4
-rw-r--r--src/bindings/scripts/VC90/90ScriptDev2.vcproj4
-rw-r--r--src/bindings/scripts/include/sc_creature.cpp5
-rw-r--r--src/bindings/scripts/include/sc_creature.h2
-rw-r--r--src/bindings/scripts/scripts/item/item_scripts.cpp25
-rw-r--r--src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp11
-rw-r--r--src/bindings/scripts/scripts/zone/westfall/westfall.cpp34
-rw-r--r--src/bindings/scripts/scripts/zone/zulgurub/boss_thekal.cpp15
11 files changed, 74 insertions, 31 deletions
diff --git a/sql/FULL/world_scripts_full.sql b/sql/FULL/world_scripts_full.sql
index 71d430a6f02..02b7159d570 100644
--- a/sql/FULL/world_scripts_full.sql
+++ b/sql/FULL/world_scripts_full.sql
@@ -64,6 +64,7 @@ UPDATE `creature_template` SET `ScriptName`='guard_shattrath_scryer' WHERE `entr
UPDATE `item_template` SET `ScriptName`='item_area_52_special' WHERE `entry`=28132;
UPDATE `item_template` SET `ScriptName`='item_attuned_crystal_cores' WHERE `entry`=34368;
UPDATE `item_template` SET `ScriptName`='item_blackwhelp_net' WHERE `entry`=31129;
+UPDATE `item_template` SET `ScriptName`='item_dart_gun' WHERE `entry`=44222;
UPDATE `item_template` SET `ScriptName`='item_disciplinary_rod' WHERE `entry`=22473;
UPDATE `item_template` SET `ScriptName`='item_draenei_fishing_net' WHERE `entry`=23654;
UPDATE `item_template` SET `ScriptName`='item_flying_machine' WHERE `entry` IN (34060,34061);
@@ -615,6 +616,7 @@ UPDATE `creature_template` SET `ScriptName`='mob_arcane_sphere' WHERE `entry`=24
UPDATE `creature_template` SET `ScriptName`='mob_felkael_phoenix' WHERE `entry`=24674;
UPDATE `creature_template` SET `ScriptName`='mob_felkael_phoenix_egg' WHERE `entry`=24675;
UPDATE `creature_template` SET `ScriptName`='mob_felkael_flamestrike' WHERE `entry`=24666;
+UPDATE `creature_template` SET `ScriptName`='npc_kalecgos' WHERE `entry` IN (24844, 24848);
/* MARAUDON */
UPDATE `creature_template` SET `ScriptName`='boss_princess_theradras' WHERE `entry`=12201;
diff --git a/src/bindings/scripts/CMakeLists.txt b/src/bindings/scripts/CMakeLists.txt
index 3dcd38fa256..6fe9c0e1ec0 100644
--- a/src/bindings/scripts/CMakeLists.txt
+++ b/src/bindings/scripts/CMakeLists.txt
@@ -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
diff --git a/src/bindings/scripts/ScriptMgr.cpp b/src/bindings/scripts/ScriptMgr.cpp
index a7a57818df7..f81edfdfb01 100644
--- a/src/bindings/scripts/ScriptMgr.cpp
+++ b/src/bindings/scripts/ScriptMgr.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();
diff --git a/src/bindings/scripts/VC80/80ScriptDev2.vcproj b/src/bindings/scripts/VC80/80ScriptDev2.vcproj
index a615d579f4c..53a1624820c 100644
--- a/src/bindings/scripts/VC80/80ScriptDev2.vcproj
+++ b/src/bindings/scripts/VC80/80ScriptDev2.vcproj
@@ -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"
diff --git a/src/bindings/scripts/VC90/90ScriptDev2.vcproj b/src/bindings/scripts/VC90/90ScriptDev2.vcproj
index effb6e84d13..1b8d6f0638e 100644
--- a/src/bindings/scripts/VC90/90ScriptDev2.vcproj
+++ b/src/bindings/scripts/VC90/90ScriptDev2.vcproj
@@ -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"
diff --git a/src/bindings/scripts/include/sc_creature.cpp b/src/bindings/scripts/include/sc_creature.cpp
index 6083e4d4af5..c80f55fc0f5 100644
--- a/src/bindings/scripts/include/sc_creature.cpp
+++ b/src/bindings/scripts/include/sc_creature.cpp
@@ -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;
diff --git a/src/bindings/scripts/include/sc_creature.h b/src/bindings/scripts/include/sc_creature.h
index 7c57367332a..666ec1fad44 100644
--- a/src/bindings/scripts/include/sc_creature.h
+++ b/src/bindings/scripts/include/sc_creature.h
@@ -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);
diff --git a/src/bindings/scripts/scripts/item/item_scripts.cpp b/src/bindings/scripts/scripts/item/item_scripts.cpp
index d30efdae89f..a58edb58fa2 100644
--- a/src/bindings/scripts/scripts/item/item_scripts.cpp
+++ b/src/bindings/scripts/scripts/item/item_scripts.cpp
@@ -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)
@@ -130,6 +131,25 @@ bool ItemUse_item_blackwhelp_net(Player *player, Item* _Item, SpellCastTargets c
}
/*#####
+# 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
#####*/
@@ -531,6 +551,11 @@ void AddSC_item_scripts()
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;
newscript->RegisterSelf();
diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp
index 1ebf18efa94..b33a3030e1d 100644
--- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp
+++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp
@@ -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);
diff --git a/src/bindings/scripts/scripts/zone/westfall/westfall.cpp b/src/bindings/scripts/scripts/zone/westfall/westfall.cpp
index f9e04a5186f..3548e9ee089 100644
--- a/src/bindings/scripts/scripts/zone/westfall/westfall.cpp
+++ b/src/bindings/scripts/scripts/zone/westfall/westfall.cpp
@@ -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;
}
};
diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_thekal.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_thekal.cpp
index 76d3d5268e9..5cd5fc61d8f 100644
--- a/src/bindings/scripts/scripts/zone/zulgurub/boss_thekal.cpp
+++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_thekal.cpp
@@ -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);