From ae36ddefec4f5ab6eea615ddd7a45cbdcb580b5a Mon Sep 17 00:00:00 2001 From: joschiwald Date: Sat, 31 Aug 2013 16:48:37 +0200 Subject: Core/Scripts: add creature_text to pet mojo Scripts/Karazhan/Moroes: cleanup a bit (should fixes mem leak) --- .../EasternKingdoms/Karazhan/boss_moroes.cpp | 40 ++--- src/server/scripts/World/npcs_special.cpp | 167 ++++++++------------- 2 files changed, 82 insertions(+), 125 deletions(-) (limited to 'src') diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp index 473fe000939..780f781f58d 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp @@ -73,14 +73,12 @@ enum Spells SPELL_SHIELDWALL = 29390 }; -#define POS_Z 81.73f - -float Locations[4][3]= +Position const Locations[4] = { - {-10991.0f, -1884.33f, 0.614315f}, - {-10989.4f, -1885.88f, 0.904913f}, - {-10978.1f, -1887.07f, 2.035550f}, - {-10975.9f, -1885.81f, 2.253890f}, + {-10991.0f, -1884.33f, 81.73f, 0.614315f}, + {-10989.4f, -1885.88f, 81.73f, 0.904913f}, + {-10978.1f, -1887.07f, 81.73f, 2.035550f}, + {-10975.9f, -1885.81f, 81.73f, 2.253890f}, }; const uint32 Adds[6]= @@ -137,7 +135,7 @@ public: Enrage = false; InVanish = false; - if (me->GetHealth()) + if (me->IsAlive()) SpawnAdds(); if (instance) @@ -183,39 +181,34 @@ public: void SpawnAdds() { DeSpawnAdds(); + if (isAddlistEmpty()) { - Creature* creature = NULL; - std::vector AddList; + std::list AddList; for (uint8 i = 0; i < 6; ++i) AddList.push_back(Adds[i]); - while (AddList.size() > 4) - AddList.erase((AddList.begin())+(rand()%AddList.size())); + Trinity::Containers::RandomResizeList(AddList, 4); uint8 i = 0; - for (std::vector::const_iterator itr = AddList.begin(); itr != AddList.end(); ++itr) + for (std::list::const_iterator itr = AddList.begin(); itr != AddList.end() && i < 4; ++itr, ++i) { uint32 entry = *itr; - creature = me->SummonCreature(entry, Locations[i][0], Locations[i][1], POS_Z, Locations[i][2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - if (creature) + if (Creature* creature = me->SummonCreature(entry, Locations[i], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000)) { AddGUID[i] = creature->GetGUID(); AddId[i] = entry; } - ++i; } - }else + } + else { for (uint8 i = 0; i < 4; ++i) { - Creature* creature = me->SummonCreature(AddId[i], Locations[i][0], Locations[i][1], POS_Z, Locations[i][2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - if (creature) - { + if (Creature* creature = me->SummonCreature(AddId[i], Locations[i], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000)) AddGUID[i] = creature->GetGUID(); - } } } } @@ -235,9 +228,8 @@ public: { if (AddGUID[i]) { - Creature* temp = Creature::GetCreature((*me), AddGUID[i]); - if (temp && temp->IsAlive()) - temp->DisappearAndDie(); + if (Creature* temp = ObjectAccessor::GetCreature(*me, AddGUID[i])) + temp->DespawnOrUnsummon(); } } } diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 4efdf78154d..f12c68678b1 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -1575,130 +1575,95 @@ public: ## npc_brewfest_reveler ####*/ +enum BrewfestReveler +{ + SPELL_BREWFEST_TOAST = 41586 +}; + class npc_brewfest_reveler : public CreatureScript { -public: - npc_brewfest_reveler() : CreatureScript("npc_brewfest_reveler") { } + public: + npc_brewfest_reveler() : CreatureScript("npc_brewfest_reveler") { } - struct npc_brewfest_revelerAI : public ScriptedAI - { - npc_brewfest_revelerAI(Creature* creature) : ScriptedAI(creature) {} - void ReceiveEmote(Player* player, uint32 emote) OVERRIDE + struct npc_brewfest_revelerAI : public ScriptedAI { - if (!IsHolidayActive(HOLIDAY_BREWFEST)) - return; + npc_brewfest_revelerAI(Creature* creature) : ScriptedAI(creature) { } - if (emote == TEXT_EMOTE_DANCE) - me->CastSpell(player, 41586, false); - } - }; + void ReceiveEmote(Player* player, uint32 emote) OVERRIDE + { + if (!IsHolidayActive(HOLIDAY_BREWFEST)) + return; - CreatureAI* GetAI(Creature* creature) const OVERRIDE - { - return new npc_brewfest_revelerAI(creature); - } + if (emote == TEXT_EMOTE_DANCE) + me->CastSpell(player, SPELL_BREWFEST_TOAST, false); + } + }; + + CreatureAI* GetAI(Creature* creature) const OVERRIDE + { + return new npc_brewfest_revelerAI(creature); + } }; +enum Mojo +{ + SAY_MOJO = 0, -#define SAY_RANDOM_MOJO0 "Now that's what I call froggy-style!" -#define SAY_RANDOM_MOJO1 "Your lily pad or mine?" -#define SAY_RANDOM_MOJO2 "This won't take long, did it?" -#define SAY_RANDOM_MOJO3 "I thought you'd never ask!" -#define SAY_RANDOM_MOJO4 "I promise not to give you warts..." -#define SAY_RANDOM_MOJO5 "Feelin' a little froggy, are ya?" -#define SAY_RANDOM_MOJO6a "Listen, " -#define SAY_RANDOM_MOJO6b ", I know of a little swamp not too far from here...." -#define SAY_RANDOM_MOJO7 "There's just never enough Mojo to go around..." + SPELL_FEELING_FROGGY = 43906, + SPELL_SEDUCTION_VISUAL = 43919 +}; class npc_mojo : public CreatureScript { -public: - npc_mojo() : CreatureScript("npc_mojo") { } + public: + npc_mojo() : CreatureScript("npc_mojo") { } - struct npc_mojoAI : public ScriptedAI - { - npc_mojoAI(Creature* creature) : ScriptedAI(creature) {Reset();} - uint32 hearts; - uint64 victimGUID; - void Reset() OVERRIDE + struct npc_mojoAI : public ScriptedAI { - victimGUID = 0; - hearts = 15000; - if (Unit* own = me->GetOwner()) - me->GetMotionMaster()->MoveFollow(own, 0, 0); - } - - void EnterCombat(Unit* /*who*/)OVERRIDE {} + npc_mojoAI(Creature* creature) : ScriptedAI(creature) { } - void UpdateAI(uint32 diff) OVERRIDE - { - if (me->HasAura(20372)) + void Reset() OVERRIDE { - if (hearts <= diff) - { - me->RemoveAurasDueToSpell(20372); - hearts = 15000; - } hearts -= diff; - } - } + _victimGUID = 0; - void ReceiveEmote(Player* player, uint32 emote) OVERRIDE - { - me->HandleEmoteCommand(emote); - Unit* owner = me->GetOwner(); - if (emote != TEXT_EMOTE_KISS || !owner || owner->GetTypeId() != TYPEID_PLAYER || - owner->ToPlayer()->GetTeam() != player->GetTeam()) - { - return; + if (Unit* owner = me->GetOwner()) + me->GetMotionMaster()->MoveFollow(owner, 0.0f, 0.0f); } - std::string whisp = ""; - switch (rand() % 8) + void EnterCombat(Unit* /*who*/) OVERRIDE { } + void UpdateAI(uint32 diff) OVERRIDE { } + + void ReceiveEmote(Player* player, uint32 emote) OVERRIDE { - case 0: - whisp.append(SAY_RANDOM_MOJO0); - break; - case 1: - whisp.append(SAY_RANDOM_MOJO1); - break; - case 2: - whisp.append(SAY_RANDOM_MOJO2); - break; - case 3: - whisp.append(SAY_RANDOM_MOJO3); - break; - case 4: - whisp.append(SAY_RANDOM_MOJO4); - break; - case 5: - whisp.append(SAY_RANDOM_MOJO5); - break; - case 6: - whisp.append(SAY_RANDOM_MOJO6a); - whisp.append(player->GetName()); - whisp.append(SAY_RANDOM_MOJO6b); - break; - case 7: - whisp.append(SAY_RANDOM_MOJO7); - break; + me->HandleEmoteCommand(emote); + Unit* owner = me->GetOwner(); + if (emote != TEXT_EMOTE_KISS || !owner || owner->GetTypeId() != TYPEID_PLAYER || + owner->ToPlayer()->GetTeam() != player->GetTeam()) + { + return; + } + + Talk(SAY_MOJO, player->GetGUID()); + + if (_victimGUID) + if (Player* victim = ObjectAccessor::GetPlayer(*me, _victimGUID)) + victim->RemoveAura(SPELL_FEELING_FROGGY); + + _victimGUID = player->GetGUID(); + + DoCast(player, SPELL_FEELING_FROGGY, true); + DoCast(me, SPELL_SEDUCTION_VISUAL, true); + me->GetMotionMaster()->MoveFollow(player, 0.0f, 0.0f); } - me->MonsterWhisper(whisp.c_str(), player->GetGUID()); - if (victimGUID) - if (Player* victim = ObjectAccessor::GetPlayer(*me, victimGUID)) - victim->RemoveAura(43906); // remove polymorph frog thing - me->AddAura(43906, player); // add polymorph frog thing - victimGUID = player->GetGUID(); - DoCast(me, 20372, true); // tag.hearts - me->GetMotionMaster()->MoveFollow(player, 0, 0); - hearts = 15000; - } - }; + private: + uint64 _victimGUID; + }; - CreatureAI* GetAI(Creature* creature) const OVERRIDE - { - return new npc_mojoAI(creature); - } + CreatureAI* GetAI(Creature* creature) const OVERRIDE + { + return new npc_mojoAI(creature); + } }; enum TrainingDummy -- cgit v1.2.3 From b1721a65ee7595b99269d01cdccd7aa6557ab099 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Sat, 31 Aug 2013 17:42:04 +0200 Subject: Core/Spells: Fix quest credit for quest "Death Comes From On High" --- .../2013_08_31_04_world_spell_script_names.sql | 3 + src/server/scripts/Spells/spell_quest.cpp | 74 ++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 sql/updates/world/2013_08_31_04_world_spell_script_names.sql (limited to 'src') diff --git a/sql/updates/world/2013_08_31_04_world_spell_script_names.sql b/sql/updates/world/2013_08_31_04_world_spell_script_names.sql new file mode 100644 index 00000000000..a1f71f3c870 --- /dev/null +++ b/sql/updates/world/2013_08_31_04_world_spell_script_names.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `spell_id`=51858; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(51858, 'spell_q12641_death_comes_from_on_high'); diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 7b9821c60a9..7021f6251a2 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -2034,6 +2034,79 @@ class spell_q12308_escape_from_silverbrook_summon_worgen : public SpellScriptLoa } }; + +enum DeathComesFromOnHigh +{ + SPELL_FORGE_CREDIT = 51974, + SPELL_TOWN_HALL_CREDIT = 51977, + SPELL_SCARLET_HOLD_CREDIT = 51980, + SPELL_CHAPEL_CREDIT = 51982, + + NPC_NEW_AVALON_FORGE = 28525, + NPC_NEW_AVALON_TOWN_HALL = 28543, + NPC_SCARLET_HOLD = 28542, + NPC_CHAPEL_OF_THE_CRIMSON_FLAME = 28544 +}; + +// 51858 - Siphon of Acherus +class spell_q12641_death_comes_from_on_high : public SpellScriptLoader +{ + public: + spell_q12641_death_comes_from_on_high() : SpellScriptLoader("spell_q12641_death_comes_from_on_high") { } + + class spell_q12641_death_comes_from_on_high_SpellScript : public SpellScript + { + PrepareSpellScript(spell_q12641_death_comes_from_on_high_SpellScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_FORGE_CREDIT) || + !sSpellMgr->GetSpellInfo(SPELL_TOWN_HALL_CREDIT) || + !sSpellMgr->GetSpellInfo(SPELL_SCARLET_HOLD_CREDIT) || + !sSpellMgr->GetSpellInfo(SPELL_CHAPEL_CREDIT)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + uint32 spellId = 0; + + TC_LOG_ERROR(LOG_FILTER_SPELLS_AURAS, "spell_q12641_death_comes_from_on_high:: Caster: %s (GUID: %u) On Hit Target: Creature: %s (Entry: %u GUID: %u)", + GetOriginalCaster()->GetName().c_str(), GetOriginalCaster()->GetGUIDLow(), GetHitCreature()->GetName().c_str(), GetHitCreature()->GetEntry(), GetHitCreature()->GetGUIDLow()); + switch (GetHitCreature()->GetEntry()) + { + case NPC_NEW_AVALON_FORGE: + spellId = SPELL_FORGE_CREDIT; + break; + case NPC_NEW_AVALON_TOWN_HALL: + spellId = SPELL_TOWN_HALL_CREDIT; + break; + case NPC_SCARLET_HOLD: + spellId = SPELL_SCARLET_HOLD_CREDIT; + break; + case NPC_CHAPEL_OF_THE_CRIMSON_FLAME: + spellId = SPELL_CHAPEL_CREDIT; + break; + default: + return; + } + + GetOriginalCaster()->CastSpell((Unit*)NULL, spellId, true); + } + + void Register() OVERRIDE + { + OnEffectHitTarget += SpellEffectFn(spell_q12641_death_comes_from_on_high_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const OVERRIDE + { + return new spell_q12641_death_comes_from_on_high_SpellScript(); + } +}; + void AddSC_quest_spell_scripts() { new spell_q55_sacred_cleansing(); @@ -2083,4 +2156,5 @@ void AddSC_quest_spell_scripts() new spell_q12690_burst_at_the_seams(); new spell_q12308_escape_from_silverbrook_summon_worgen(); new spell_q12308_escape_from_silverbrook(); + new spell_q12641_death_comes_from_on_high(); } -- cgit v1.2.3 From 8fd1f461929d78054b72f00483ad057d0e80a238 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Sat, 31 Aug 2013 17:52:47 +0200 Subject: Scripted: Fix warning --- src/server/scripts/Pet/CMakeLists.txt | 1 + src/server/scripts/Pet/pet_generic.cpp | 90 +++++++++++++++++++++++++++++++ src/server/scripts/World/npcs_special.cpp | 62 --------------------- 3 files changed, 91 insertions(+), 62 deletions(-) create mode 100644 src/server/scripts/Pet/pet_generic.cpp (limited to 'src') diff --git a/src/server/scripts/Pet/CMakeLists.txt b/src/server/scripts/Pet/CMakeLists.txt index b4a8eea77d8..87bbfd63c69 100644 --- a/src/server/scripts/Pet/CMakeLists.txt +++ b/src/server/scripts/Pet/CMakeLists.txt @@ -11,6 +11,7 @@ set(scripts_STAT_SRCS ${scripts_STAT_SRCS} Pet/pet_dk.cpp + Pet/pet_generic.cpp Pet/pet_hunter.cpp Pet/pet_mage.cpp Pet/pet_priest.cpp diff --git a/src/server/scripts/Pet/pet_generic.cpp b/src/server/scripts/Pet/pet_generic.cpp new file mode 100644 index 00000000000..f4327ef8daa --- /dev/null +++ b/src/server/scripts/Pet/pet_generic.cpp @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2008-2013 TrinityCore + * + * 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 . + */ + +/* + * Ordered alphabetically using scriptname. + * Scriptnames of files in this file should be prefixed with "npc_pet_gen_". + */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "Player.h" + +enum Mojo +{ + SAY_MOJO = 0, + + SPELL_FEELING_FROGGY = 43906, + SPELL_SEDUCTION_VISUAL = 43919 +}; + +class npc_pet_gen_mojo : public CreatureScript +{ + public: + npc_pet_gen_mojo() : CreatureScript("npc_pet_gen_mojo") { } + + struct npc_pet_gen_mojoAI : public ScriptedAI + { + npc_pet_gen_mojoAI(Creature* creature) : ScriptedAI(creature) { } + + void Reset() OVERRIDE + { + _victimGUID = 0; + + if (Unit* owner = me->GetOwner()) + me->GetMotionMaster()->MoveFollow(owner, 0.0f, 0.0f); + } + + void EnterCombat(Unit* /*who*/) OVERRIDE { } + void UpdateAI(uint32 /*diff*/) OVERRIDE { } + + void ReceiveEmote(Player* player, uint32 emote) OVERRIDE + { + me->HandleEmoteCommand(emote); + Unit* owner = me->GetOwner(); + if (emote != TEXT_EMOTE_KISS || !owner || owner->GetTypeId() != TYPEID_PLAYER || + owner->ToPlayer()->GetTeam() != player->GetTeam()) + { + return; + } + + Talk(SAY_MOJO, player->GetGUID()); + + if (_victimGUID) + if (Player* victim = ObjectAccessor::GetPlayer(*me, _victimGUID)) + victim->RemoveAura(SPELL_FEELING_FROGGY); + + _victimGUID = player->GetGUID(); + + DoCast(player, SPELL_FEELING_FROGGY, true); + DoCast(me, SPELL_SEDUCTION_VISUAL, true); + me->GetMotionMaster()->MoveFollow(player, 0.0f, 0.0f); + } + + private: + uint64 _victimGUID; + }; + + CreatureAI* GetAI(Creature* creature) const OVERRIDE + { + return new npc_pet_gen_mojoAI(creature); + } +}; + +void AddSC_shaman_pet_scripts() +{ +} diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index f12c68678b1..5304cbf56ca 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -1605,67 +1605,6 @@ class npc_brewfest_reveler : public CreatureScript } }; -enum Mojo -{ - SAY_MOJO = 0, - - SPELL_FEELING_FROGGY = 43906, - SPELL_SEDUCTION_VISUAL = 43919 -}; - -class npc_mojo : public CreatureScript -{ - public: - npc_mojo() : CreatureScript("npc_mojo") { } - - struct npc_mojoAI : public ScriptedAI - { - npc_mojoAI(Creature* creature) : ScriptedAI(creature) { } - - void Reset() OVERRIDE - { - _victimGUID = 0; - - if (Unit* owner = me->GetOwner()) - me->GetMotionMaster()->MoveFollow(owner, 0.0f, 0.0f); - } - - void EnterCombat(Unit* /*who*/) OVERRIDE { } - void UpdateAI(uint32 diff) OVERRIDE { } - - void ReceiveEmote(Player* player, uint32 emote) OVERRIDE - { - me->HandleEmoteCommand(emote); - Unit* owner = me->GetOwner(); - if (emote != TEXT_EMOTE_KISS || !owner || owner->GetTypeId() != TYPEID_PLAYER || - owner->ToPlayer()->GetTeam() != player->GetTeam()) - { - return; - } - - Talk(SAY_MOJO, player->GetGUID()); - - if (_victimGUID) - if (Player* victim = ObjectAccessor::GetPlayer(*me, _victimGUID)) - victim->RemoveAura(SPELL_FEELING_FROGGY); - - _victimGUID = player->GetGUID(); - - DoCast(player, SPELL_FEELING_FROGGY, true); - DoCast(me, SPELL_SEDUCTION_VISUAL, true); - me->GetMotionMaster()->MoveFollow(player, 0.0f, 0.0f); - } - - private: - uint64 _victimGUID; - }; - - CreatureAI* GetAI(Creature* creature) const OVERRIDE - { - return new npc_mojoAI(creature); - } -}; - enum TrainingDummy { NPC_ADVANCED_TARGET_DUMMY = 2674, @@ -2519,7 +2458,6 @@ void AddSC_npcs_special() new npc_steam_tonk(); new npc_tonk_mine(); new npc_brewfest_reveler(); - new npc_mojo(); new npc_training_dummy(); new npc_wormhole(); new npc_pet_trainer(); -- cgit v1.2.3 From e753a47162b0417ee74b91e2ec04fe7716c16c99 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Sat, 31 Aug 2013 18:29:51 +0200 Subject: DB/Sai: Fix quest credit for quest "Blessing of Incineratus" --- sql/updates/world/2013_08_31_06_world_smart_scripts.sql | 10 ++++++++++ src/server/scripts/Pet/pet_generic.cpp | 1 + 2 files changed, 11 insertions(+) create mode 100644 sql/updates/world/2013_08_31_06_world_smart_scripts.sql (limited to 'src') diff --git a/sql/updates/world/2013_08_31_06_world_smart_scripts.sql b/sql/updates/world/2013_08_31_06_world_smart_scripts.sql new file mode 100644 index 00000000000..9376bb62951 --- /dev/null +++ b/sql/updates/world/2013_08_31_06_world_smart_scripts.sql @@ -0,0 +1,10 @@ +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (18110,18142,18143,18144) 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 +(18110, 0, 0, 1, 8, 0, 100, 1, 31927, 0, 0, 0, 80, 1811000, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Windyreed Quest Credit - On Spellhit - Run Script'), +(18110, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 33, 18110, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Windyreed Quest Credit - On Spellhit (Link) - Quest Credit'), +(18142, 0, 0, 1, 8, 0, 100, 1, 31927, 0, 0, 0, 80, 1814200, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Windyreed Quest Credit - On Spellhit - Run Script'), +(18142, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 33, 18142, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Windyreed Quest Credit - On Spellhit (Link) - Quest Credit'), +(18143, 0, 0, 1, 8, 0, 100, 1, 31927, 0, 0, 0, 80, 1814300, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Windyreed Quest Credit - On Spellhit - Run Script'), +(18143, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 33, 18143, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Windyreed Quest Credit - On Spellhit (Link) - Quest Credit'), +(18144, 0, 0, 1, 8, 0, 100, 1, 31927, 0, 0, 0, 80, 1814400, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Windyreed Quest Credit - On Spellhit - Run Script'), +(18144, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 33, 18144, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Windyreed Quest Credit - On Spellhit (Link) - Quest Credit'); diff --git a/src/server/scripts/Pet/pet_generic.cpp b/src/server/scripts/Pet/pet_generic.cpp index f4327ef8daa..b8df19f4216 100644 --- a/src/server/scripts/Pet/pet_generic.cpp +++ b/src/server/scripts/Pet/pet_generic.cpp @@ -87,4 +87,5 @@ class npc_pet_gen_mojo : public CreatureScript void AddSC_shaman_pet_scripts() { + new npc_pet_gen_mojo(); } -- cgit v1.2.3 From 22b71244a0e9caccf7d9ab9ed770f27f6486d904 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Sat, 31 Aug 2013 19:33:14 +0200 Subject: DB/Creature: Fix cords for quest "Death Comes From On High" --- sql/updates/world/2013_08_31_07_world_creature.sql | 26 ++++++++++++++++++++++ src/server/game/Scripting/ScriptLoader.cpp | 2 ++ src/server/scripts/Pet/pet_generic.cpp | 2 +- 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 sql/updates/world/2013_08_31_07_world_creature.sql (limited to 'src') diff --git a/sql/updates/world/2013_08_31_07_world_creature.sql b/sql/updates/world/2013_08_31_07_world_creature.sql new file mode 100644 index 00000000000..04f844d68c0 --- /dev/null +++ b/sql/updates/world/2013_08_31_07_world_creature.sql @@ -0,0 +1,26 @@ +UPDATE `creature` SET + `position_x`=1814.592, + `position_y`=-5988.646, + `position_z`=125.4968, + `orientation`=3.228859 +WHERE `id`=28525; + +UPDATE `creature` SET + `position_x`=1590.806, + `position_y`=-5731.661, + `position_z`=143.8694, + `orientation`=0.9075712 +WHERE `id`=28543; + +UPDATE `creature` SET + `position_x`= 1651.211, + `position_y`=-5994.667, + `position_z`=133.5836 +WHERE `id`=28542; + +UPDATE `creature` SET `position_x`= 1385.928, + `position_x`=1385.928, + `position_y`= -5702.061, + `position_z`= 146.3048, + `orientation`=4.153883 +WHERE `id`=28544; diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index 426d83ef837..3456041ddb2 100644 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -654,6 +654,7 @@ void AddSC_event_childrens_week(); // Pets void AddSC_deathknight_pet_scripts(); +void AddSC_generic_pet_scripts(); void AddSC_hunter_pet_scripts(); void AddSC_mage_pet_scripts(); void AddSC_priest_pet_scripts(); @@ -1359,6 +1360,7 @@ void AddPetScripts() { #ifdef SCRIPTS AddSC_deathknight_pet_scripts(); + AddSC_generic_pet_scripts(); AddSC_hunter_pet_scripts(); AddSC_mage_pet_scripts(); AddSC_priest_pet_scripts(); diff --git a/src/server/scripts/Pet/pet_generic.cpp b/src/server/scripts/Pet/pet_generic.cpp index b8df19f4216..f10a14716c6 100644 --- a/src/server/scripts/Pet/pet_generic.cpp +++ b/src/server/scripts/Pet/pet_generic.cpp @@ -85,7 +85,7 @@ class npc_pet_gen_mojo : public CreatureScript } }; -void AddSC_shaman_pet_scripts() +void AddSC_generic_pet_scripts() { new npc_pet_gen_mojo(); } -- cgit v1.2.3 From e6761ea2aa7897eda7dafa0b11f17c26eb60e334 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sat, 31 Aug 2013 18:56:58 +0100 Subject: Core/NetworkIO: Fix memory leak Packet headers not being correctly deallocated. --- src/server/game/Server/WorldSocket.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index 625ebff8471..27bb17962ce 100644 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -512,6 +512,7 @@ int WorldSocket::handle_input_payload (void) m_RecvPct.base (NULL, 0); m_RecvPct.reset(); + delete m_RecvWPct; m_RecvWPct = NULL; m_Header.reset(); -- cgit v1.2.3 From 16fcac19912122b134cc9b953b1de0741e3347d6 Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 31 Aug 2013 21:02:14 +0100 Subject: Core/RBAC: Move bf commands to RBAC (using individual permissions) --- sql/updates/auth/2013_08_30_04_auth_misc.sql | 24 +++++++++++++++++++++++ sql/updates/world/2013_08_31_08_world_command.sql | 12 ++++++++++++ src/server/game/Accounts/RBAC.h | 6 ++++++ src/server/scripts/Commands/cs_bf.cpp | 16 +++++++-------- 4 files changed, 50 insertions(+), 8 deletions(-) create mode 100644 sql/updates/auth/2013_08_30_04_auth_misc.sql create mode 100644 sql/updates/world/2013_08_31_08_world_command.sql (limited to 'src') diff --git a/sql/updates/auth/2013_08_30_04_auth_misc.sql b/sql/updates/auth/2013_08_30_04_auth_misc.sql new file mode 100644 index 00000000000..422f0f38c50 --- /dev/null +++ b/sql/updates/auth/2013_08_30_04_auth_misc.sql @@ -0,0 +1,24 @@ +/* cs_bf.cpp */ + +SET @id = 257; + +-- Add new permissions +DELETE FROM `rbac_permissions` WHERE `id` BETWEEN @id AND @id+5; +INSERT INTO `rbac_permissions` (`id`, `name`) VALUES +(@id+0, 'bf'), +(@id+1, 'bf start'), +(@id+2, 'bf stop'), +(@id+3, 'bf switch'), +(@id+4, 'bf timer'), +(@id+5, 'bf enabled'); + +-- Add permissions to "corresponding Commands Role" +DELETE FROM `rbac_role_permissions` WHERE `permissionId` BETWEEN @id AND @id+5; +INSERT INTO `rbac_role_permissions` (`roleId`, `permissionId`) VALUES +(4, @id+0), +(4, @id+1), +(4, @id+2), +(4, @id+3), +(4, @id+4), +(4, @id+5); + diff --git a/sql/updates/world/2013_08_31_08_world_command.sql b/sql/updates/world/2013_08_31_08_world_command.sql new file mode 100644 index 00000000000..c48180f36b5 --- /dev/null +++ b/sql/updates/world/2013_08_31_08_world_command.sql @@ -0,0 +1,12 @@ +/* cs_bf.cpp */ + +SET @id = 257; + +-- Update command table with new RBAC permissions +UPDATE `command` SET `permission` = @id+0 WHERE `name` = 'bf'; +UPDATE `command` SET `permission` = @id+1 WHERE `name` = 'bf start'; +UPDATE `command` SET `permission` = @id+2 WHERE `name` = 'bf stop'; +UPDATE `command` SET `permission` = @id+3 WHERE `name` = 'bf switch'; +UPDATE `command` SET `permission` = @id+4 WHERE `name` = 'bf timer'; +UPDATE `command` SET `permission` = @id+5 WHERE `name` = 'bf enabled'; + diff --git a/src/server/game/Accounts/RBAC.h b/src/server/game/Accounts/RBAC.h index 55f8527a125..be4356f6b54 100644 --- a/src/server/game/Accounts/RBAC.h +++ b/src/server/game/Accounts/RBAC.h @@ -154,6 +154,12 @@ enum RBACPermissions RBAC_PERM_COMMAND_UNBAN_CHARACTER = 254, RBAC_PERM_COMMAND_UNBAN_IP = 255, RBAC_PERM_COMMAND_UNBAN_PLAYERACCOUNT = 256, + RBAC_PERM_COMMAND_BF = 257, + RBAC_PERM_COMMAND_BF_START = 258, + RBAC_PERM_COMMAND_BF_STOP = 259, + RBAC_PERM_COMMAND_BF_SWITCH = 260, + RBAC_PERM_COMMAND_BF_TIMER = 261, + RBAC_PERM_COMMAND_BF_ENABLE = 262, // custom permissions 1000+ RBAC_PERM_MAX diff --git a/src/server/scripts/Commands/cs_bf.cpp b/src/server/scripts/Commands/cs_bf.cpp index 5ab94062a85..0b239219ddd 100644 --- a/src/server/scripts/Commands/cs_bf.cpp +++ b/src/server/scripts/Commands/cs_bf.cpp @@ -35,17 +35,17 @@ public: { static ChatCommand battlefieldcommandTable[] = { - { "start", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleBattlefieldStart, "", NULL }, - { "stop", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleBattlefieldEnd, "", NULL }, - { "switch", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleBattlefieldSwitch, "", NULL }, - { "timer", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleBattlefieldTimer, "", NULL }, - { "enable", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleBattlefieldEnable, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { "start", RBAC_PERM_COMMAND_BF_START, false, &HandleBattlefieldStart, "", NULL }, + { "stop", RBAC_PERM_COMMAND_BF_STOP, false, &HandleBattlefieldEnd, "", NULL }, + { "switch", RBAC_PERM_COMMAND_BF_SWITCH, false, &HandleBattlefieldSwitch, "", NULL }, + { "timer", RBAC_PERM_COMMAND_BF_TIMER, false, &HandleBattlefieldTimer, "", NULL }, + { "enable", RBAC_PERM_COMMAND_BF_ENABLE, false, &HandleBattlefieldEnable, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand commandTable[] = { - { "bf", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, NULL, "", battlefieldcommandTable }, - { NULL, 0, false, NULL, "", NULL } + { "bf", RBAC_PERM_COMMAND_BF, false, NULL, "", battlefieldcommandTable }, + { NULL, 0, false, NULL, "", NULL } }; return commandTable; } -- cgit v1.2.3 From eab035eca6a30fadb30a7517e929f571a85e1e75 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sat, 31 Aug 2013 21:25:53 +0100 Subject: Revert e6761ea2aa7897eda7dafa0b11f17c26eb60e334 --- src/server/game/Server/WorldSocket.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index 27bb17962ce..625ebff8471 100644 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -512,7 +512,6 @@ int WorldSocket::handle_input_payload (void) m_RecvPct.base (NULL, 0); m_RecvPct.reset(); - delete m_RecvWPct; m_RecvWPct = NULL; m_Header.reset(); -- cgit v1.2.3