mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Scripts/Icecrown Citadel: Added Teleporter script
Scripts/Icecrown Citadel: Implemented achievements for Deathbringer Saurfang --HG-- branch : trunk
This commit is contained in:
@@ -829,6 +829,7 @@ UPDATE `creature_template` SET `ScriptName`='npc_guardian_pavilion' WHERE `entry
|
||||
|
||||
/* ICECROWN CITADEL */
|
||||
UPDATE `instance_template` SET `script`='instance_icecrown_citadel' WHERE `map`=631;
|
||||
UPDATE `gameobject_template` SET `ScriptName`='icecrown_citadel_teleport' WHERE `entry` IN (202223,202235,202242,202243,202244,202245,202246);
|
||||
UPDATE `creature_template` SET `ScriptName`='boss_lord_marrowgar' WHERE `entry`=36612;
|
||||
UPDATE `creature_template` SET `ScriptName`='npc_coldflame' WHERE `entry`=36672;
|
||||
UPDATE `creature_template` SET `ScriptName`='npc_bone_spike' WHERE `entry`=36619;
|
||||
|
||||
1
sql/updates/9618_world_scriptname.sql
Normal file
1
sql/updates/9618_world_scriptname.sql
Normal file
@@ -0,0 +1 @@
|
||||
UPDATE `gameobject_template` SET `ScriptName`='icecrown_citadel_teleport' WHERE `entry` IN (202223,202235,202242,202243,202244,202245,202246);
|
||||
@@ -428,6 +428,7 @@ void AddSC_boss_marwyn();
|
||||
void AddSC_boss_lord_marrowgar(); // Icecrown Citadel
|
||||
void AddSC_boss_lady_deathwhisper();
|
||||
void AddSC_boss_deathbringer_saurfang();
|
||||
void AddSC_icecrown_citadel_teleport();
|
||||
void AddSC_instance_icecrown_citadel();
|
||||
|
||||
void AddSC_dalaran();
|
||||
@@ -1102,6 +1103,7 @@ void AddNorthrendScripts()
|
||||
AddSC_boss_lord_marrowgar(); // Icecrown Citadel
|
||||
AddSC_boss_lady_deathwhisper();
|
||||
AddSC_boss_deathbringer_saurfang();
|
||||
AddSC_icecrown_citadel_teleport();
|
||||
AddSC_instance_icecrown_citadel();
|
||||
|
||||
AddSC_dalaran();
|
||||
|
||||
@@ -102,7 +102,8 @@ enum eSpells
|
||||
SPELL_RESISTANT_SKIN = 72723,
|
||||
SPELL_SCENT_OF_BLOOD = 72769, // Heroic only
|
||||
|
||||
SPELL_RIDE_VEHICLE = 70640 // Outro
|
||||
SPELL_RIDE_VEHICLE = 70640, // Outro
|
||||
SPELL_ACHIEVEMENT = 72928
|
||||
};
|
||||
|
||||
// Helper to get id of the aura on different modes (HasAura(baseId) wont work)
|
||||
@@ -273,6 +274,7 @@ class boss_deathbringer_saurfang : public CreatureScript
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
DoCastAOE(SPELL_ACHIEVEMENT, true);
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
|
||||
if (pInstance)
|
||||
|
||||
@@ -83,6 +83,7 @@ enum eGameobjects
|
||||
DEATHBRINGER_S_CACHE_25N = 202240,
|
||||
DEATHBRINGER_S_CACHE_10H = 202238,
|
||||
DEATHBRINGER_S_CACHE_25H = 202241,
|
||||
SCOURGE_TRANSPORTER_SAURFANG = 202244,
|
||||
};
|
||||
|
||||
enum eAchievementCriteria
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2010 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "ScriptPCH.h"
|
||||
#include "icecrown_citadel.h"
|
||||
#include "Spell.h"
|
||||
|
||||
enum eSpellAction
|
||||
{
|
||||
LIGHT_S_HAMMER_TELEPORT = 70781,
|
||||
ORATORY_OF_THE_DAMNED_TELEPORT = 70856,
|
||||
RAMPART_OF_SKULLS_TELEPORT = 70857,
|
||||
DEATHBRINGER_S_RISE_TELEPORT = 70858,
|
||||
UPPER_SPIRE_TELEPORT = 70859,
|
||||
FROZEN_THRONE_TELEPORT = 70860,
|
||||
SINDRAGOSA_S_LAIR_TELEPORT = 70861
|
||||
};
|
||||
|
||||
#define GOSSIP_SENDER_ICC_PORT 631
|
||||
|
||||
class icecrown_citadel_teleport : public GameObjectScript
|
||||
{
|
||||
public:
|
||||
icecrown_citadel_teleport() : GameObjectScript("icecrown_citadel_teleport") { }
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* go)
|
||||
{
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Teleport to Light's Hammer.", GOSSIP_SENDER_ICC_PORT, LIGHT_S_HAMMER_TELEPORT);
|
||||
if (InstanceScript* pInstance = go->GetInstanceScript())
|
||||
{
|
||||
if (pInstance->GetData(DATA_LORD_MARROWGAR) == DONE)
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Teleport to the Oratory of the Damned.", GOSSIP_SENDER_ICC_PORT, ORATORY_OF_THE_DAMNED_TELEPORT);
|
||||
if (pInstance->GetData(DATA_LADY_DEATHWHISPER) == DONE)
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Teleport to the Rampart of Skulls.", GOSSIP_SENDER_ICC_PORT, RAMPART_OF_SKULLS_TELEPORT);
|
||||
if (pInstance->GetData(DATA_GUNSHIP_EVENT) == DONE)
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Teleport to the Deathbringer's Rise.", GOSSIP_SENDER_ICC_PORT, DEATHBRINGER_S_RISE_TELEPORT);
|
||||
if (pInstance->GetData(DATA_DEATHBRINGER_SAURFANG) == DONE)
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Teleport to the Upper Spire.", GOSSIP_SENDER_ICC_PORT, UPPER_SPIRE_TELEPORT);
|
||||
if (pInstance->GetData(DATA_VALITHRIA_DREAMWALKER) == DONE)
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Teleport to the Sindragosa's Lair", GOSSIP_SENDER_ICC_PORT, SINDRAGOSA_S_LAIR_TELEPORT);
|
||||
if (pInstance->GetData(DATA_PROFESSOR_PUTRICIDE) == DONE && pInstance->GetData(DATA_BLOOD_QUEEN_LANA_THEL) == DONE && pInstance->GetData(DATA_SINDRAGOSA) == DONE)
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Teleport to The Frozen Throne", GOSSIP_SENDER_ICC_PORT, FROZEN_THRONE_TELEPORT);
|
||||
}
|
||||
|
||||
player->SEND_GOSSIP_MENU(go->GetGOInfo()->GetGossipMenuId(), go->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, GameObject* go, uint32 sender, uint32 action)
|
||||
{
|
||||
SpellEntry const* spell = sSpellStore.LookupEntry(action);
|
||||
if (!spell)
|
||||
return false;
|
||||
|
||||
if (player->isInCombat())
|
||||
{
|
||||
Spell::SendCastResult(player, spell, 0, SPELL_FAILED_AFFECTING_COMBAT);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (sender == GOSSIP_SENDER_ICC_PORT)
|
||||
player->CastSpell(player, spell, true);
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_icecrown_citadel_teleport()
|
||||
{
|
||||
new icecrown_citadel_teleport();
|
||||
}
|
||||
@@ -37,6 +37,7 @@ class instance_icecrown_citadel : public InstanceMapScript
|
||||
uiSaurfangDoor = 0;
|
||||
uiSaurfangEventNPC = 0;
|
||||
uiDeathbringersCache = 0;
|
||||
uiSaurfangTeleport = 0;
|
||||
isBonedEligible = false;
|
||||
}
|
||||
|
||||
@@ -76,6 +77,8 @@ class instance_icecrown_citadel : public InstanceMapScript
|
||||
if (TeamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_SE_SKYBREAKER_MARINE, ALLIANCE);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,6 +123,16 @@ class instance_icecrown_citadel : public InstanceMapScript
|
||||
case DEATHBRINGER_S_CACHE_25H:
|
||||
uiDeathbringersCache = pGo->GetGUID();
|
||||
break;
|
||||
case SCOURGE_TRANSPORTER_SAURFANG:
|
||||
uiSaurfangTeleport = pGo->GetGUID();
|
||||
if (GetData(DATA_DEATHBRINGER_SAURFANG) == DONE)
|
||||
{
|
||||
HandleGameObject(uiSaurfangTeleport, true, pGo);
|
||||
pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,6 +153,8 @@ class instance_icecrown_citadel : public InstanceMapScript
|
||||
case DATA_SINDRAGOSA:
|
||||
case DATA_THE_LICH_KING:
|
||||
return uiEncounterState[type];
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -155,6 +170,8 @@ class instance_icecrown_citadel : public InstanceMapScript
|
||||
return uiSaurfangEventNPC;
|
||||
case DATA_SAURFANG_DOOR:
|
||||
return uiSaurfangDoor;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -166,7 +183,7 @@ class instance_icecrown_citadel : public InstanceMapScript
|
||||
{
|
||||
case DATA_LORD_MARROWGAR:
|
||||
uiEncounterState[type] = data;
|
||||
switch(data)
|
||||
switch (data)
|
||||
{
|
||||
case DONE:
|
||||
HandleGameObject(uiIcewall[0], true);
|
||||
@@ -181,11 +198,13 @@ class instance_icecrown_citadel : public InstanceMapScript
|
||||
case IN_PROGRESS:
|
||||
HandleGameObject(uiMarrowgarEntrance, false);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case DATA_LADY_DEATHWHISPER:
|
||||
uiEncounterState[type] = data;
|
||||
switch(data)
|
||||
switch (data)
|
||||
{
|
||||
case DONE:
|
||||
// TEMPORARY, UNCOMMMENT IF YOU WANT TO DO SAURFANG AND SKIP GUNSHIP
|
||||
@@ -203,6 +222,8 @@ class instance_icecrown_citadel : public InstanceMapScript
|
||||
case NOT_STARTED:
|
||||
HandleGameObject(uiOratoryDoor, true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case DATA_GUNSHIP_EVENT:
|
||||
@@ -210,10 +231,29 @@ class instance_icecrown_citadel : public InstanceMapScript
|
||||
break;
|
||||
case DATA_DEATHBRINGER_SAURFANG:
|
||||
uiEncounterState[type] = data;
|
||||
if (data == DONE)
|
||||
if (GameObject* lootCache = instance->GetGameObject(uiDeathbringersCache))
|
||||
if (!lootCache->isSpawned())
|
||||
lootCache->SetRespawnTime(7*DAY);
|
||||
switch (data)
|
||||
{
|
||||
case DONE:
|
||||
if (GameObject* lootCache = instance->GetGameObject(uiDeathbringersCache))
|
||||
if (!lootCache->isSpawned())
|
||||
lootCache->SetRespawnTime(7*DAY);
|
||||
case NOT_STARTED:
|
||||
if (GameObject* teleporter = instance->GetGameObject(uiSaurfangTeleport))
|
||||
{
|
||||
HandleGameObject(uiSaurfangTeleport, true, teleporter);
|
||||
teleporter->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
|
||||
}
|
||||
break;
|
||||
case IN_PROGRESS:
|
||||
if (GameObject* teleporter = instance->GetGameObject(uiSaurfangTeleport))
|
||||
{
|
||||
HandleGameObject(uiSaurfangTeleport, false, teleporter);
|
||||
teleporter->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case DATA_FESTERGUT:
|
||||
case DATA_ROTFACE:
|
||||
@@ -229,6 +269,8 @@ class instance_icecrown_citadel : public InstanceMapScript
|
||||
case COMMAND_FAIL_BONED:
|
||||
isBonedEligible = data ? true : false;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (data == DONE && type < MAX_ENCOUNTER)
|
||||
@@ -244,6 +286,8 @@ class instance_icecrown_citadel : public InstanceMapScript
|
||||
case CRITERIA_BONED_10H:
|
||||
case CRITERIA_BONED_25H:
|
||||
return isBonedEligible;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -302,6 +346,7 @@ class instance_icecrown_citadel : public InstanceMapScript
|
||||
uint64 uiSaurfangDoor;
|
||||
uint64 uiSaurfangEventNPC; // Muradin Bronzebeard or High Overlord Saurfang
|
||||
uint64 uiDeathbringersCache;
|
||||
uint64 uiSaurfangTeleport;
|
||||
bool isBonedEligible;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user