Skip to content

Commit

Permalink
IOC: añadido SPELL_LAUNCH_NO_FALLING_DAMAGE por manuel gracias.
Browse files Browse the repository at this point in the history
  • Loading branch information
Retriman committed Jun 26, 2011
1 parent e173859 commit 9618129
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 38 deletions.
5 changes: 4 additions & 1 deletion sql/Madobox_Update/Core/Isle_Of_Conquest.sql
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,7 @@ INSERT INTO `npc_spellclick_spells` (`npc_entry`,`spell_id`,`quest_start`,`quest
(35431,46598,0,0,0,1,0,0,0); -- Siege Engine - Isle of Conquest(1)

UPDATE creature_template SET speed_run=0 WHERE entry IN (36355,36357);
UPDATE creature_template SET npcflag=16777216 WHERE entry IN (34793,35273,35069,34776,34802,35431,35413,35419,35433,35421);
UPDATE creature_template SET npcflag=16777216 WHERE entry IN (34793,35273,35069,34776,34802,35431,35413,35419,35433,35421);

DELETE FROM `spell_script_names` WHERE `spell_id`=66218;
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES (66218,'spell_gen_launch');
73 changes: 36 additions & 37 deletions sql/Madobox_Update/Dungeon/[Dungeon][Wotlk]Ulduar_New.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1177,28 +1177,28 @@ UPDATE `quest_template` SET `PrevQuestId`=13816, `NextQuestId`=13818, `Exclusive
-- Ignis
UPDATE `creature_template` SET `mingold`=1190671, `maxgold`=1190671 WHERE `entry`=33118;
UPDATE `creature_template` SET `mingold`=1190671*2.5, `maxgold`=1190671*2.5 WHERE `entry`=33190;
- Razorscale
-- Razorscale
UPDATE `creature_template` SET `mingold`=325206, `maxgold`=325206 WHERE `entry`=33186;
UPDATE `creature_template` SET `mingold`=325206*2.5, `maxgold`=325206*2.5 WHERE `entry`=33724;
- XT-002
-- XT-002
UPDATE `creature_template` SET `mingold`=713762, `maxgold`=713762 WHERE `entry`=33293;
UPDATE `creature_template` SET `mingold`=713762*2.5, `maxgold`=713762*2.5 WHERE `entry`=33885;
- Steelbreaker
-- Steelbreaker
UPDATE `creature_template` SET `mingold`=1717186, `maxgold`=1717186 WHERE `entry`=32867;
UPDATE `creature_template` SET `mingold`=1717186*2.5, `maxgold`=1717186*2.5 WHERE `entry`=33693;
- Molgeim
-- Molgeim
UPDATE `creature_template` SET `mingold`=1763054, `maxgold`=1763054 WHERE `entry`=32927;
UPDATE `creature_template` SET `mingold`=1763054*2.5, `maxgold`=1763054*2.5 WHERE `entry`=33692;
- Brundir
-- Brundir
UPDATE `creature_template` SET `mingold`=1791922, `maxgold`=1791922 WHERE `entry`=32857;
UPDATE `creature_template` SET `mingold`=1791922*2.5, `maxgold`=1791922*2.5 WHERE `entry`=33694;
- Auriaya
-- Auriaya
UPDATE `creature_template` SET `mingold`=1366181, `maxgold`=1366181 WHERE `entry`=33515;
UPDATE `creature_template` SET `mingold`=1366181*2.5, `maxgold`=1366181*2.5 WHERE `entry`=34175;
- Vezax
-- Vezax
UPDATE `creature_template` SET `mingold`=1810711, `maxgold`=1810711 WHERE `entry`=33271;
UPDATE `creature_template` SET `mingold`=1810711*2.5, `maxgold`=1810711*2.5 WHERE `entry`=33449;
- Yogg-Saron
-- Yogg-Saron
UPDATE `creature_template` SET `mingold`=2128378, `maxgold`=2128378 WHERE `entry`=33288;
UPDATE `creature_template` SET `mingold`=2128378*2.5, `maxgold`=2128378*2.5 WHERE `entry`=33955;
-- Ulduar Proc Trinket's
Expand Down Expand Up @@ -1226,34 +1226,7 @@ INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `positi
('400007','194200','603','1','1','1966.07','-220.64','432.687','0.465871','0','0','0.230835','0.972993','604800','0','1'),
('400008','194201','603','2','1','1966.07','-220.64','432.687','0.465871','0','0','0.230835','0.972993','604800','0','1');


-- Fix Gold Loot of Ulduar
SET @Gold_10_Trash_min :=100000;
SET @Gold_10_Trash_max :=@Gold_10_Trash_min*1.5;
SET @Gold_25_Trash_min :=250000;
SET @Gold_25_Trash_max :=@Gold_25_Trash_min*1.5;

UPDATE creature_template SET creature_template.mingold = @Gold_10_Trash_min, creature_template.maxgold = @Gold_10_Trash_max
WHERE
entry IN (SELECT `id` FROM `creature` WHERE `map`=603) AND -- Ulduar Map
faction_A IN (14,16) AND
faction_H IN (14,16) AND
rank=1 AND
entry NOT IN (34234,33236,34164,34164,32872);


UPDATE creature_template INNER JOIN creature_template creat ON creature_template.entry = creat.difficulty_entry_1
SET creature_template.mingold = @Gold_25_Trash_min, creature_template.maxgold = @Gold_25_Trash_max
WHERE
creat.entry IN (SELECT `id` FROM `creature` WHERE `map`=603) AND -- Ulduar Map
creat.faction_A IN (14,16) AND
creat.faction_H IN (14,16) AND
creat.rank=1 AND
creat.entry NOT IN (34234,33236,34164,34164,32872);




-- SAI
-- ------------------
-- Flame Leviathane |
-- ------------------
Expand Down Expand Up @@ -1693,4 +1666,30 @@ DELETE FROM `smart_scripts` WHERE `entryorguid`=33838;
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
(33838,0,0,0,54,0,100,0,0,0,0,0,29,0,360,0,0,0,0,23,0,0,0,0,0,0,0, 'Enslaved Fire Elemental - on Summon - Follow Owner or Summoner'),
(33838,0,1,0,0,0,100,0,4000,8000,12000,14000,11,38064,0,0,0,0,0,0,0,0,0,0,0,0,0, 'Enslaved Fire Elemental - Cast Blast Wave'),
(33838,0,2,0,4,0,100,0,0,0,0,0,11,63778,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Enslaved Fire Elemental - Cast Fire Shield on aggro');
(33838,0,2,0,4,0,100,0,0,0,0,0,11,63778,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Enslaved Fire Elemental - Cast Fire Shield on aggro');



-- Fix Gold Loot of Ulduar
SET @Gold_10_Trash_min :=100000;
SET @Gold_10_Trash_max :=@Gold_10_Trash_min*1.5;
SET @Gold_25_Trash_min :=250000;
SET @Gold_25_Trash_max :=@Gold_25_Trash_min*1.5;

UPDATE creature_template SET creature_template.mingold = @Gold_10_Trash_min, creature_template.maxgold = @Gold_10_Trash_max
WHERE
entry IN (SELECT `id` FROM `creature` WHERE `map`=603) AND -- Ulduar Map
faction_A IN (14,16) AND
faction_H IN (14,16) AND
rank=1 AND
entry NOT IN (34234,33236,34164,34164,32872);


UPDATE creature_template INNER JOIN creature_template creat ON creature_template.entry = creat.difficulty_entry_1
SET creature_template.mingold = @Gold_25_Trash_min, creature_template.maxgold = @Gold_25_Trash_max
WHERE
creat.entry IN (SELECT `id` FROM `creature` WHERE `map`=603) AND -- Ulduar Map
creat.faction_A IN (14,16) AND
creat.faction_H IN (14,16) AND
creat.rank=1 AND
creat.entry NOT IN (34234,33236,34164,34164,32872);
60 changes: 60 additions & 0 deletions src/server/scripts/Spells/spell_generic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,65 @@ class spell_gen_profession_research : public SpellScriptLoader
}
};

enum Launch
{
SPELL_LAUNCH_NO_FALLING_DAMAGE = 66251
};

class spell_gen_launch : public SpellScriptLoader
{
public:
spell_gen_launch() : SpellScriptLoader("spell_gen_launch") {}

class spell_gen_launch_SpellScript : public SpellScript
{
PrepareSpellScript(spell_gen_launch_SpellScript);

void HandleScript(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);

SpellEntry const* const spell = GetSpellInfo();

if (Player* player = GetHitPlayer())
{
player->CastSpell(player,spell->EffectTriggerSpell[1],true); // changes the player's seat
player->AddAura(SPELL_LAUNCH_NO_FALLING_DAMAGE,player); // prevents falling damage
}
}

void Launch()
{
WorldLocation const* const position = GetTargetDest();

if (Player* player = GetHitPlayer())
{
player->ExitVehicle();

// A better research is needed
// There is no spell for this, the following calculation was based on void Spell::CalculateJumpSpeeds

float speedZ = 10.0f;
float dist = position->GetExactDist2d(player->GetPositionX(),player->GetPositionY());
float speedXY = dist;

player->GetMotionMaster()->MoveJump(position->GetPositionX(),position->GetPositionY(),position->GetPositionZ(),speedXY,speedZ);
}
}

void Register()
{
OnEffect += SpellEffectFn(spell_gen_launch_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_FORCE_CAST);
AfterHit += SpellHitFn(spell_gen_launch_SpellScript::Launch);
}
};

SpellScript* GetSpellScript() const
{
return new spell_gen_launch_SpellScript();
}
};

void AddSC_generic_spell_scripts()
{
new spell_gen_absorb0_hitlimit1();
Expand All @@ -819,4 +878,5 @@ void AddSC_generic_spell_scripts()
new spell_gen_gunship_portal();
new spell_gen_dungeon_credit();
new spell_gen_profession_research();
new spell_gen_launch();
}

0 comments on commit 9618129

Please sign in to comment.