Professional Documents
Culture Documents
Go Scripts
Go Scripts
Go Scripts
* This file is part of the AzerothCore Project. See AUTHORS file for Copyright
information
*
* 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 (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 Affero 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/>.
*/
/* ContentData
go_cat_figurine (the "trap" version of GO, two different exist)
go_barov_journal
go_ethereum_prison
go_ethereum_stasis
go_sacred_fire_of_life
go_shrine_of_the_birds
go_southfury_moonstone
go_resonite_cask
go_tablet_of_the_seven
go_tele_to_dalaran_crystal
go_tele_to_violet_stand
go_scourge_cage
go_jotunheim_cage
go_table_theka
go_soulwell
go_bashir_crystalforge
go_soulwell
go_dragonflayer_cage
go_tadpole_cage
go_amberpine_outhouse
go_hive_pod
go_veil_skith_cage
EndContentData */
#include "CellImpl.h"
#include "GameObjectAI.h"
#include "GameTime.h"
#include "GridNotifiersImpl.h"
#include "Player.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "Spell.h"
#include "WorldSession.h"
// Ours
/*######
## go_noblegarden_colored_egg
######*/
class go_noblegarden_colored_egg : public GameObjectScript
{
public:
go_noblegarden_colored_egg() : GameObjectScript("go_noblegarden_colored_egg") {
}
uint32 _timer;
};
return false;
}
};
/*######
## go_ethereum_prison
######*/
enum EthereumPrison
{
SPELL_REP_LC = 39456,
SPELL_REP_SHAT = 39457,
SPELL_REP_CE = 39460,
SPELL_REP_CON = 39474,
SPELL_REP_KT = 39475,
SPELL_REP_SPOR = 39476
};
switch (creature->GetEntry())
{
case 22811:
Spell = SPELL_REP_LC;
break;
case 22812:
Spell = SPELL_REP_SHAT;
break;
case 22810:
Spell = SPELL_REP_CE;
break;
case 22813:
Spell = SPELL_REP_CON;
break;
case 22815:
Spell = SPELL_REP_KT;
break;
case 22814:
Spell = SPELL_REP_SPOR;
break;
}
if (Spell)
creature->CastSpell(player, Spell, false);
}
}
return false;
}
};
/*######
## go_ethereum_stasis
######*/
return false;
}
};
/*######
## go_resonite_cask
######*/
enum ResoniteCask
{
NPC_GOGGEROC = 11920
};
return false;
}
};
/*######
## Quest 11560: Oh Noes, the Tadpoles!
## go_tadpole_cage
######*/
enum Tadpoles
{
QUEST_OH_NOES_THE_TADPOLES = 11560,
NPC_WINTERFIN_TADPOLE = 25201
};
uint8 requireSummon;
void SummonTadpoles()
{
requireSummon = 0;
int8 count = urand(1, 3);
for (int8 i = 0; i < count; ++i)
me->SummonCreature(NPC_WINTERFIN_TADPOLE, me->GetPositionX() +
cos(2 * M_PI * i / 3.0f) * 0.60f, me->GetPositionY() + std::sin(2 * M_PI * i /
3.0f) * 0.60f, me->GetPositionZ(), me->GetOrientation(),
TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
}
requireSummon = 1;
if (player->GetQuestStatus(QUEST_OH_NOES_THE_TADPOLES) ==
QUEST_STATUS_INCOMPLETE)
{
std::list<Creature*> cList;
GetCreatureListWithEntryInGrid(cList, me, NPC_WINTERFIN_TADPOLE,
5.0f);
for (std::list<Creature*>::const_iterator itr = cList.begin();
itr != cList.end(); ++itr)
{
player->KilledMonsterCredit(NPC_WINTERFIN_TADPOLE);
(*itr)->DespawnOrUnsummon(urand(45000, 60000));
(*itr)->GetMotionMaster()->MoveFollow(player, 1.0f, frand(0.0f,
2 * M_PI), MOTION_SLOT_CONTROLLED);
}
}
return false;
}
};
enum Flames
{
SPELL_FLAMES = 7897
};
Acore::PlayerListSearcher<Acore::AnyPlayerExactPositionInGameObjectRangeCheck>
searcher(me, players, checker);
Cell::VisitWorldObjects(me, searcher, 0.3f);
if (players.size() > 0)
{
std::list<Player*>::iterator itr = players.begin();
std::advance(itr, urand(0, players.size() - 1));
if (Creature* trigger = me->SummonTrigger((*itr)-
>GetPositionX(), (*itr)->GetPositionY(), (*itr)->GetPositionZ(), 0, 2000, true))
trigger->CastSpell(trigger, SPELL_FLAMES);
}
}
}
private:
uint32 timer;
};
enum Heat
{
SPELL_HEAT = 7902
};
class go_heat : public GameObjectScript
{
public:
go_heat() : GameObjectScript("go_heat") { }
Acore::PlayerListSearcher<Acore::AnyPlayerExactPositionInGameObjectRangeCheck>
searcher(me, players, checker);
Cell::VisitWorldObjects(me, searcher, 0.3f);
if (players.size() > 0)
{
std::list<Player*>::iterator itr = players.begin();
std::advance(itr, urand(0, players.size() - 1));
if (Creature* trigger = me->SummonTrigger((*itr)-
>GetPositionX(), (*itr)->GetPositionY(), (*itr)->GetPositionZ(), 0, 2000, true))
trigger->CastSpell(trigger, SPELL_HEAT);
}
}
}
private:
uint32 timer;
};
enum eBearTrap
{
EVENT_CHECK = 1,
NPC_RABID_THISTLE_BEAR = 2164,
SPELL_BEAR_CAPTURED_IN_TRAP = 9439
};
void Initialize()
{
_events.ScheduleEvent(EVENT_CHECK, 1000);
}
// Theirs
/*####
## go_brewfest_music
####*/
enum BrewfestMusic
{
EVENT_BREWFESTDWARF01 = 11810, // 1.35 min
EVENT_BREWFESTDWARF02 = 11812, // 1.55 min
EVENT_BREWFESTDWARF03 = 11813, // 0.23 min
EVENT_BREWFESTGOBLIN01 = 11811, // 1.08 min
EVENT_BREWFESTGOBLIN02 = 11814, // 1.33 min
EVENT_BREWFESTGOBLIN03 = 11815 // 0.28 min
};
enum BrewfestMusicAreas
{
SILVERMOON = 3430, // Horde
UNDERCITY = 1497,
ORGRIMMAR_1 = 1296,
ORGRIMMAR_2 = 14,
THUNDERBLUFF = 1638,
IRONFORGE_1 = 809, // Alliance
IRONFORGE_2 = 1,
STORMWIND = 12,
EXODAR = 3557,
DARNASSUS = 1657,
SHATTRATH = 3703 // General
};
enum BrewfestMusicEvents
{
EVENT_BM_SELECT_MUSIC = 1,
EVENT_BM_START_MUSIC = 2
};
/*####
## go_pirate_day_music
####*/
enum PirateDayMusic
{
MUSIC_PIRATE_DAY_MUSIC = 12845
};
enum PirateDayMusicEvents
{
EVENT_PDM_START_MUSIC = 1
};
/*####
## go_darkmoon_faire_music
####*/
enum DarkmoonFaireMusic
{
MUSIC_DARKMOON_FAIRE_MUSIC = 8440
};
enum DarkmoonFaireMusicEvents
{
EVENT_DFM_START_MUSIC = 1
};
/*####
## go_midsummer_music
####*/
enum MidsummerMusic
{
EVENTMIDSUMMERFIREFESTIVAL_A = 12319, // 1.08 min
EVENTMIDSUMMERFIREFESTIVAL_H = 12325, // 1.12 min
};
enum MidsummerMusicEvents
{
EVENT_MM_START_MUSIC = 1
};
std::list<Player*> targets;
Acore::AnyPlayerInObjectRangeCheck check(me, me-
>GetVisibilityRange(), false);
Acore::PlayerListSearcherWithSharedVision<Acore::AnyPlayerInObjectRangeCheck>
searcher(me, targets, check);
Cell::VisitWorldObjects(me, searcher, me-
>GetVisibilityRange());
for (Player* player : targets)
{
if (player->GetTeamId() == TEAM_HORDE)
{
me-
>PlayDirectMusic(EVENTMIDSUMMERFIREFESTIVAL_H, player);
}
else
{
me-
>PlayDirectMusic(EVENTMIDSUMMERFIREFESTIVAL_A, player);
}
}
_events.ScheduleEvent(EVENT_MM_START_MUSIC, 5000); //
Every 5 second's SMSG_PLAY_MUSIC packet (PlayDirectMusic) is pushed to the client
(sniffed value)
break;
}
default:
break;
}
}
}
private:
EventMap _events;
};
/*######
## go_gilded_brazier (Paladin quest 9678 "The First Trial")
######*/
enum GildedBrazier
{
EVENT_STILLBLADE_SPAWN = 1,
EVENT_RESET_BRAZIER = 2,
NPC_STILLBLADE = 17716,
QUEST_THE_FIRST_TRIAL = 9678
};
void Initialize()
{
_playerGUID.Clear();
}
if (me->GetGoType() == GAMEOBJECT_TYPE_GOOBER)
{
if (player->GetQuestStatus(QUEST_THE_FIRST_TRIAL) ==
QUEST_STATUS_INCOMPLETE)
{
_playerGUID = player->GetGUID();
me->SetGameObjectFlag((GameObjectFlags)1);
me->RemoveByteFlag(GAMEOBJECT_BYTES_1, 0, 1);
_events.ScheduleEvent(EVENT_STILLBLADE_SPAWN, 1000);
}
}
return true;
}
private:
EventMap _events;
ObjectGuid _playerGUID;
};
/*######
## go_tablet_of_the_seven
######*/
//TODO: use gossip option ("Transcript the Tablet") instead, if Trinity adds
support.
bool OnGossipHello(Player* player, GameObject* go) override
{
if (go->GetGoType() != GAMEOBJECT_TYPE_QUESTGIVER)
return true;
if (player->GetQuestStatus(4296) == QUEST_STATUS_INCOMPLETE)
player->CastSpell(player, 15065, false);
return true;
}
};
/*#####
## go_jump_a_tron
######*/
return true;
}
};
/*######
## go_sacred_fire_of_life
######*/
enum SacredFireOfLife
{
NPC_ARIKARA = 10882
};
/*######
## go_shrine_of_the_birds
######*/
/*
enum ShrineOfTheBirds
{
NPC_HAWK_GUARD = 22992,
NPC_EAGLE_GUARD = 22993,
NPC_FALCON_GUARD = 22994,
GO_SHRINE_HAWK = 185551,
GO_SHRINE_EAGLE = 185547,
GO_SHRINE_FALCON = 185553
};
switch (go->GetEntry())
{
case GO_SHRINE_HAWK:
BirdEntry = NPC_HAWK_GUARD;
break;
case GO_SHRINE_EAGLE:
BirdEntry = NPC_EAGLE_GUARD;
break;
case GO_SHRINE_FALCON:
BirdEntry = NPC_FALCON_GUARD;
break;
}
if (BirdEntry)
player->SummonCreature(BirdEntry, fX, fY, fZ, go->GetOrientation(),
TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
return false;
}
};
*/
/*######
## go_southfury_moonstone
######*/
enum Southfury
{
NPC_RIZZLE = 23002,
SPELL_BLACKJACK = 39865, //stuns player
SPELL_SUMMON_RIZZLE = 39866
};
return false;
}
};
/*######
## go_tele_to_dalaran_crystal
######*/
enum DalaranCrystal
{
QUEST_LEARN_LEAVE_RETURN = 12790,
QUEST_TELE_CRYSTAL_FLAG = 12845
};
player->GetSession()->SendNotification(GO_TELE_TO_DALARAN_CRYSTAL_FAILED);
return true;
}
};
/*######
## go_tele_to_violet_stand
######*/
return true;
}
};
/*######
## go_fel_crystalforge
######*/
enum FelCrystalforge
{
SPELL_CREATE_1_FLASK_OF_BEAST = 40964,
SPELL_CREATE_5_FLASK_OF_BEAST = 40965,
};
return true;
}
/*######
## go_bashir_crystalforge
######*/
enum BashirCrystalforge
{
SPELL_CREATE_1_FLASK_OF_SORCERER = 40968,
SPELL_CREATE_5_FLASK_OF_SORCERER = 40970,
};
return true;
}
/*######
## go_scourge_cage
######*/
enum ScourgeCage
{
NPC_SCOURGE_PRISONER = 25610
};
return true;
}
};
/*######
## go_arcane_prison
######*/
enum ArcanePrison
{
QUEST_PRISON_BREAK = 11587,
SPELL_ARCANE_PRISONER_KILL_CREDIT = 45456
};
/*######
## go_jotunheim_cage
######*/
enum JotunheimCage
{
NPC_EBON_BLADE_PRISONER_HUMAN = 30186,
NPC_EBON_BLADE_PRISONER_NE = 30194,
NPC_EBON_BLADE_PRISONER_TROLL = 30196,
NPC_EBON_BLADE_PRISONER_ORC = 30195,
SPELL_SUMMON_BLADE_KNIGHT_H = 56207,
SPELL_SUMMON_BLADE_KNIGHT_NE = 56209,
SPELL_SUMMON_BLADE_KNIGHT_ORC = 56212,
SPELL_SUMMON_BLADE_KNIGHT_TROLL = 56214
};
pPrisoner->DespawnOrUnsummon();
player->KilledMonsterCredit(NPC_EBON_BLADE_PRISONER_HUMAN);
switch (pPrisoner->GetEntry())
{
case NPC_EBON_BLADE_PRISONER_HUMAN:
player->CastSpell(player, SPELL_SUMMON_BLADE_KNIGHT_H, true);
break;
case NPC_EBON_BLADE_PRISONER_NE:
player->CastSpell(player, SPELL_SUMMON_BLADE_KNIGHT_NE, true);
break;
case NPC_EBON_BLADE_PRISONER_TROLL:
player->CastSpell(player, SPELL_SUMMON_BLADE_KNIGHT_TROLL, true);
break;
case NPC_EBON_BLADE_PRISONER_ORC:
player->CastSpell(player, SPELL_SUMMON_BLADE_KNIGHT_ORC, true);
break;
}
return true;
}
};
enum TableTheka
{
GOSSIP_TABLE_THEKA = 1653,
QUEST_SPIDER_GOLD = 2936
};
return true;
}
};
/*######
## go_inconspicuous_landmark
######*/
enum InconspicuousLandmark
{
SPELL_SUMMON_PIRATES_TREASURE_AND_TRIGGER_MOB = 11462,
ITEM_CUERGOS_KEY = 9275,
};
private:
uint32 _lastUsedTime;
};
/*######
## go_soulwell
######*/
enum SoulWellData
{
GO_SOUL_WELL_R1 = 181621,
GO_SOUL_WELL_R2 = 193169,
SPELL_IMPROVED_HEALTH_STONE_R1 = 18692,
SPELL_IMPROVED_HEALTH_STONE_R2 = 18693,
SPELL_CREATE_MASTER_HEALTH_STONE_R0 = 34130,
SPELL_CREATE_MASTER_HEALTH_STONE_R1 = 34149,
SPELL_CREATE_MASTER_HEALTH_STONE_R2 = 34150,
SPELL_CREATE_FEL_HEALTH_STONE_R0 = 58890,
SPELL_CREATE_FEL_HEALTH_STONE_R1 = 58896,
SPELL_CREATE_FEL_HEALTH_STONE_R2 = 58898,
};
_stoneId = spellInfo->Effects[EFFECT_0].ItemType;
}
return true;
}
private:
uint32 _stoneSpell;
uint32 _stoneId;
};
/*######
## Quest 11255: Prisoners of Wyrmskull
## go_dragonflayer_cage
######*/
enum PrisonersOfWyrmskull
{
QUEST_PRISONERS_OF_WYRMSKULL = 11255,
NPC_PRISONER_PRIEST = 24086,
NPC_PRISONER_MAGE = 24088,
NPC_PRISONER_WARRIOR = 24089,
NPC_PRISONER_PALADIN = 24090
};
if (!pPrisoner || !pPrisoner->IsAlive())
return true;
/*######
## go_amberpine_outhouse
######*/
enum AmberpineOuthouse
{
ITEM_ANDERHOLS_SLIDER_CIDER = 37247,
NPC_OUTHOUSE_BUNNY = 27326,
QUEST_DOING_YOUR_DUTY = 12227,
SPELL_INDISPOSED = 53017,
SPELL_INDISPOSED_III = 48341,
SPELL_CREATE_AMBERSEEDS = 48330,
GOSSIP_OUTHOUSE_INUSE = 12775,
GOSSIP_OUTHOUSE_VACANT = 12779
};
return true;
}
enum Hives
{
QUEST_HIVE_IN_THE_TOWER = 9544,
NPC_HIVE_AMBUSHER = 13301
};
/*########
#### go_veil_skith_cage
#####*/
enum MissingFriends
{
QUEST_MISSING_FRIENDS = 10852,
NPC_CAPTIVE_CHILD = 22314,
SAY_FREE_0 = 0,
};
class go_veil_skith_cage : public GameObjectScript
{
public:
go_veil_skith_cage() : GameObjectScript("go_veil_skith_cage") { }
/*####
## go_bells
####*/
enum BellHourlySoundFX
{
BELLTOLLHORDE = 6595,
BELLTOLLTRIBAL = 6675,
BELLTOLLALLIANCE = 6594,
BELLTOLLNIGHTELF = 6674,
BELLTOLLDWARFGNOME = 7234,
BELLTOLLKHARAZHAN = 9154,
LIGHTHOUSEFOGHORN = 7197
};
enum BellHourlySoundZones
{
TIRISFAL_ZONE = 85,
UNDERCITY_ZONE = 1497,
DUN_MOROGH_ZONE = 1,
IRONFORGE_ZONE = 1537,
TELDRASSIL_ZONE = 141,
DARNASSUS_ZONE = 1657,
ASHENVALE_ZONE = 331,
HILLSBRAD_FOOTHILLS_ZONE = 267,
DUSKWOOD_ZONE = 10,
WESTFALL_ZONE = 40,
DUSTWALLOW_MARSH_ZONE = 15,
SHATTRATH_ZONE = 3703
};
enum LightHouseAreas
{
AREA_ALCAZ_ISLAND = 2079,
AREA_WESTFALL_LIGHTHOUSE = 115
};
enum BellHourlyObjects
{
GO_HORDE_BELL = 175885,
GO_ALLIANCE_BELL = 176573,
GO_KHARAZHAN_BELL = 182064
};
enum BellHourlyMisc
{
GAME_EVENT_HOURLY_BELLS = 73,
EVENT_RING_BELL = 1,
EVENT_TIME = 2
};
switch (go->GetEntry())
{
case GO_HORDE_BELL:
{
switch (zoneId)
{
case TIRISFAL_ZONE:
case UNDERCITY_ZONE:
case HILLSBRAD_FOOTHILLS_ZONE:
case DUSKWOOD_ZONE:
_soundId = BELLTOLLHORDE;
break;
default:
_soundId = BELLTOLLTRIBAL;
break;
}
break;
}
case GO_ALLIANCE_BELL:
{
switch (zoneId)
{
case IRONFORGE_ZONE:
case DUN_MOROGH_ZONE:
_soundId = BELLTOLLDWARFGNOME;
break;
case DARNASSUS_ZONE:
case TELDRASSIL_ZONE:
case ASHENVALE_ZONE:
case SHATTRATH_ZONE:
_soundId = BELLTOLLNIGHTELF;
break;
case WESTFALL_ZONE:
if (go->GetAreaId() == AREA_WESTFALL_LIGHTHOUSE)
{
_soundId = LIGHTHOUSEFOGHORN;
}
else
{
_soundId = BELLTOLLALLIANCE;
}
break;
case DUSTWALLOW_MARSH_ZONE:
if (go->GetAreaId() == AREA_ALCAZ_ISLAND)
{
_soundId = LIGHTHOUSEFOGHORN;
}
else
{
_soundId = BELLTOLLALLIANCE;
}
break;
default:
_soundId = BELLTOLLALLIANCE;
break;
}
break;
}
case GO_KHARAZHAN_BELL:
{
_soundId = BELLTOLLKHARAZHAN;
break;
}
break;
}
}
private:
EventMap _events;
uint32 _soundId;
bool once;
};
/*########
#### go_duskwither_spire_power_source
#####*/
enum DuskwitherSpirePowersource
{
NPC_POWER_SOURCE_INVISIBLE_BUNNY = 17984
};
// Theirs
new go_brewfest_music();
new go_pirate_day_music();
new go_darkmoon_faire_music();
new go_midsummer_music();
new go_gilded_brazier();
//new go_shrine_of_the_birds();
new go_southfury_moonstone();
new go_tablet_of_the_seven();
new go_jump_a_tron();
new go_sacred_fire_of_life();
new go_tele_to_dalaran_crystal();
new go_tele_to_violet_stand();
new go_fel_crystalforge();
new go_bashir_crystalforge();
new go_scourge_cage();
new go_arcane_prison();
new go_jotunheim_cage();
new go_table_theka();
new go_inconspicuous_landmark();
new go_soulwell();
new go_dragonflayer_cage();
new go_amberpine_outhouse();
new go_hive_pod();
new go_massive_seaforium_charge();
new go_veil_skith_cage();
new go_bells();
}