Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4

Conflicts:
	src/server/game/Scripting/ScriptLoader.cpp
This commit is contained in:
Vincent-Michael
2013-08-11 00:27:54 +02:00
14 changed files with 271 additions and 20 deletions

View File

@@ -17,9 +17,11 @@ DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=10
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(15,10024,0,0,28,12521,0,0,0,'','Show gossip option if player has quest Where in the World is Hemet Nesingwary?');
DELETE FROM `gossip_menu_option` WHERE `menu_id`=10024 AND `id`=1;
-- Add spell target position
DELETE FROM `spell_target_position` WHERE `id`=50859;
DELETE FROM `spell_target_position` WHERE `id`=50987;
INSERT INTO `spell_target_position` (`id`,`target_map`,`target_position_x`,`target_position_y`,`target_position_z`,`target_orientation`) VALUES
(50859,571,5832.892,482.8708,658.2753,0.9121326);
(50987,571,5071.35,4642.54,72.164,0.878587);
-- Update Archmage Pentarus' Flying Machine
UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry`=28192;

View File

@@ -0,0 +1,15 @@
UPDATE `creature_template` SET `AIName` = 'NullAI' WHERE `entry` = 27490;
UPDATE `creature_template` SET `unit_flags` = 64 WHERE `entry` = 31339;
UPDATE `creature_template` SET `ScriptName` = '', AIName = 'SmartAI' WHERE `entry` = 26638;
DELETE FROM `smart_scripts` WHERE `entryorguid` = 26638 AND `source_type` = 0;
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(26638, 0, 1, 0, 0, 0, 100, 6, 0, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Risen Drakkari Bat Rider - In Combat - Dismount"),
(26638, 0, 2, 0, 0, 0, 100, 6, 0, 0, 0, 0, 19, 0x02000000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Risen Drakkari Bat Rider - In Combat - Remove flag"),
(26638, 0, 3, 0, 9, 0, 100, 6, 5, 30, 9000, 12000, 11, 16001, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, "Risen Drakkari Bat Rider - At 5 - 30 Range - Cast Impale"),
(26638, 0, 4, 0, 0, 0, 100, 2, 3000, 6000, 9000, 12000, 11, 50414, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Risen Drakkari Bat Rider - In Combat - Cast Curse of Blood"),
(26638, 0, 5, 0, 0, 0, 100, 4, 3000, 6000, 9000, 12000, 11, 59009, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Risen Drakkari Bat Rider - In Combat - Cast Curse of Blood");
DELETE FROM `creature_addon` WHERE `guid` = 127448;
INSERT INTO `creature_addon` (`guid`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `auras`) VALUES
(127448, 0, 26751, 0, 1, 0, '');

View File

@@ -0,0 +1,4 @@
DELETE FROM `spell_target_position` WHERE `id`=50859;
DELETE FROM `spell_target_position` WHERE `id`=50987;
INSERT INTO `spell_target_position` (`id`,`target_map`,`target_position_x`,`target_position_y`,`target_position_z`,`target_orientation`) VALUES
(50987,571,5832.892,482.8708,658.2753,0.9121326);

View File

@@ -0,0 +1,10 @@
SET @NPC := 7271;
-- Move boss_zum_rah from SAI to CPP
UPDATE `creature_template` SET `AIName`= '', `ScriptName`= 'boss_zum_rah' WHERE `entry`=@NPC;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@NPC;
DELETE FROM `creature_text` WHERE `entry` =@NPC;
INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES
(@NPC, 0, 0, 'How dare you enter my sanctum!', 12, 0, 100, 0, 0, 0, 'Witch Doctor Zum''rah'),
(@NPC, 1, 1, 'T''eif godehsi wha!', 14, 14, 100, 0, 0, 0, 'Witch Doctor Zum''rah'),
(@NPC, 2, 2, 'Sands consume you!', 14, 0, 100, 0, 0, 0, 'Witch Doctor Zum''rah'),
(@NPC, 2, 3, 'Fall!', 14, 0, 100, 0, 0, 0, 'Witch Doctor Zum''rah');

View File

@@ -2097,13 +2097,47 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
GetBaseObject()->SummonCreatureGroup(e.action.creatureGroup.group, &summonList);
for (std::list<TempSummon*>::const_iterator itr = summonList.begin(); itr != summonList.end(); ++itr)
{
if (unit && e.action.creatureGroup.attackInvoker)
(*itr)->AI()->AttackStart(unit);
}
break;
}
case SMART_ACTION_SET_POWER:
{
ObjectList* targets = GetTargets(e, unit);
if (targets)
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
if (IsUnit(*itr))
(*itr)->ToUnit()->SetPower(Powers(e.action.power.powerType), e.action.power.newPower);
delete targets;
break;
}
case SMART_ACTION_ADD_POWER:
{
ObjectList* targets = GetTargets(e, unit);
if (targets)
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
if (IsUnit(*itr))
(*itr)->ToUnit()->SetPower(Powers(e.action.power.powerType), (*itr)->ToUnit()->GetPower(Powers(e.action.power.powerType)) + e.action.power.newPower);
delete targets;
break;
}
case SMART_ACTION_REMOVE_POWER:
{
ObjectList* targets = GetTargets(e, unit);
if (targets)
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
if (IsUnit(*itr))
(*itr)->ToUnit()->SetPower(Powers(e.action.power.powerType), (*itr)->ToUnit()->GetPower(Powers(e.action.power.powerType)) - e.action.power.newPower);
delete targets;
break;
}
default:
TC_LOG_ERROR(LOG_FILTER_SQL, "SmartScript::ProcessAction: Entry %d SourceType %u, Event %u, Unhandled Action type %u", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
break;

View File

@@ -838,6 +838,15 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
return false;
break;
}
case SMART_ACTION_SET_POWER:
case SMART_ACTION_ADD_POWER:
case SMART_ACTION_REMOVE_POWER:
if (e.action.power.powerType > MAX_POWERS)
{
TC_LOG_ERROR(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Power %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.power.powerType);
return false;
}
break;
case SMART_ACTION_FOLLOW:
case SMART_ACTION_SET_ORIENTATION:
case SMART_ACTION_STORE_TARGET_LIST:

View File

@@ -490,8 +490,11 @@ enum SMART_ACTION
SMART_ACTION_ADD_GO_FLAG = 105, // Flags
SMART_ACTION_REMOVE_GO_FLAG = 106, // Flags
SMART_ACTION_SUMMON_CREATURE_GROUP = 107, // Group, attackInvoker
SMART_ACTION_SET_POWER = 108, // PowerType, newPower
SMART_ACTION_ADD_POWER = 109, // PowerType, newPower
SMART_ACTION_REMOVE_POWER = 110, // PowerType, newPower
SMART_ACTION_END = 108
SMART_ACTION_END = 111
};
struct SmartAction
@@ -945,6 +948,12 @@ struct SmartAction
uint32 attackInvoker;
} creatureGroup;
struct
{
uint32 powerType;
uint32 newPower;
} power;
//! Note for any new future actions
//! All parameters must have type uint32

View File

@@ -1623,7 +1623,7 @@ void BattlegroundAV::ResetBGSubclass()
bool BattlegroundAV::CheckAchievementCriteriaMeet(uint32 criteriaId, Player const* source, Unit const* target, uint32 miscValue)
{
uint8 team = source->GetTeam();
uint32 team = source->GetTeam();
switch (criteriaId)
{
case BG_CRITERIA_CHECK_EVERYTHING_COUNTS:

View File

@@ -337,8 +337,9 @@ void AddSC_npc_anubisath_sentinel();
void AddSC_instance_temple_of_ahnqiraj();
void AddSC_wailing_caverns(); //Wailing caverns
void AddSC_instance_wailing_caverns();
void AddSC_zulfarrak(); //Zul'Farrak generic
void AddSC_instance_zulfarrak(); //Zul'Farrak instance script
void AddSC_boss_zum_rah(); //Zul'Farrak
void AddSC_zulfarrak();
void AddSC_instance_zulfarrak();
void AddSC_instance_halls_of_origination();
void AddSC_boss_temple_guardian_anhuur();
void AddSC_boss_earthrager_ptah();
@@ -1001,8 +1002,9 @@ void AddKalimdorScripts()
AddSC_instance_temple_of_ahnqiraj();
AddSC_wailing_caverns(); //Wailing caverns
AddSC_instance_wailing_caverns();
AddSC_zulfarrak(); //Zul'Farrak generic
AddSC_instance_zulfarrak(); //Zul'Farrak instance script
AddSC_boss_zum_rah(); //Zul'Farrak
AddSC_zulfarrak();
AddSC_instance_zulfarrak();
AddSC_ashenvale();
AddSC_azshara();

View File

@@ -20,6 +20,7 @@ set(scripts_STAT_SRCS
Kalimdor/ZulFarrak/zulfarrak.h
Kalimdor/ZulFarrak/zulfarrak.cpp
Kalimdor/ZulFarrak/instance_zulfarrak.cpp
Kalimdor/ZulFarrak/boss_zum_rah.cpp
Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp
Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.h
Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp

View File

@@ -0,0 +1,160 @@
/*
* Copyright (C) 2008-2013 TrinityCore <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, see <http://www.gnu.org/licenses/>.
*/
/*
Name: Boss_Zum_Rah
Category: Tanaris, ZulFarrak
*/
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "zulfarrak.h"
enum Says
{
SAY_SANCT_INVADE = 0,
SAY_WARD = 1,
SAY_KILL = 2
};
enum Spells
{
SPELL_SHADOW_BOLT = 12739,
SPELL_SHADOWBOLT_VOLLEY = 15245,
SPELL_WARD_OF_ZUM_RAH = 11086,
SPELL_HEALING_WAVE = 12491
};
enum Events
{
EVENT_SHADOW_BOLT = 1,
EVENT_SHADOWBOLT_VOLLEY = 2,
EVENT_WARD_OF_ZUM_RAH = 3,
EVENT_HEALING_WAVE = 4
};
enum Faction
{
ZUMRAH_FRIENDLY_FACTION = 35
};
class boss_zum_rah : public CreatureScript
{
public:
boss_zum_rah() : CreatureScript("boss_zum_rah") { }
struct boss_zum_rahAI : public BossAI
{
boss_zum_rahAI(Creature* creature) : BossAI(creature, DATA_ZUM_RAH) { }
void Reset() OVERRIDE
{
me->setFaction(ZUMRAH_FRIENDLY_FACTION); // areatrigger sets faction to enemy
_ward80 = false;
_ward40 = false;
_heal30 = false;
}
void EnterCombat(Unit* /*who*/) OVERRIDE
{
Talk(SAY_SANCT_INVADE);
events.ScheduleEvent(EVENT_SHADOW_BOLT, 1000);
events.ScheduleEvent(EVENT_SHADOWBOLT_VOLLEY, 10000);
}
void JustDied(Unit* /*killer*/) OVERRIDE
{
if (instance)
instance->SetData(DATA_ZUM_RAH, DONE);
}
void KilledUnit(Unit* /*victim*/) OVERRIDE
{
Talk(SAY_KILL);
}
void UpdateAI(uint32 diff) OVERRIDE
{
if (!UpdateVictim())
return;
events.Update(diff);
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_SHADOW_BOLT:
DoCastVictim(SPELL_SHADOW_BOLT);
events.ScheduleEvent(EVENT_SHADOW_BOLT, 4000);
break;
case EVENT_WARD_OF_ZUM_RAH:
DoCast(me,SPELL_WARD_OF_ZUM_RAH);
break;
case EVENT_HEALING_WAVE:
DoCast(me,SPELL_HEALING_WAVE);
break;
case EVENT_SHADOWBOLT_VOLLEY:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(target, SPELL_SHADOWBOLT_VOLLEY);
events.ScheduleEvent(EVENT_SHADOWBOLT_VOLLEY, 9000);
break;
default:
break;
}
}
if (!_ward80 && HealthBelowPct(80))
{
_ward80 = true;
Talk(SAY_WARD);
events.ScheduleEvent(EVENT_WARD_OF_ZUM_RAH, 1000);
}
if (!_ward40 && HealthBelowPct(40))
{
_ward40 = true;
Talk(SAY_WARD);
events.ScheduleEvent(EVENT_WARD_OF_ZUM_RAH, 1000);
}
if (!_heal30 && HealthBelowPct(30))
{
_heal30 = true;
events.ScheduleEvent(EVENT_HEALING_WAVE, 3000);
}
DoMeleeAttackIfReady();
}
private:
bool _ward80;
bool _ward40;
bool _heal30;
};
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
return new boss_zum_rahAI(creature);
}
};
void AddSC_boss_zum_rah()
{
new boss_zum_rah();
}

View File

@@ -145,7 +145,7 @@ public:
{
switch (creature->GetEntry())
{
case ENTRY_ZUMRAH:
case ENTRY_ZUM_RAH:
ZumrahGUID = creature->GetGUID();
break;
case ENTRY_BLY:
@@ -201,7 +201,7 @@ public:
{
switch (data)
{
case ENTRY_ZUMRAH:
case ENTRY_ZUM_RAH:
return ZumrahGUID;
case ENTRY_BLY:
return BlyGUID;

View File

@@ -7,19 +7,24 @@
enum zfEntries
{
ENTRY_ZUMRAH = 7271,
ENTRY_BLY = 7604,
ENTRY_RAVEN = 7605,
ENTRY_ORO = 7606,
ENTRY_WEEGLI = 7607,
ENTRY_MURTA = 7608,
ENTRY_ZUM_RAH = 7271,
ENTRY_BLY = 7604,
ENTRY_RAVEN = 7605,
ENTRY_ORO = 7606,
ENTRY_WEEGLI = 7607,
ENTRY_MURTA = 7608,
GO_END_DOOR = 146084,
GO_END_DOOR = 146084,
EVENT_PYRAMID = 1,
EVENT_PYRAMID = 1,
EVENT_GAHZRILLA
};
enum DataTypes
{
DATA_ZUM_RAH = 0
};
enum zfPyramidPhases
{
PYRAMID_NOT_STARTED, //default