maybe I'm too tired :-)
The last "if" does not seem to take effect.
When I go to the door, I can see how it just closes.
And I dont know why.
Raid_IceCrownCitadel.h
/*
* ArcScripts for ArcEmu MMORPG Server
* Copyright (C) 2009- 2014 ArcEmu Team <http://www.arcemu.org/>
* Copyright (C) 2008-2009 Sun++ Team <http://www.sunscripting.com/>
*
* 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 3 of the License, or
* 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, see <http://www.gnu.org/licenses/>.
*/
/////////////////ICC GOs managed by script//////////////////////
enum IceCrownCitadelGOs{
GO_MARROWGAR_ICEWALL_1 = 201911,
GO_MARROWGAR_ICEWALL_2 = 201910,
GO_MARROWGAR_DOOR = 201563
};
static Location Doors[] =
{
{ -407.35f, 2147.88f, 42.85f, 0 }, //IceWall1
{ -412.97f, 2285.24f, 42.01f, 0 }, //IceWall2
{ -520.44f, 2211.47f, 63.14f, 0 }, //Door behinde ice
};
// IceCrown Teleporter
void SetupICC(ScriptMgr* mgr);
Raid_IceCrownCitadel.cpp
/*
* ArcEmu MMORPG Server
* Copyright (C) 2005-2007 Ascent Team <http://www.ascentemu.com/>
* Copyright (C) 2008-2014 <http://www.ArcEmu.org/>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "Setup.h"
#include "Raid_IceCrownCitadel.h"
#define MAP_ICECROWNCITADEL 631
////////////////////////////////////////////////////////
//ICC zone: 4812
//Prepared creature entry:
//
#define CN_LORD_MARROWGAR 36612
#define CN_COLDFLAME 36672
#define CN_LADY_DEATHWHISPER 36855
//#define CN_DEATHBRINGER_SAURFANG 37813
//#define CN_FESTERGUT 36626
//#define CN_ROTFACE 36627
//#define CN_PROFESSOR_PUTRICIDE 36678
//#define CN_PRINCE_VALANAR 37970
//#define CN_BLOOD_QUEEN_LANATHEL 37955
#define CN_VALITHRIA_DREAMWALKER 36789
//#define CN_SINDRAGOSA 36853
//#define CN_THE_LICHKING 36597
//
//ToDo: start boss scripts
////////////////////////////////////////////////////////
//Event: GunshipBattle
//
//Affects:
//Available teleports. If GunshipBattle done -> Teleportlocation 4 available.
//
//Devnotes:
//Far away from implementing this :(
///////////////////////////////////////////////////////
///////////////////////////////////////////////////////
//IceCrownCitadel Instance
class IceCrownCitadelScript : public MoonInstanceScript
{
public:
MOONSCRIPT_INSTANCE_FACTORY_FUNCTION(IceCrownCitadelScript, MoonInstanceScript);
IceCrownCitadelScript(MapMgr* pMapMgr) : MoonInstanceScript(pMapMgr)
{
mMarrowIceDoor1_GUID = 0;
mMarrowIceDoor2_GUID = 0;
mMarrowDoor_GUID = 0;
}
void OnGameObjectPushToWorld(GameObject* pGameObject)
{
switch (pGameObject->GetEntry())
{
case GO_MARROWGAR_ICEWALL_1: mMarrowIceDoor1_GUID = pGameObject->GetGUID(); break;
case GO_MARROWGAR_ICEWALL_2: mMarrowIceDoor2_GUID = pGameObject->GetGUID(); break;
case GO_MARROWGAR_DOOR: mMarrowDoor_GUID = pGameObject->GetGUID(); break;
}
}
/*bool NPCData
Creature.h looks good to realize teleport intrusion
CREATURE_STATE_ALIVE = 0, // no special death state
CREATURE_STATE_APPEAR_DEAD = 1, // these creatures are actually alive but appears as dead for client
CREATURE_STATE_DEAD = 2 // these creatures are dead*/
void OnCreatureDeath(Creature* pCreature, Unit* pUnit)
{
switch (pCreature->GetEntry())
{
//Need check if killed set state 2
case CN_LORD_MARROWGAR:
{
GameObject* pMarrowIceDoor1 = FindClosestGameObjectOnMap(GO_MARROWGAR_ICEWALL_1, Doors[0].x, Doors[0].y, Doors[0].z);
if (pMarrowIceDoor1 != NULL)
pMarrowIceDoor1->SetState(GAMEOBJECT_STATE_OPEN);
GameObject* pMarrowIceDoor2 = FindClosestGameObjectOnMap(GO_MARROWGAR_ICEWALL_2, Doors[1].x, Doors[1].y, Doors[1].z);
if (pMarrowIceDoor2 != NULL)
pMarrowIceDoor2->SetState(GAMEOBJECT_STATE_OPEN);
GameObject* pMarrowDoor = FindClosestGameObjectOnMap(GO_MARROWGAR_DOOR, Doors[2].x, Doors[2].y, Doors[2].z);
if (pMarrowDoor != NULL)
pMarrowDoor->SetState(GAMEOBJECT_STATE_OPEN);
MorrowgarIsDead = true;
}break;
case CN_LADY_DEATHWHISPER:
case CN_VALITHRIA_DREAMWALKER:
case CN_COLDFLAME:
default:
break;
}
return;
}
public:
bool MorrowgarIsDead;
protected:
uint32 mMarrowIceDoor1_GUID;
uint32 mMarrowIceDoor2_GUID;
uint32 mMarrowDoor_GUID;
};
// IceCrown Teleporter
static float ICCTeleCoords[6][5] =
{ // Maybe moving this to a clean mysql table with all teleports in it... maybe as spell or event?
{ 631, -17.856115f, 2211.640137f, 30.115812f, 0.0f }, //1 Teleport to Light's Hammer
{ 631, -503.632599f, 2211.219971f, 62.823246f, 0.0f }, //2 Teleport to Oratory of The Damned
{ 631, -615.098267f, 2211.509766f, 199.973083f, 0.0f }, //3 Teleport to Rampart of Skulls
{ 631, -549.151001f, 2211.463967f, 539.290222f, 0.0f }, //4 Teleport to Deathbringer's Rise
{ 631, 4356.780273f, 2863.636230f, 349.337982f, 0.0f }, //5 Teleport to the Upper Spire.
{ 631, 4453.248535f, 2769.325684f, 349.347473f, 0.0f } //6 Teleport to Sindragosa's Lair
};
class ICCTeleporterAI : public GameObjectAIScript
{
public:
ICCTeleporterAI(GameObject* go) : GameObjectAIScript(go){}
~ICCTeleporterAI() {}
static GameObjectAIScript* Create(GameObject* go) { return new ICCTeleporterAI(go); }
void OnActivate(Player* player)
{
GossipMenu* menu = NULL;
objmgr.CreateGossipMenuForPlayer(&menu, _gameobject->GetGUID(), 1/*Its not one need to be checked*/, player);
menu->AddItem(Arcemu::Gossip::ICON_CHAT, "Teleport to Light's Hammer.", 0);
// need to be checked, if npc is death...
// CN_LORD_MARROWGAR killed?
menu->AddItem(Arcemu::Gossip::ICON_CHAT, "Teleport to Oratory of The Damned.", 1);
// CN_LADY_DEATHWHISPER killed?
menu->AddItem(Arcemu::Gossip::ICON_CHAT, "Teleport to Rampart of Skulls.", 2);
// Who has to be killed?
menu->AddItem(Arcemu::Gossip::ICON_CHAT, "Teleport to Deathbringer's Rise.", 3);
// Who has to be killed?
menu->AddItem(Arcemu::Gossip::ICON_CHAT, "Teleport to the Upper Spire.", 4);
// CN_VALITHRIA_DREAMWALKER killed?
menu->AddItem(Arcemu::Gossip::ICON_CHAT, "Teleport to Sindragosa's Lair.", 5);
menu->SendTo(player);
}
};
class ICCTeleporterGossip : public GossipScript
{
public:
ICCTeleporterGossip() : GossipScript(){}
void OnSelectOption(Object* object, Player* player, uint32 Id, const char* enteredcode)
{
Arcemu::Gossip::Menu::Complete(player);
if(Id >= 6) //if menuitem bigger or 6 then somethin went completly wrong...
return;
else
player->SafeTeleport(ICCTeleCoords[Id][0], player->GetInstanceID(), ICCTeleCoords[Id][1], ICCTeleCoords[Id][2], ICCTeleCoords[Id][3], ICCTeleCoords[Id][4]);
}
};
void SetupICC(ScriptMgr* mgr)
{
//Bosses
mgr->register_instance_script(MAP_ICECROWNCITADEL, &IceCrownCitadelScript::Create);
//Teleporters
mgr->register_gameobject_script(202242, &ICCTeleporterAI::Create);
mgr->register_go_gossip_script(202242, new ICCTeleporterGossip());
mgr->register_gameobject_script(202243, &ICCTeleporterAI::Create);
mgr->register_go_gossip_script(202243, new ICCTeleporterGossip());
mgr->register_gameobject_script(202244, &ICCTeleporterAI::Create);
mgr->register_go_gossip_script(202244, new ICCTeleporterGossip());
mgr->register_gameobject_script(202245, &ICCTeleporterAI::Create);
mgr->register_go_gossip_script(202245, new ICCTeleporterGossip());
mgr->register_gameobject_script(202246, &ICCTeleporterAI::Create);
mgr->register_go_gossip_script(202246, new ICCTeleporterGossip());
};