* Merge - screw you, Brian!
--HG-- branch : trunk
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
-- delete unused command loadscripts
|
||||
DELETE FROM `command` WHERE `name` = 'loadscripts';
|
||||
-- Change the default scurity level for some commands
|
||||
UPDATE `command` SET `security`=2 WHERE `name` IN ('playall','npc setlink','reload creature_linked_respawn'); -- DB devs command
|
||||
UPDATE `command` SET `security`=1 WHERE `name` IN ('freeze','listfreeze','unfreeze'); -- Players can be anoying when talking a mod
|
||||
UPDATE `command` SET `security`=1 WHERE `name` IN ('gmannounce','gmnameannounce','gmnotify'); -- even mods needs to notify things when a higher range staft is not online
|
||||
UPDATE `command` SET `security`=1 WHERE `name` IN ('ticket assign','ticket close','ticket comment','ticket unassign'); -- Dirty work for slaves
|
||||
UPDATE `command` SET `security`=1 WHERE `name`='account addon'; -- Server admins uses addon to close northrend
|
||||
+10
-11
@@ -316,7 +316,7 @@ LOCK TABLES `command` WRITE;
|
||||
/*!40000 ALTER TABLE `command` DISABLE KEYS */;
|
||||
INSERT INTO `command` VALUES
|
||||
('account','0','Syntax: .account\r\n\r\nDisplay the access level of your account.'),
|
||||
('account addon','3','Syntax: .account addon #addon\nSet expansion addon level allowed. Addon values: 0 - normal, 1 - tbc, 2 - wotlk.'),
|
||||
('account addon','1','Syntax: .account addon #addon\nSet expansion addon level allowed. Addon values: 0 - normal, 1 - tbc, 2 - wotlk.'),
|
||||
('account create','4','Syntax: .account create $account $password\r\n\r\nCreate account and set password to it.'),
|
||||
('account delete','4','Syntax: .account delete $account\r\n\r\nDelete account with all characters.'),
|
||||
('account lock','0','Syntax: .account lock [on|off]\r\n\r\nAllow login from account only from current used IP or remove this requirement.'),
|
||||
@@ -377,16 +377,16 @@ INSERT INTO `command` VALUES
|
||||
('event stop','2','Syntax: .event stop #event_id\r\nStop event #event_id. Set start time for event to time in past that make current moment is event stop time (change not saved in DB).'),
|
||||
('explorecheat','3','Syntax: .explorecheat #flag\r\n\r\nReveal or hide all maps for the selected player. If no player is selected, hide or reveal maps to you.\r\n\r\nUse a #flag of value 1 to reveal, use a #flag value of 0 to hide all maps.'),
|
||||
('flusharenapoints','3','Syntax: .flusharenapoints\r\n\r\nUse it to distribute arena points based on arena team ratings, and start a new week.'),
|
||||
('freeze','2','Syntax: .freeze (#player)\r\n\"Freezes\" #player and disables his chat. When using this without #name it will freeze your target.'),
|
||||
('freeze','1','Syntax: .freeze (#player)\r\n\"Freezes\" #player and disables his chat. When using this without #name it will freeze your target.'),
|
||||
('gm','1','Syntax: .gm [on/off]\r\n\r\nEnable or Disable in game GM MODE or show current state of on/off not provided.'),
|
||||
('gm chat','1','Syntax: .gm chat [on/off]\r\n\r\nEnable or disable chat GM MODE (show gm badge in messages) or show current state of on/off not provided.'),
|
||||
('gm fly','3','Syntax: .gm fly [on/off]\r\nEnable/disable gm fly mode.'),
|
||||
('gm ingame','0','Syntax: .gm ingame\r\n\r\nDisplay a list of available in game Game Masters.'),
|
||||
('gm list','3','Syntax: .gm list\r\n\r\nDisplay a list of all Game Masters accounts and security levels.'),
|
||||
('gm visible','1','Syntax: .gm visible on/off\r\n\r\nOutput current visibility state or make GM visible(on) and invisible(off) for other players.'),
|
||||
('gmannounce','4','Syntax: .gmannounce $announcement\r\nSend an announcement to online Gamemasters.'),
|
||||
('gmnameannounce','2','Syntax: .gmnameannounce $announcement.\r\nSend an announcement to all online GM\'s, displaying the name of the sender.'),
|
||||
('gmnotify','2','Syntax: .gmnotify $notification\r\nDisplays a notification on the screen of all online GM\'s.'),
|
||||
('gmannounce','1','Syntax: .gmannounce $announcement\r\nSend an announcement to online Gamemasters.'),
|
||||
('gmnameannounce','1','Syntax: .gmnameannounce $announcement.\r\nSend an announcement to all online GM\'s, displaying the name of the sender.'),
|
||||
('gmnotify','1','Syntax: .gmnotify $notification\r\nDisplays a notification on the screen of all online GM\'s.'),
|
||||
('go','1','Syntax: .go $subcommand\nType .go to see the list of possible subcommands or .help go $subcommand to see info on subcommands'),
|
||||
('go creature','1','Syntax: .go creature #creature_guid\r\nTeleport your character to creature with guid #creature_guid.\r\n.gocreature #creature_name\r\nTeleport your character to creature with this name.\r\n.gocreature id #creature_id\r\nTeleport your character to a creature that was spawned from the template with this entry.\r\n*If* more than one creature is found, then you are teleported to the first that is found inside the database.'),
|
||||
('go graveyard','1','Syntax: .go graveyard #graveyardId\r\n Teleport to graveyard with the graveyardId specified.'),
|
||||
@@ -452,7 +452,6 @@ INSERT INTO `command` VALUES
|
||||
('list object','3','Syntax: .list object #gameobject_id [#max_count]\r\n\r\nOutput gameobjects with gameobject id #gameobject_id found in world. Output gameobject guids and coordinates sorted by distance from character. Will be output maximum #max_count gameobject. If #max_count not provided use 10 as default value.'),
|
||||
('listfreeze','1','Syntax: .listfreeze\r\n\r\nSearch and output all frozen players.'),
|
||||
('loadpath','3','Syntax: .loadpath $pathid\nLoad path changes ingame - IMPORTANT: must be applied first for new paths before .path load #pathid '),
|
||||
('loadscripts','3','Syntax: .loadscripts $scriptlibraryname\r\n\r\nUnload current and load the script library $scriptlibraryname or reload current if $scriptlibraryname omitted, in case you changed it while the server was running.'),
|
||||
('lookup','3','Syntax: .lookup $subcommand\nType .lookup to see the list of possible subcommands or .help lookup $subcommand to see info on subcommands'),
|
||||
('lookup area','1','Syntax: .lookup area $namepart\r\n\r\nLooks up an area by $namepart, and returns all matches with their area ID\'s.'),
|
||||
('lookup creature','3','Syntax: .lookup creature $namepart\r\n\r\nLooks up a creature by $namepart, and returns all matches with their creature ID\'s.'),
|
||||
@@ -664,14 +663,14 @@ INSERT INTO `command` VALUES
|
||||
('tele group','1','Syntax: .tele group#location\r\n\r\nTeleport a selected player and his group members to a given location.'),
|
||||
('tele name','1','Syntax: .tele name [#playername] #location\r\n\r\nTeleport the given character to a given location. Character can be offline.'),
|
||||
('ticket','1','Syntax: .ticket $subcommand\nType .ticket to see the list of possible subcommands or .help ticket $subcommand to see info on subcommands'),
|
||||
('ticket assign','3','Usage: .ticket assign $ticketid $gmname.\r\nAssigns the specified ticket to the specified Game Master.'),
|
||||
('ticket close','2','Usage: .ticket close $ticketid.\r\nCloses the specified ticket. Does not delete permanently.'),
|
||||
('ticket assign','1','Usage: .ticket assign $ticketid $gmname.\r\nAssigns the specified ticket to the specified Game Master.'),
|
||||
('ticket close','1','Usage: .ticket close $ticketid.\r\nCloses the specified ticket. Does not delete permanently.'),
|
||||
('ticket closedlist','1','Displays a list of closed GM tickets.'),
|
||||
('ticket comment','2','Usage: .ticket comment $ticketid $comment.\r\nAllows the adding or modifying of a comment to the specified ticket.'),
|
||||
('ticket comment','1','Usage: .ticket comment $ticketid $comment.\r\nAllows the adding or modifying of a comment to the specified ticket.'),
|
||||
('ticket delete','3','Usage: .ticket delete $ticketid.\r\nDeletes the specified ticket permanently. Ticket must be closed first.'),
|
||||
('ticket list','1','Displays a list of open GM tickets.'),
|
||||
('ticket onlinelist','1','Displays a list of open GM tickets whose owner is online.'),
|
||||
('ticket unassign','3','Usage: .ticket unassign $ticketid.\r\nUnassigns the specified ticket from the current assigned Game Master.'),
|
||||
('ticket unassign','1','Usage: .ticket unassign $ticketid.\r\nUnassigns the specified ticket from the current assigned Game Master.'),
|
||||
('ticket viewid','1','Usage: .ticket viewid $ticketid.\r\nReturns details about specified ticket. Ticket must be open and not deleted.'),
|
||||
('ticket viewname','1','Usage: .ticket viewname $creatorname. \r\nReturns details about specified ticket. Ticket must be open and not deleted.'),
|
||||
('titles add',2,'Syntax: .titles add #title\r\nAdd title #title (id or shift-link) to known titles list for selected player.'),
|
||||
@@ -684,7 +683,7 @@ INSERT INTO `command` VALUES
|
||||
('unban character','3','Syntax: .unban character $Name\r\nUnban accounts for character name pattern.'),
|
||||
('unban ip','3','Syntax : .unban ip $Ip\r\nUnban accounts for IP pattern.'),
|
||||
('unbindsight','3','Syntax: .unbindsight\r\n\r\nRemoves bound vision. Cannot be used while currently possessing a target.'),
|
||||
('unfreeze','2','Syntax: .unfreeze (#player)\r\n\"Unfreezes\" #player and enables his chat again. When using this without #name it will unfreeze your target.'),
|
||||
('unfreeze','1','Syntax: .unfreeze (#player)\r\n\"Unfreezes\" #player and enables his chat again. When using this without #name it will unfreeze your target.'),
|
||||
('unlearn','3','Syntax: .unlearn #spell [all]\r\n\r\nUnlearn for selected player a spell #spell. If \'all\' provided then all ranks unlearned.'),
|
||||
('unmute','1','Syntax: .unmute [$playerName]\r\n\r\nRestore chat messaging for any character from account of character $playerName (or selected). Character can be ofline.'),
|
||||
('unpossess','3','Syntax: .unpossess\r\n\r\nIf you are possessed, unpossesses yourself; otherwise unpossesses current possessed target.'),
|
||||
|
||||
+7
-7
@@ -75,7 +75,7 @@ ChatCommand * ChatHandler::getCommandTable()
|
||||
|
||||
static ChatCommand accountCommandTable[] =
|
||||
{
|
||||
{ "addon", SEC_PLAYER, false, &ChatHandler::HandleAccountAddonCommand, "", NULL },
|
||||
{ "addon", SEC_MODERATOR, false, &ChatHandler::HandleAccountAddonCommand, "", NULL },
|
||||
{ "create", SEC_CONSOLE, true, &ChatHandler::HandleAccountCreateCommand, "", NULL },
|
||||
{ "delete", SEC_CONSOLE, true, &ChatHandler::HandleAccountDeleteCommand, "", NULL },
|
||||
{ "onlinelist", SEC_CONSOLE, true, &ChatHandler::HandleAccountOnlineListCommand, "", NULL },
|
||||
@@ -384,7 +384,7 @@ ChatCommand * ChatHandler::getCommandTable()
|
||||
{ "tame", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcTameCommand, "", NULL },
|
||||
{ "setdeathstate", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcSetDeathStateCommand, "", NULL },
|
||||
{ "addformation", SEC_MODERATOR, false, &ChatHandler::HandleNpcAddFormationCommand, "", NULL },
|
||||
{ "setlink", SEC_MODERATOR, false, &ChatHandler::HandleNpcSetLinkCommand, "", NULL },
|
||||
{ "setlink", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcSetLinkCommand, "", NULL },
|
||||
|
||||
//{ TODO: fix or remove this commands
|
||||
{ "addweapon", SEC_ADMINISTRATOR, false, &ChatHandler::HandleNpcAddWeaponCommand, "", NULL },
|
||||
@@ -447,7 +447,7 @@ ChatCommand * ChatHandler::getCommandTable()
|
||||
{ "creature_ai_summons", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadEventAISummonsCommand, "", NULL },
|
||||
{ "creature_ai_texts", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadEventAITextsCommand, "", NULL },
|
||||
{ "creature_involvedrelation", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadCreatureQuestInvRelationsCommand,"",NULL },
|
||||
{ "creature_linked_respawn", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadCreatureLinkedRespawnCommand, "", NULL },
|
||||
{ "creature_linked_respawn", SEC_GAMEMASTER, true, &ChatHandler::HandleReloadCreatureLinkedRespawnCommand, "", NULL },
|
||||
{ "creature_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesCreatureCommand, "", NULL },
|
||||
{ "creature_questrelation", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadCreatureQuestRelationsCommand, "", NULL },
|
||||
//{ "db_script_string", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadDbScriptStringCommand, "", NULL },
|
||||
@@ -736,15 +736,15 @@ ChatCommand * ChatHandler::getCommandTable()
|
||||
{ "repairitems", SEC_GAMEMASTER, true, &ChatHandler::HandleRepairitemsCommand, "", NULL },
|
||||
{ "waterwalk", SEC_GAMEMASTER, false, &ChatHandler::HandleWaterwalkCommand, "", NULL },
|
||||
|
||||
{ "freeze", SEC_ADMINISTRATOR, false, &ChatHandler::HandleFreezeCommand, "", NULL },
|
||||
{ "unfreeze", SEC_ADMINISTRATOR, false, &ChatHandler::HandleUnFreezeCommand, "", NULL },
|
||||
{ "listfreeze", SEC_ADMINISTRATOR, false, &ChatHandler::HandleListFreezeCommand, "", NULL },
|
||||
{ "freeze", SEC_MODERATOR, false, &ChatHandler::HandleFreezeCommand, "", NULL },
|
||||
{ "unfreeze", SEC_MODERATOR, false, &ChatHandler::HandleUnFreezeCommand, "", NULL },
|
||||
{ "listfreeze", SEC_MODERATOR, false, &ChatHandler::HandleListFreezeCommand, "", NULL },
|
||||
|
||||
{ "possess", SEC_ADMINISTRATOR, false, &ChatHandler::HandlePossessCommand, "", NULL },
|
||||
{ "unpossess", SEC_ADMINISTRATOR, false, &ChatHandler::HandleUnPossessCommand, "", NULL },
|
||||
{ "bindsight", SEC_ADMINISTRATOR, false, &ChatHandler::HandleBindSightCommand, "", NULL },
|
||||
{ "unbindsight", SEC_ADMINISTRATOR, false, &ChatHandler::HandleUnbindSightCommand, "", NULL },
|
||||
{ "playall", SEC_ADMINISTRATOR, false, &ChatHandler::HandlePlayAllCommand, "", NULL },
|
||||
{ "playall", SEC_GAMEMASTER, false, &ChatHandler::HandlePlayAllCommand, "", NULL },
|
||||
{ NULL, 0, false, NULL, "", NULL }
|
||||
};
|
||||
|
||||
|
||||
@@ -3988,7 +3988,7 @@ void ObjectMgr::LoadQuests()
|
||||
}
|
||||
}
|
||||
|
||||
if(qinfo->RewSpellCast)
|
||||
if(qinfo->RewSpellCast > 0)
|
||||
{
|
||||
SpellEntry const* spellInfo = sSpellStore.LookupEntry(qinfo->RewSpellCast);
|
||||
|
||||
|
||||
+45
-79
@@ -120,69 +120,49 @@ struct TargetDistanceOrder : public std::binary_function<const Unit *, const Uni
|
||||
|
||||
Unit* UnitAI::SelectTarget(SelectAggroTarget targetType, uint32 position, float dist, bool playerOnly, int32 aura)
|
||||
{
|
||||
if(targetType == SELECT_TARGET_NEAREST || targetType == SELECT_TARGET_FARTHEST)
|
||||
{
|
||||
std::list<HostilReference*> &m_threatlist = me->getThreatManager().getThreatList();
|
||||
if(position >= m_threatlist.size())
|
||||
const std::list<HostilReference *> &threatlist = me->getThreatManager().getThreatList();
|
||||
std::list<Unit*> targetList;
|
||||
|
||||
if (position >= threatlist.size())
|
||||
return NULL;
|
||||
|
||||
std::list<Unit*> targetList;
|
||||
for (std::list<HostilReference*>::iterator itr = m_threatlist.begin(); itr!= m_threatlist.end(); ++itr)
|
||||
for (std::list<HostilReference*>::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
|
||||
if (SelectTargetHelper(me, (*itr)->getTarget(), playerOnly, dist, aura))
|
||||
targetList.push_back((*itr)->getTarget());
|
||||
|
||||
if (position >= targetList.size())
|
||||
return NULL;
|
||||
|
||||
if (targetType == SELECT_TARGET_NEAREST || targetType == SELECT_TARGET_FARTHEST)
|
||||
targetList.sort(TargetDistanceOrder(me));
|
||||
|
||||
if(targetType == SELECT_TARGET_NEAREST)
|
||||
switch(targetType)
|
||||
{
|
||||
std::list<Unit*>::iterator i = targetList.begin();
|
||||
advance(i, position);
|
||||
return *i;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::list<Unit*>::reverse_iterator i = targetList.rbegin();
|
||||
advance(i, position);
|
||||
return *i;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
std::list<HostilReference*> m_threatlist = me->getThreatManager().getThreatList();
|
||||
std::list<HostilReference*>::iterator i;
|
||||
while(position < m_threatlist.size())
|
||||
{
|
||||
if(targetType == SELECT_TARGET_BOTTOMAGGRO)
|
||||
{
|
||||
i = m_threatlist.end();
|
||||
advance(i, - (int32)position - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
i = m_threatlist.begin();
|
||||
if(targetType == SELECT_TARGET_TOPAGGRO)
|
||||
advance(i, position);
|
||||
else // random
|
||||
{
|
||||
//advance(i, position + rand()%(m_threatlist.size() - position));
|
||||
//if we use "random, 1", usually we want random except current victim
|
||||
advance(i, rand()%m_threatlist.size());
|
||||
if(position && (*i)->getTarget() == me->getVictim())
|
||||
{
|
||||
m_threatlist.erase(i);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
case SELECT_TARGET_NEAREST:
|
||||
case SELECT_TARGET_TOPAGGRO:
|
||||
{
|
||||
std::list<Unit*>::iterator itr = targetList.begin();
|
||||
advance(itr, position);
|
||||
return *itr;
|
||||
}
|
||||
break;
|
||||
|
||||
if(SelectTargetHelper(me, (*i)->getTarget(), playerOnly, dist, aura))
|
||||
return (*i)->getTarget();
|
||||
else
|
||||
m_threatlist.erase(i);
|
||||
case SELECT_TARGET_FARTHEST:
|
||||
case SELECT_TARGET_BOTTOMAGGRO:
|
||||
{
|
||||
std::list<Unit*>::reverse_iterator ritr = targetList.rbegin();
|
||||
advance(ritr, position);
|
||||
return *ritr;
|
||||
}
|
||||
break;
|
||||
|
||||
case SELECT_TARGET_RANDOM:
|
||||
{
|
||||
std::list<Unit*>::iterator itr = targetList.begin();
|
||||
advance(itr, urand(position, targetList.size()-1));
|
||||
return *itr;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -190,47 +170,33 @@ Unit* UnitAI::SelectTarget(SelectAggroTarget targetType, uint32 position, float
|
||||
|
||||
void UnitAI::SelectTargetList(std::list<Unit*> &targetList, uint32 num, SelectAggroTarget targetType, float dist, bool playerOnly, int32 aura)
|
||||
{
|
||||
if(targetType == SELECT_TARGET_NEAREST || targetType == SELECT_TARGET_FARTHEST)
|
||||
{
|
||||
std::list<HostilReference*> &m_threatlist = me->getThreatManager().getThreatList();
|
||||
if(m_threatlist.empty())
|
||||
const std::list<HostilReference*> &threatlist = me->getThreatManager().getThreatList();
|
||||
|
||||
if (threatlist.empty())
|
||||
return;
|
||||
|
||||
for (std::list<HostilReference*>::iterator itr = m_threatlist.begin(); itr!= m_threatlist.end(); ++itr)
|
||||
for (std::list<HostilReference*>::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
|
||||
if (SelectTargetHelper(me, (*itr)->getTarget(), playerOnly, dist, aura))
|
||||
targetList.push_back((*itr)->getTarget());
|
||||
|
||||
if (targetType == SELECT_TARGET_NEAREST || targetType == SELECT_TARGET_FARTHEST)
|
||||
{
|
||||
targetList.sort(TargetDistanceOrder(me));
|
||||
targetList.resize(num);
|
||||
if(targetType == SELECT_TARGET_FARTHEST)
|
||||
targetList.reverse();
|
||||
}
|
||||
else
|
||||
{
|
||||
std::list<HostilReference*> m_threatlist = me->getThreatManager().getThreatList();
|
||||
std::list<HostilReference*>::iterator i;
|
||||
while(!m_threatlist.empty() && num)
|
||||
{
|
||||
if(targetType == SELECT_TARGET_BOTTOMAGGRO)
|
||||
{
|
||||
i = m_threatlist.end();
|
||||
--i;
|
||||
}
|
||||
else
|
||||
{
|
||||
i = m_threatlist.begin();
|
||||
if(targetType == SELECT_TARGET_RANDOM)
|
||||
advance(i, rand()%m_threatlist.size());
|
||||
}
|
||||
|
||||
if(SelectTargetHelper(me, (*i)->getTarget(), playerOnly, dist, aura))
|
||||
if (targetType == SELECT_TARGET_FARTHEST || targetType == SELECT_TARGET_BOTTOMAGGRO)
|
||||
targetList.reverse();
|
||||
|
||||
if (targetType == SELECT_TARGET_RANDOM)
|
||||
{
|
||||
targetList.push_back((*i)->getTarget());
|
||||
--num;
|
||||
}
|
||||
m_threatlist.erase(i);
|
||||
while (num > targetList.size()) {
|
||||
std::list<Unit*>::iterator itr = targetList.begin();
|
||||
advance(itr, urand(0, targetList.size()-1));
|
||||
targetList.erase(itr);
|
||||
}
|
||||
}
|
||||
else
|
||||
targetList.resize(num);
|
||||
}
|
||||
|
||||
float UnitAI::DoGetSpellMaxRange(uint32 spellId, bool positive)
|
||||
|
||||
@@ -41,9 +41,6 @@ enum Phases
|
||||
PHASE_DANCE,
|
||||
};
|
||||
|
||||
//Spell by eye stalks
|
||||
#define SPELL_MIND_FLAY 26143
|
||||
|
||||
struct TRINITY_DLL_DECL boss_heiganAI : public BossAI
|
||||
{
|
||||
boss_heiganAI(Creature *c) : BossAI(c, BOSS_HEIGAN) {}
|
||||
@@ -78,10 +75,10 @@ struct TRINITY_DLL_DECL boss_heiganAI : public BossAI
|
||||
eruptSection = 3;
|
||||
if (phase == PHASE_FIGHT)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_DISRUPT, 0);
|
||||
events.ScheduleEvent(EVENT_FEVER, 20000);
|
||||
events.ScheduleEvent(EVENT_PHASE, 85000);
|
||||
events.ScheduleEvent(EVENT_ERUPT, 10000);
|
||||
events.ScheduleEvent(EVENT_DISRUPT, urand(10000, 25000));
|
||||
events.ScheduleEvent(EVENT_FEVER, urand(15000, 20000));
|
||||
events.ScheduleEvent(EVENT_PHASE, 90000);
|
||||
events.ScheduleEvent(EVENT_ERUPT, 15000);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -90,7 +87,7 @@ struct TRINITY_DLL_DECL boss_heiganAI : public BossAI
|
||||
me->NearTeleportTo(x, y, z, o);
|
||||
DoCastAOE(SPELL_PLAGUE_CLOUD);
|
||||
events.ScheduleEvent(EVENT_PHASE, 45000);
|
||||
events.ScheduleEvent(EVENT_ERUPT, 5000);
|
||||
events.ScheduleEvent(EVENT_ERUPT, 8000);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,15 +104,16 @@ struct TRINITY_DLL_DECL boss_heiganAI : public BossAI
|
||||
{
|
||||
case EVENT_DISRUPT:
|
||||
DoCastAOE(SPELL_SPELL_DISRUPTION);
|
||||
events.ScheduleEvent(EVENT_DISRUPT, 5000);
|
||||
return;
|
||||
events.ScheduleEvent(EVENT_DISRUPT, urand(5000, 10000));
|
||||
break;
|
||||
case EVENT_FEVER:
|
||||
DoCastAOE(SPELL_DECREPIT_FEVER);
|
||||
events.ScheduleEvent(EVENT_FEVER, 20000);
|
||||
return;
|
||||
events.ScheduleEvent(EVENT_FEVER, urand(20000, 25000));
|
||||
break;
|
||||
case EVENT_PHASE:
|
||||
// TODO : Add missing texts for both phase switches
|
||||
EnterPhase(phase == PHASE_FIGHT ? PHASE_DANCE : PHASE_FIGHT);
|
||||
return;
|
||||
break;
|
||||
case EVENT_ERUPT:
|
||||
instance->SetData(DATA_HEIGAN_ERUPT, eruptSection);
|
||||
TeleportCheaters();
|
||||
|
||||
@@ -298,7 +298,7 @@ struct TRINITY_DLL_DECL boss_kelthuzadAI : public BossAI
|
||||
events.RepeatEvent(urand(10000,45000));
|
||||
break;
|
||||
case EVENT_BLAST:
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true))
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 0, true))
|
||||
DoCast(pTarget, SPELL_FROST_BLAST);
|
||||
if (rand()%2)
|
||||
DoScriptText(SAY_FROST_BLAST, m_creature);
|
||||
|
||||
@@ -18,22 +18,33 @@
|
||||
|
||||
#include "ScriptedPch.h"
|
||||
#include "naxxramas.h"
|
||||
#include "SpellId.h"
|
||||
|
||||
#define SPELL_WEB_WRAP 28622
|
||||
#define SPELL_WEB_SPRAY RAID_MODE(29484,54125)
|
||||
#define SPELL_POISON_SHOCK RAID_MODE(28741,54122)
|
||||
#define SPELL_NECROTIC_POISON RAID_MODE(54121,28776)
|
||||
#define SPELL_FRENZY RAID_MODE(54123,54124)
|
||||
enum Spells
|
||||
{
|
||||
SPELL_WEB_WRAP = SPELL_WEB_WRAP_28622,
|
||||
SPELL_WEB_SPRAY_10 = SPELL_WEB_SPRAY_29484,
|
||||
SPELL_WEB_SPRAY_25 = SPELL_WEB_SPRAY_54125,
|
||||
SPELL_POISON_SHOCK_10 = SPELL_POISON_SHOCK_28741,
|
||||
SPELL_POISON_SHOCK_25 = SPELL_POISON_SHOCK_54122,
|
||||
SPELL_NECROTIC_POISON_10 = SPELL_NECROTIC_POISON_28776,
|
||||
SPELL_NECROTIC_POISON_25 = SPELL_NECROTIC_POISON_54121,
|
||||
SPELL_FRENZY_10 = SPELL_FRENZY_54123,
|
||||
SPELL_FRENZY_25 = SPELL_FRENZY_54124,
|
||||
};
|
||||
|
||||
#define MOB_WEB_WRAP 16486
|
||||
#define MOB_SPIDERLING 17055
|
||||
enum Creatures
|
||||
{
|
||||
MOB_WEB_WRAP = 16486,
|
||||
MOB_SPIDERLING = 17055,
|
||||
};
|
||||
|
||||
#define MAX_POS_WRAP 3
|
||||
const float PosWrap[MAX_POS_WRAP][3] =
|
||||
const Position PosWrap[MAX_POS_WRAP] =
|
||||
{
|
||||
{3546.796, -3869.082, 296.450},
|
||||
{3531.271, -3847.424, 299.450},
|
||||
{3497.067, -3843.384, 302.384},
|
||||
{3546.796, -3869.082, 296.450, 0.0},
|
||||
{3531.271, -3847.424, 299.450, 0.0},
|
||||
{3497.067, -3843.384, 302.384, 0.0},
|
||||
};
|
||||
|
||||
enum Events
|
||||
@@ -44,6 +55,7 @@ enum Events
|
||||
EVENT_POISON,
|
||||
EVENT_WRAP,
|
||||
EVENT_SUMMON,
|
||||
EVENT_FRENZY,
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL boss_maexxnaAI : public BossAI
|
||||
@@ -58,9 +70,9 @@ struct TRINITY_DLL_DECL boss_maexxnaAI : public BossAI
|
||||
enraged = false;
|
||||
events.ScheduleEvent(EVENT_WRAP, 20000);
|
||||
events.ScheduleEvent(EVENT_SPRAY, 40000);
|
||||
events.ScheduleEvent(EVENT_SHOCK, 10000);
|
||||
events.ScheduleEvent(EVENT_POISON, 5000);
|
||||
events.ScheduleEvent(EVENT_SUMMON, 40000);
|
||||
events.ScheduleEvent(EVENT_SHOCK, urand(5000,10000));
|
||||
events.ScheduleEvent(EVENT_POISON, urand(10000,15000));
|
||||
events.ScheduleEvent(EVENT_SUMMON, 30000);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
@@ -68,6 +80,12 @@ struct TRINITY_DLL_DECL boss_maexxnaAI : public BossAI
|
||||
if (!UpdateVictim() || !CheckInRoom())
|
||||
return;
|
||||
|
||||
if (!enraged && HealthBelowPct(30))
|
||||
{
|
||||
enraged = true;
|
||||
events.ScheduleEvent(EVENT_FRENZY, 0); // will be cast immediately
|
||||
}
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
while(uint32 eventId = events.ExecuteEvent())
|
||||
@@ -75,52 +93,69 @@ struct TRINITY_DLL_DECL boss_maexxnaAI : public BossAI
|
||||
switch(eventId)
|
||||
{
|
||||
case EVENT_WRAP:
|
||||
// TODO : Add missing text
|
||||
for (uint8 i = 0; i < RAID_MODE(1,2); ++i)
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 0, true, -SPELL_WEB_WRAP))
|
||||
{
|
||||
pTarget->RemoveAura(SPELL_WEB_SPRAY);
|
||||
pTarget->RemoveAura(RAID_MODE(SPELL_WEB_SPRAY_10,SPELL_WEB_SPRAY_25));
|
||||
uint8 pos = rand()%MAX_POS_WRAP;
|
||||
pTarget->GetMotionMaster()->MoveJump(PosWrap[pos][0], PosWrap[pos][1], PosWrap[pos][2], 20, 20);
|
||||
if (Creature *wrap = DoSummon(MOB_WEB_WRAP, pTarget, 0, 60000))
|
||||
{
|
||||
pTarget->GetMotionMaster()->MoveJump(PosWrap[pos].GetPositionX(), PosWrap[pos].GetPositionY(), PosWrap[pos].GetPositionZ(), 20, 20);
|
||||
if (Creature *wrap = DoSummon(MOB_WEB_WRAP, PosWrap[pos], 0, TEMPSUMMON_CORPSE_DESPAWN))
|
||||
wrap->AI()->SetGUID(pTarget->GetGUID());
|
||||
wrap->GetMotionMaster()->MoveJump(PosWrap[pos][0], PosWrap[pos][1], PosWrap[pos][2], 20, 20);
|
||||
}
|
||||
}
|
||||
}
|
||||
events.ScheduleEvent(EVENT_WRAP, 40000);
|
||||
return;
|
||||
break;
|
||||
case EVENT_SPRAY:
|
||||
DoCastAOE(SPELL_WEB_SPRAY);
|
||||
DoCastAOE(RAID_MODE(SPELL_WEB_SPRAY_10,SPELL_WEB_SPRAY_25));
|
||||
events.ScheduleEvent(EVENT_SPRAY, 40000);
|
||||
return;
|
||||
break;
|
||||
case EVENT_SHOCK:
|
||||
DoCastAOE(SPELL_POISON_SHOCK);
|
||||
events.ScheduleEvent(EVENT_SHOCK, 10000);
|
||||
return;
|
||||
DoCastAOE(RAID_MODE(SPELL_POISON_SHOCK_10,SPELL_POISON_SHOCK_25));
|
||||
events.ScheduleEvent(EVENT_SHOCK, urand(10000,20000));
|
||||
break;
|
||||
case EVENT_POISON:
|
||||
DoCast(me->getVictim(), SPELL_NECROTIC_POISON);
|
||||
events.ScheduleEvent(EVENT_POISON, 30000);
|
||||
return;
|
||||
DoCast(me->getVictim(), RAID_MODE(SPELL_NECROTIC_POISON_10,SPELL_NECROTIC_POISON_25));
|
||||
events.ScheduleEvent(EVENT_POISON, urand(10000, 20000));
|
||||
break;
|
||||
case EVENT_FRENZY:
|
||||
DoCast(me, RAID_MODE(SPELL_FRENZY_10,SPELL_FRENZY_25), true);
|
||||
events.ScheduleEvent(EVENT_FRENZY, 600000);
|
||||
break;
|
||||
case EVENT_SUMMON:
|
||||
{
|
||||
// TODO : Add missing text
|
||||
uint8 amount = urand(8,10);
|
||||
for (uint8 i = 0; i < amount; ++i)
|
||||
DoSummon(MOB_SPIDERLING, me);
|
||||
DoSummon(MOB_SPIDERLING, me, 0, TEMPSUMMON_CORPSE_DESPAWN);
|
||||
events.ScheduleEvent(EVENT_SUMMON, 40000);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL mob_webwrapAI : public NullCreatureAI
|
||||
{
|
||||
mob_webwrapAI(Creature *c) : NullCreatureAI(c), victimGUID(0) {}
|
||||
|
||||
uint64 victimGUID;
|
||||
|
||||
void SetGUID(const uint64 &guid, int32 param)
|
||||
{
|
||||
victimGUID = guid;
|
||||
if (me->m_spells[0] && victimGUID)
|
||||
if (Unit *victim = Unit::GetUnit(*me, victimGUID))
|
||||
victim->CastSpell(victim, me->m_spells[0], true, NULL, NULL, me->GetGUID());
|
||||
}
|
||||
|
||||
if (!enraged && HealthBelowPct(30))
|
||||
void JustDied(Unit *killer)
|
||||
{
|
||||
DoCast(me, SPELL_FRENZY);
|
||||
enraged = true;
|
||||
}
|
||||
else
|
||||
DoMeleeAttackIfReady();
|
||||
if (me->m_spells[0] && victimGUID)
|
||||
if (Unit *victim = Unit::GetUnit(*me, victimGUID))
|
||||
victim->RemoveAurasDueToSpell(me->m_spells[0], me->GetGUID());
|
||||
}
|
||||
};
|
||||
|
||||
@@ -129,6 +164,11 @@ CreatureAI* GetAI_boss_maexxna(Creature* pCreature)
|
||||
return new boss_maexxnaAI (pCreature);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_mob_webwrap(Creature* pCreature)
|
||||
{
|
||||
return new mob_webwrapAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_maexxna()
|
||||
{
|
||||
Script *newscript;
|
||||
@@ -137,5 +177,11 @@ void AddSC_boss_maexxna()
|
||||
newscript->Name = "boss_maexxna";
|
||||
newscript->GetAI = &GetAI_boss_maexxna;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "mob_webwrap";
|
||||
newscript->GetAI = &GetAI_mob_webwrap;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
|
||||
* 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
|
||||
@@ -196,28 +197,6 @@ struct TRINITY_DLL_DECL trigger_deathAI : public NullCreatureAI
|
||||
}
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL mob_webwrapAI : public NullCreatureAI
|
||||
{
|
||||
mob_webwrapAI(Creature *c) : NullCreatureAI(c), victimGUID(0) {}
|
||||
|
||||
uint64 victimGUID;
|
||||
|
||||
void SetGUID(const uint64 &guid, int32 param)
|
||||
{
|
||||
victimGUID = guid;
|
||||
if (me->m_spells[0] && victimGUID)
|
||||
if (Unit *victim = Unit::GetUnit(*me, victimGUID))
|
||||
victim->CastSpell(victim, me->m_spells[0], true, NULL, NULL, me->GetGUID());
|
||||
}
|
||||
|
||||
void JustDied(Unit *killer)
|
||||
{
|
||||
if (me->m_spells[0] && victimGUID)
|
||||
if (Unit *victim = Unit::GetUnit(*me, victimGUID))
|
||||
victim->RemoveAurasDueToSpell(me->m_spells[0], me->GetGUID());
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_trigger_periodic(Creature* pCreature)
|
||||
{
|
||||
return new trigger_periodicAI (pCreature);
|
||||
@@ -228,11 +207,6 @@ CreatureAI* GetAI_trigger_death(Creature* pCreature)
|
||||
return new trigger_deathAI (pCreature);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_mob_webwrap(Creature* pCreature)
|
||||
{
|
||||
return new mob_webwrapAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_generic_creature()
|
||||
{
|
||||
Script *newscript;
|
||||
@@ -250,10 +224,5 @@ void AddSC_generic_creature()
|
||||
newscript->Name = "trigger_death";
|
||||
newscript->GetAI = &GetAI_trigger_death;
|
||||
newscript->RegisterSelf();*/
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "mob_webwrap";
|
||||
newscript->GetAI = &GetAI_mob_webwrap;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user