From e8955cf6ddddd6953340c2ceeb3b5b4a98d57c90 Mon Sep 17 00:00:00 2001 From: Natureknight Date: Sun, 28 Dec 2014 16:54:41 +0000 Subject: [PATCH 01/18] Scripts/Spells: Death Grip should not be castable while jumping/falling and should have 8-30 yards range in PvP instead of 0-30 yards Closes #13499 --- sql/updates/world/2014_12_28_01_world.sql | 3 ++ src/server/scripts/Spells/spell_dk.cpp | 39 +++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 sql/updates/world/2014_12_28_01_world.sql diff --git a/sql/updates/world/2014_12_28_01_world.sql b/sql/updates/world/2014_12_28_01_world.sql new file mode 100644 index 00000000000..e580a29f1f0 --- /dev/null +++ b/sql/updates/world/2014_12_28_01_world.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `spell_id`=49576; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(49576, 'spell_dk_death_grip_initial'); diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 929ffe60364..b007dcddc03 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -1644,6 +1644,44 @@ class spell_dk_will_of_the_necropolis : public SpellScriptLoader } }; +// 49576 - Death Grip Initial +class spell_dk_death_grip_initial : public SpellScriptLoader +{ +public: + spell_dk_death_grip_initial() : SpellScriptLoader("spell_dk_death_grip_initial") { } + + class spell_dk_death_grip_initial_SpellScript : public SpellScript + { + PrepareSpellScript(spell_dk_death_grip_initial_SpellScript); + + SpellCastResult CheckCast() + { + Unit* caster = GetCaster(); + // Death Grip should not be castable while jumping/falling + if (caster->HasUnitState(UNIT_STATE_JUMPING) || caster->HasUnitMovementFlag(MOVEMENTFLAG_FALLING)) + return SPELL_FAILED_MOVING; + + // Patch 3.3.3 (2010-03-23): Minimum range has been changed to 8 yards in PvP. + Unit* target = GetExplTargetUnit(); + if (target && target->GetTypeId() == TYPEID_PLAYER) + if (caster->GetDistance(target) < 8.f) + return SPELL_FAILED_TOO_CLOSE; + + return SPELL_CAST_OK; + } + + void Register() + { + OnCheckCast += SpellCheckCastFn(spell_dk_death_grip_initial_SpellScript::CheckCast); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_dk_death_grip_initial_SpellScript(); + } +}; + void AddSC_deathknight_spell_scripts() { new spell_dk_anti_magic_shell_raid(); @@ -1673,4 +1711,5 @@ void AddSC_deathknight_spell_scripts() new spell_dk_spell_deflection(); new spell_dk_vampiric_blood(); new spell_dk_will_of_the_necropolis(); + new spell_dk_death_grip_initial(); } From b0b7a55bdba20aad5b7914c55933daa70afe59ba Mon Sep 17 00:00:00 2001 From: Gooyeth Date: Sun, 28 Dec 2014 17:03:33 +0000 Subject: [PATCH 02/18] Scripts/Quests: Fix Red Snapper - Very Tasty! GOb Fix 'School of Red Snapper' now disappear correctly when using 'Draenei Fishing Net', the bug is caused because the GameObject is SpellFocus type. Fix #1673 Closes #13748 --- src/server/game/Spells/SpellMgr.cpp | 3 +++ src/server/scripts/Spells/spell_quest.cpp | 28 ++++++++++++++++++++--- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 99c8b017a3c..fada72bcd4a 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3738,6 +3738,9 @@ void SpellMgr::LoadSpellInfoCorrections() break; // ENDOF ISLE OF CONQUEST SPELLS // + case 29866: // Cast Fishing Net + spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(140); // 6yd + break; default: break; } diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index a59594935b5..0b809757230 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -1076,9 +1076,12 @@ class spell_q14112_14145_chum_the_water: public SpellScriptLoader // http://old01.wowhead.com/quest=9452 - Red Snapper - Very Tasty! enum RedSnapperVeryTasty { - SPELL_CAST_NET = 29866, - ITEM_RED_SNAPPER = 23614, - SPELL_NEW_SUMMON_TEST = 49214, + ITEM_RED_SNAPPER = 23614, + + SPELL_CAST_NET = 29866, + SPELL_NEW_SUMMON_TEST = 49214, + + GO_SCHOOL_OF_RED_SNAPPER = 181616 }; class spell_q9452_cast_net: public SpellScriptLoader @@ -1095,6 +1098,15 @@ class spell_q9452_cast_net: public SpellScriptLoader return GetCaster()->GetTypeId() == TYPEID_PLAYER; } + SpellCastResult CheckCast() + { + GameObject* go = GetCaster()->FindNearestGameObject(GO_SCHOOL_OF_RED_SNAPPER, 3.0f); + if (!go || go->GetRespawnTime()) + return SPELL_FAILED_REQUIRES_SPELL_FOCUS; + + return SPELL_CAST_OK; + } + void HandleDummy(SpellEffIndex /*effIndex*/) { Player* caster = GetCaster()->ToPlayer(); @@ -1104,9 +1116,19 @@ class spell_q9452_cast_net: public SpellScriptLoader caster->CastSpell(caster, SPELL_NEW_SUMMON_TEST, true); } + void HandleActiveObject(SpellEffIndex effIndex) + { + PreventHitDefaultEffect(effIndex); + GetHitGObj()->SetRespawnTime(roll_chance_i(50) ? 2 * MINUTE : 3 * MINUTE); + GetHitGObj()->Use(GetCaster()); + GetHitGObj()->SetLootState(GO_JUST_DEACTIVATED); + } + void Register() override { + OnCheckCast += SpellCheckCastFn(spell_q9452_cast_net_SpellScript::CheckCast); OnEffectHit += SpellEffectFn(spell_q9452_cast_net_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + OnEffectHitTarget += SpellEffectFn(spell_q9452_cast_net_SpellScript::HandleActiveObject, EFFECT_1, SPELL_EFFECT_ACTIVATE_OBJECT); } }; From 81a0e68c9f506c909771454cb92d246f5997384d Mon Sep 17 00:00:00 2001 From: Nayd Date: Sun, 28 Dec 2014 17:08:32 +0000 Subject: [PATCH 03/18] Core/Spells: Remove a not-required spell dbc correction (b0b7a55bdba20aad5b7914c55933daa70afe59ba) --- src/server/game/Spells/SpellMgr.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index fada72bcd4a..99c8b017a3c 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3738,9 +3738,6 @@ void SpellMgr::LoadSpellInfoCorrections() break; // ENDOF ISLE OF CONQUEST SPELLS // - case 29866: // Cast Fishing Net - spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(140); // 6yd - break; default: break; } From bb002803bc0cd0283db0873e9a12db43a82ca30b Mon Sep 17 00:00:00 2001 From: Gooyeth Date: Sun, 28 Dec 2014 12:24:44 -0600 Subject: [PATCH 04/18] Scripts/Spells: Adding overrides Death Grip Initial. Thanks @Goatform --- src/server/scripts/Spells/spell_dk.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index b007dcddc03..3cad6399ef8 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -1670,13 +1670,13 @@ public: return SPELL_CAST_OK; } - void Register() + void Register() override { OnCheckCast += SpellCheckCastFn(spell_dk_death_grip_initial_SpellScript::CheckCast); } }; - SpellScript* GetSpellScript() const + SpellScript* GetSpellScript() const override { return new spell_dk_death_grip_initial_SpellScript(); } From f2444eedf92fce39f7685eafead61d88d4ad89ef Mon Sep 17 00:00:00 2001 From: pete318 Date: Sun, 28 Dec 2014 18:42:52 +0000 Subject: [PATCH 05/18] Scripts/Quests: Fix Quest A Spirit Guide - Ensures rep adjustment buff is always applied (overrides evade, implements existing evade + re-apply buff) - Removes un-owned ravagers with incorrect faction from DB (the correct ones are spawned with their masters without the DB entries) - Create some extra steps in the wolf's waypoints in order to generate some AI events for the Ryga NPC. I think it's a bit of a dirty solution, but it seems to work with minimal changes. - Created RP series of events with Ryga NPC and Ancestral Wolf Spirit (Ryga Kneels, talks to wolf, then returns to spawn position after around a minute). Closes #13619 Fix #4028 --- sql/updates/world/2014_12_28_02_world.sql | 5 ++ .../Outland/zone_hellfire_peninsula.cpp | 53 +++++++++++++++++-- 2 files changed, 53 insertions(+), 5 deletions(-) create mode 100644 sql/updates/world/2014_12_28_02_world.sql diff --git a/sql/updates/world/2014_12_28_02_world.sql b/sql/updates/world/2014_12_28_02_world.sql new file mode 100644 index 00000000000..bc44ddd1cd1 --- /dev/null +++ b/sql/updates/world/2014_12_28_02_world.sql @@ -0,0 +1,5 @@ +DELETE FROM `creature` WHERE `id`=19461; +DELETE FROM `script_waypoint` WHERE `entry`=17077 AND `pointid` IN (51, 52); +INSERT INTO `script_waypoint` (`entry`, `pointid`, `location_x`, `location_y`, `location_z`, `waittime`, `point_comment`) VALUES +(17077, 51, 519.146, 3886.7, 190.128, 10000, 'RYGA_WALK'), +(17077, 52, 519.146, 3886.7, 190.128, 1000, 'RYGA_RETURN'); diff --git a/src/server/scripts/Outland/zone_hellfire_peninsula.cpp b/src/server/scripts/Outland/zone_hellfire_peninsula.cpp index 79e6649495b..58f77f22f97 100644 --- a/src/server/scripts/Outland/zone_hellfire_peninsula.cpp +++ b/src/server/scripts/Outland/zone_hellfire_peninsula.cpp @@ -140,8 +140,8 @@ enum AncestralWolf { EMOTE_WOLF_LIFT_HEAD = 0, EMOTE_WOLF_HOWL = 1, - SAY_WOLF_WELCOME = 2, - SPELL_ANCESTRAL_WOLF_BUFF = 29981, + SAY_WOLF_WELCOME = 0, + SPELL_ANCESTRAL_WOLF_BUFF = 29938, NPC_RYGA = 17123 }; @@ -166,11 +166,16 @@ public: void Reset() override { ryga = NULL; + } + + // Override Evade Mode event, recast buff that was removed by standard handler + void EnterEvadeMode() override + { + npc_escortAI::EnterEvadeMode(); DoCast(me, SPELL_ANCESTRAL_WOLF_BUFF, true); } void MoveInLineOfSight(Unit* who) override - { if (!ryga && who->GetEntry() == NPC_RYGA && me->IsWithinDistInMap(who, 15.0f)) if (Creature* temp = who->ToCreature()) @@ -188,10 +193,48 @@ public: break; case 2: Talk(EMOTE_WOLF_HOWL); + DoCast(me, SPELL_ANCESTRAL_WOLF_BUFF, true); break; + // Move Ryga into position + case 48: + if (Creature* ryga = me->FindNearestCreature(NPC_RYGA,70)) + { + if (ryga->IsAlive() && !ryga->IsInCombat()) + { + ryga->SetWalk(true); + ryga->SetSpeed(MOVE_WALK, 1.5f); + ryga->GetMotionMaster()->MovePoint(0, 517.340698f, 3885.03975f, 190.455978f, true); + Reset(); + } + } + break; + // Ryga Kneels and welcomes spirit wolf case 50: - if (ryga && ryga->IsAlive() && !ryga->IsInCombat()) - ryga->AI()->Talk(SAY_WOLF_WELCOME); + if (Creature* ryga = me->FindNearestCreature(NPC_RYGA,70)) + { + if (ryga->IsAlive() && !ryga->IsInCombat()) + { + ryga->SetFacingTo(0.776773f); + ryga->SetStandState(UNIT_STAND_STATE_KNEEL); + ryga->AI()->Talk(SAY_WOLF_WELCOME); + Reset(); + } + } + break; + // Ryga returns to spawn point + case 51: + if (Creature* ryga = me->FindNearestCreature(NPC_RYGA,70)) + { + if (ryga->IsAlive() && !ryga->IsInCombat()) + { + float fRetX, fRetY, fRetZ, fRetO; + ryga->GetRespawnPosition(fRetX, fRetY, fRetZ, &fRetO); + ryga->SetHomePosition(fRetX, fRetY, fRetZ, fRetO); + ryga->SetStandState(UNIT_STAND_STATE_STAND); + ryga->GetMotionMaster()->MoveTargetedHome(); + Reset(); + } + } break; } } From 17f6dcb76282523ac43d8a1e6cebbe0043ab44fa Mon Sep 17 00:00:00 2001 From: pete318 Date: Sun, 28 Dec 2014 18:59:05 +0000 Subject: [PATCH 06/18] Core: NPC Interaction change for unfriendly reputation. For units with unfriendly reputation, check using the normal reaction function, instead of reading faction directly. This allows specific buffs that alter creature reaction to work on the player, this allowing players to complete quests. Closes #13629 --- src/server/game/Entities/Player/Player.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index b8abc33f675..d547bf60342 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2765,17 +2765,10 @@ Creature* Player::GetNPCIfCanInteractWith(ObjectGuid guid, uint32 npcflagmask) if (creature->GetCharmerGUID()) return NULL; - // not enemy - if (creature->IsHostileTo(this)) + // not unfriendly/hostile + if (creature->GetReactionTo(this) <= REP_UNFRIENDLY) return NULL; - // not unfriendly - if (FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(creature->getFaction())) - if (factionTemplate->faction) - if (FactionEntry const* faction = sFactionStore.LookupEntry(factionTemplate->faction)) - if (faction->reputationListID >= 0 && GetReputationMgr().GetRank(faction) <= REP_UNFRIENDLY) - return NULL; - // not too far if (!creature->IsWithinDistInMap(this, INTERACTION_DISTANCE)) return NULL; From 77887ab32ff4d703dbc618b5cab364f02582c5e7 Mon Sep 17 00:00:00 2001 From: Unholychick Date: Sun, 28 Dec 2014 20:07:00 +0100 Subject: [PATCH 07/18] Scripts/Spells: Move death grip from DB Moves death grip from DB to spellscript for clarity and to reduce confusion in future. --- sql/updates/world/2014_12_28_03_world.sql | 2 ++ src/server/scripts/Spells/spell_dk.cpp | 7 +++++++ 2 files changed, 9 insertions(+) create mode 100644 sql/updates/world/2014_12_28_03_world.sql diff --git a/sql/updates/world/2014_12_28_03_world.sql b/sql/updates/world/2014_12_28_03_world.sql new file mode 100644 index 00000000000..fe3b786b23a --- /dev/null +++ b/sql/updates/world/2014_12_28_03_world.sql @@ -0,0 +1,2 @@ +-- +DELETE FROM `spell_linked_spell` WHERE `spell_trigger` = 49576; diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 3cad6399ef8..acf39906ae7 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -39,6 +39,7 @@ enum DeathKnightSpells SPELL_DK_DEATH_AND_DECAY_DAMAGE = 52212, SPELL_DK_DEATH_COIL_DAMAGE = 47632, SPELL_DK_DEATH_COIL_HEAL = 47633, + SPELL_DK_DEATH_GRIP = 49560, SPELL_DK_DEATH_STRIKE_HEAL = 45470, SPELL_DK_FROST_FEVER = 55095, SPELL_DK_FROST_PRESENCE = 48263, @@ -1670,9 +1671,15 @@ public: return SPELL_CAST_OK; } + void HandleDummy(SpellEffIndex /*effIndex*/) + { + GetCaster()->CastSpell(GetHitUnit(), SPELL_DK_DEATH_GRIP, true); + } + void Register() override { OnCheckCast += SpellCheckCastFn(spell_dk_death_grip_initial_SpellScript::CheckCast); + OnEffectHitTarget += SpellEffectFn(spell_dk_death_grip_initial_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; From d3e2918c57786800b8cbc63287f43f37111a6317 Mon Sep 17 00:00:00 2001 From: MitchesD Date: Sun, 28 Dec 2014 22:02:05 +0100 Subject: [PATCH 08/18] Scripts/Nexus: Keristrasza converted to BossAI and EventMap --- .../Nexus/Nexus/boss_keristrasza.cpp | 304 +++++++++--------- 1 file changed, 156 insertions(+), 148 deletions(-) diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp index a8ffb1d542e..a5feb4fac16 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp @@ -1,6 +1,5 @@ /* * Copyright (C) 2008-2014 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 * * 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 @@ -20,8 +19,8 @@ #include "ScriptedCreature.h" #include "SpellScript.h" #include "SpellAuraEffects.h" -#include "nexus.h" #include "Player.h" +#include "nexus.h" enum Spells { @@ -31,15 +30,21 @@ enum Spells SPELL_CRYSTAL_CHAINS = 50997, SPELL_ENRAGE = 8599, SPELL_CRYSTALFIRE_BREATH = 48096, - H_SPELL_CRYSTALFIRE_BREATH = 57091, SPELL_CRYSTALIZE = 48179, SPELL_INTENSE_COLD = 48094, SPELL_INTENSE_COLD_TRIGGERED = 48095 }; +enum Events +{ + EVENT_CRYSTAL_FIRE_BREATH = 1, + EVENT_CRYSTAL_CHAINS_CRYSTALIZE, + EVENT_TAIL_SWEEP +}; + enum Yells { - //Yell + // Yell SAY_AGGRO = 0, SAY_SLAY = 1, SAY_ENRAGE = 2, @@ -51,163 +56,166 @@ enum Yells enum Misc { DATA_INTENSE_COLD = 1, - DATA_CONTAINMENT_SPHERES = 3, + DATA_CONTAINMENT_SPHERES = 3 }; class boss_keristrasza : public CreatureScript { -public: - boss_keristrasza() : CreatureScript("boss_keristrasza") { } + public: + boss_keristrasza() : CreatureScript("boss_keristrasza") { } - CreatureAI* GetAI(Creature* creature) const override - { - return GetInstanceAI(creature); - } - - struct boss_keristraszaAI : public ScriptedAI - { - boss_keristraszaAI(Creature* creature) : ScriptedAI(creature) + struct boss_keristraszaAI : public BossAI { - Initialize(); - instance = creature->GetInstanceScript(); - } - - void Initialize() - { - uiCrystalfireBreathTimer = 14 * IN_MILLISECONDS; - uiCrystalChainsCrystalizeTimer = DUNGEON_MODE(30 * IN_MILLISECONDS, 11 * IN_MILLISECONDS); - uiTailSweepTimer = 5 * IN_MILLISECONDS; - bEnrage = false; - - intenseCold = true; - } - - InstanceScript* instance; - - GuidList intenseColdList; - ObjectGuid auiContainmentSphereGUIDs[DATA_CONTAINMENT_SPHERES]; - uint32 uiCrystalfireBreathTimer; - uint32 uiCrystalChainsCrystalizeTimer; - uint32 uiTailSweepTimer; - bool intenseCold; - bool bEnrage; - - void Reset() override - { - Initialize(); - intenseColdList.clear(); - - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); - - RemovePrison(CheckContainmentSpheres()); - - instance->SetBossState(DATA_KERISTRASZA, NOT_STARTED); - } - - void EnterCombat(Unit* /*who*/) override - { - Talk(SAY_AGGRO); - DoCastAOE(SPELL_INTENSE_COLD); - - instance->SetBossState(DATA_KERISTRASZA, IN_PROGRESS); - } - - void JustDied(Unit* /*killer*/) override - { - Talk(SAY_DEATH); - - instance->SetBossState(DATA_KERISTRASZA, DONE); - } - - void KilledUnit(Unit* who) override - { - if (who->GetTypeId() == TYPEID_PLAYER) - Talk(SAY_SLAY); - } - - bool CheckContainmentSpheres(bool remove_prison = false) - { - auiContainmentSphereGUIDs[0] = instance->GetGuidData(ANOMALUS_CONTAINMET_SPHERE); - auiContainmentSphereGUIDs[1] = instance->GetGuidData(ORMOROKS_CONTAINMET_SPHERE); - auiContainmentSphereGUIDs[2] = instance->GetGuidData(TELESTRAS_CONTAINMET_SPHERE); - - GameObject* ContainmentSpheres[DATA_CONTAINMENT_SPHERES]; - - for (uint8 i = 0; i < DATA_CONTAINMENT_SPHERES; ++i) + boss_keristraszaAI(Creature* creature) : BossAI(creature, DATA_KERISTRASZA) { - ContainmentSpheres[i] = instance->instance->GetGameObject(auiContainmentSphereGUIDs[i]); - if (!ContainmentSpheres[i]) - return false; - if (ContainmentSpheres[i]->GetGoState() != GO_STATE_ACTIVE) - return false; - } - if (remove_prison) - RemovePrison(true); - return true; - } - - void RemovePrison(bool remove) - { - if (remove) - { - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - if (me->HasAura(SPELL_FROZEN_PRISON)) - me->RemoveAurasDueToSpell(SPELL_FROZEN_PRISON); - } - else - { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - DoCast(me, SPELL_FROZEN_PRISON, false); - } - } - - void SetGUID(ObjectGuid guid, int32 id/* = 0 */) override - { - if (id == DATA_INTENSE_COLD) - intenseColdList.push_back(guid); - } - - void UpdateAI(uint32 diff) override - { - if (!UpdateVictim()) - return; - - if (!bEnrage && HealthBelowPct(25)) - { - Talk(SAY_ENRAGE); - Talk(SAY_FRENZY); - DoCast(me, SPELL_ENRAGE); - bEnrage = true; + Initialize(); } - if (uiCrystalfireBreathTimer <= diff) + void Initialize() { - DoCastVictim(SPELL_CRYSTALFIRE_BREATH); - uiCrystalfireBreathTimer = 14*IN_MILLISECONDS; - } else uiCrystalfireBreathTimer -= diff; + _enrage = false; + _intenseCold = true; + } - if (uiTailSweepTimer <= diff) + void Reset() override { - DoCast(me, SPELL_TAIL_SWEEP); - uiTailSweepTimer = 5*IN_MILLISECONDS; - } else uiTailSweepTimer -= diff; + Initialize(); + _intenseColdList.clear(); - if (uiCrystalChainsCrystalizeTimer <= diff) + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); + + RemovePrison(CheckContainmentSpheres()); + _Reset(); + } + + void EnterCombat(Unit* /*who*/) override { - Talk(SAY_CRYSTAL_NOVA); - if (IsHeroic()) - DoCast(me, SPELL_CRYSTALIZE); - else if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - DoCast(target, SPELL_CRYSTAL_CHAINS); - uiCrystalChainsCrystalizeTimer = DUNGEON_MODE(30*IN_MILLISECONDS, 11*IN_MILLISECONDS); - } else uiCrystalChainsCrystalizeTimer -= diff; + Talk(SAY_AGGRO); + DoCastAOE(SPELL_INTENSE_COLD); + _EnterCombat(); - DoMeleeAttackIfReady(); + events.ScheduleEvent(EVENT_CRYSTAL_FIRE_BREATH, 14000); + events.ScheduleEvent(EVENT_CRYSTAL_CHAINS_CRYSTALIZE, DUNGEON_MODE(30000, 11000)); + events.ScheduleEvent(EVENT_TAIL_SWEEP, 5000); + } + + void JustDied(Unit* /*killer*/) override + { + Talk(SAY_DEATH); + _JustDied(); + } + + void KilledUnit(Unit* who) override + { + if (who->GetTypeId() == TYPEID_PLAYER) + Talk(SAY_SLAY); + } + + bool CheckContainmentSpheres(bool remove_prison = false) + { + ContainmentSphereGUIDs[0] = instance->GetGuidData(ANOMALUS_CONTAINMET_SPHERE); + ContainmentSphereGUIDs[1] = instance->GetGuidData(ORMOROKS_CONTAINMET_SPHERE); + ContainmentSphereGUIDs[2] = instance->GetGuidData(TELESTRAS_CONTAINMET_SPHERE); + + GameObject* ContainmentSpheres[DATA_CONTAINMENT_SPHERES]; + + for (uint8 i = 0; i < DATA_CONTAINMENT_SPHERES; ++i) + { + ContainmentSpheres[i] = ObjectAccessor::GetGameObject(*me, ContainmentSphereGUIDs[i]); + if (!ContainmentSpheres[i]) + return false; + if (ContainmentSpheres[i]->GetGoState() != GO_STATE_ACTIVE) + return false; + } + if (remove_prison) + RemovePrison(true); + return true; + } + + void RemovePrison(bool remove) + { + if (remove) + { + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + if (me->HasAura(SPELL_FROZEN_PRISON)) + me->RemoveAurasDueToSpell(SPELL_FROZEN_PRISON); + } + else + { + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + DoCast(me, SPELL_FROZEN_PRISON, false); + } + } + + void SetGUID(ObjectGuid guid, int32 id/* = 0 */) override + { + if (id == DATA_INTENSE_COLD) + _intenseColdList.push_back(guid); + } + + void DamageTaken(Unit* /*attacker*/, uint32& damage) override + { + if (!_enrage && me->HealthBelowPctDamaged(25, damage)) + { + Talk(SAY_ENRAGE); + Talk(SAY_FRENZY); + DoCast(me, SPELL_ENRAGE); + _enrage = true; + } + } + + void UpdateAI(uint32 diff) override + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_CRYSTAL_FIRE_BREATH: + DoCastVictim(SPELL_CRYSTALFIRE_BREATH); + events.ScheduleEvent(EVENT_CRYSTAL_FIRE_BREATH, 14000); + break; + case EVENT_CRYSTAL_CHAINS_CRYSTALIZE: + DoCast(me, SPELL_TAIL_SWEEP); + events.ScheduleEvent(EVENT_CRYSTAL_CHAINS_CRYSTALIZE, 5000); + break; + case EVENT_TAIL_SWEEP: + Talk(SAY_CRYSTAL_NOVA); + if (IsHeroic()) + DoCast(me, SPELL_CRYSTALIZE); + else if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true)) + DoCast(target, SPELL_CRYSTAL_CHAINS); + events.ScheduleEvent(EVENT_TAIL_SWEEP, DUNGEON_MODE(30000, 11000)); + break; + default: + break; + } + } + + DoMeleeAttackIfReady(); + } + + private: + bool _intenseCold; + bool _enrage; + ObjectGuid ContainmentSphereGUIDs[DATA_CONTAINMENT_SPHERES]; + public: + GuidList _intenseColdList; + }; + + CreatureAI* GetAI(Creature* creature) const override + { + return GetInstanceAI(creature); } - }; - }; class containment_sphere : public GameObjectScript @@ -277,9 +285,9 @@ class achievement_intense_cold : public AchievementCriteriaScript if (!target) return false; - GuidList intenseColdList = ENSURE_AI(boss_keristrasza::boss_keristraszaAI, target->ToCreature()->AI())->intenseColdList; - if (!intenseColdList.empty()) - for (GuidList::iterator itr = intenseColdList.begin(); itr != intenseColdList.end(); ++itr) + GuidList _intenseColdList = ENSURE_AI(boss_keristrasza::boss_keristraszaAI, target->ToCreature()->AI())->_intenseColdList; + if (!_intenseColdList.empty()) + for (GuidList::iterator itr = _intenseColdList.begin(); itr != _intenseColdList.end(); ++itr) if (player->GetGUID() == *itr) return false; From 411e04811a7f9d8e51ebfc2752f96ec5f4c355dc Mon Sep 17 00:00:00 2001 From: Nyeriah Date: Sun, 28 Dec 2014 20:52:28 -0200 Subject: [PATCH 09/18] DB/Creature: Add trigger and civilian flags to the other difficulty entries of the Combustion trigger --- sql/updates/world/2014_12_28_04_world.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/2014_12_28_04_world.sql diff --git a/sql/updates/world/2014_12_28_04_world.sql b/sql/updates/world/2014_12_28_04_world.sql new file mode 100644 index 00000000000..8a1b29a8169 --- /dev/null +++ b/sql/updates/world/2014_12_28_04_world.sql @@ -0,0 +1,2 @@ +-- Ruby Sanctum Combustion triggers +UPDATE `creature_template` SET `flags_extra` = `flags_extra` |2|138 WHERE `entry` IN (40670, 40671, 40672); From be544545388b8622f0f8917dc93b52c5108c5868 Mon Sep 17 00:00:00 2001 From: Nyeriah Date: Mon, 29 Dec 2014 00:53:18 -0200 Subject: [PATCH 10/18] DB/Creature: Fix a typo mess up --- sql/updates/world/2014_12_28_05_world.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/2014_12_28_05_world.sql diff --git a/sql/updates/world/2014_12_28_05_world.sql b/sql/updates/world/2014_12_28_05_world.sql new file mode 100644 index 00000000000..f3fd0021214 --- /dev/null +++ b/sql/updates/world/2014_12_28_05_world.sql @@ -0,0 +1,2 @@ +-- +UPDATE `creature_template` SET `flags_extra` = 130 WHERE `entry` IN (40670, 40671, 40672); From 9671d513273867e62d520ec3d71b4c038802f5ab Mon Sep 17 00:00:00 2001 From: Nyeriah Date: Mon, 29 Dec 2014 04:05:10 -0200 Subject: [PATCH 11/18] Scripts/Ulduar: Fixes Flame Leviathan entering evade mode if Pursue returns no target * Pursue is never cast on players at retail, however, being there without a vehicle doesn't prevent the boss from attacking you, nor does it enter evade mode. Closes #11199 --- .../Ulduar/Ulduar/boss_flame_leviathan.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp index a240bc89a5e..c1568431809 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp @@ -548,6 +548,11 @@ class boss_flame_leviathan : public CreatureScript if (me->isAttackReady()) { Unit* target = ObjectAccessor::GetUnit(*me, _pursueTarget); + + // Pursue was unable to acquire a valid target, so get the current victim as target. + if (!target && me->GetVictim()) + target = me->GetVictim(); + if (me->IsWithinCombatRange(target, 30.0f)) { DoCast(target, SPELL_BATTERING_RAM); @@ -1648,7 +1653,7 @@ class FlameLeviathanPursuedTargetSelector bool operator()(WorldObject* target) const { - //! No players, only vehicles (@todo check if blizzlike) + //! No players, only vehicles. Pursue is never cast on players. Creature* creatureTarget = target->ToCreature(); if (!creatureTarget) return true; @@ -1698,12 +1703,7 @@ class spell_pursue : public SpellScriptLoader void FilterTargets(std::list& targets) { targets.remove_if(FlameLeviathanPursuedTargetSelector(GetCaster())); - if (targets.empty()) - { - if (Creature* caster = GetCaster()->ToCreature()) - caster->AI()->EnterEvadeMode(); - } - else + if (!targets.empty()) { //! In the end, only one target should be selected _target = Trinity::Containers::SelectRandomContainerElement(targets); From 4d2c35e81604e59b5bb518fdf36202629ed45d7f Mon Sep 17 00:00:00 2001 From: Aokromes Date: Mon, 29 Dec 2014 11:14:56 +0100 Subject: [PATCH 12/18] DB/Creature: Fix for Bleeding Hallow Dark Shaman without waypoint data By Kittnz, closes #13810 --- sql/updates/world/2014_12_29_00_world.sql | 26 +++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 sql/updates/world/2014_12_29_00_world.sql diff --git a/sql/updates/world/2014_12_29_00_world.sql b/sql/updates/world/2014_12_29_00_world.sql new file mode 100644 index 00000000000..f58c76137b1 --- /dev/null +++ b/sql/updates/world/2014_12_29_00_world.sql @@ -0,0 +1,26 @@ +-- Pathing for Bleeding Hollow Dark Shaman Entry: 16873 'TDB FORMAT' +SET @NPC := 29978; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-945.313,`position_y`=1948.252,`position_z`=67.06455 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-945.313,1948.252,67.06455,0,0,0,0,100,0), +(@PATH,2,-946.7964,1966.628,67.06455,0,0,0,0,100,0), +(@PATH,3,-932.1639,1983.549,66.96194,0,0,0,0,100,0), +(@PATH,4,-914.9733,1976.555,67.05032,0,0,0,0,100,0), +(@PATH,5,-929.8001,1991.014,66.44107,0,0,0,0,100,0), +(@PATH,6,-929.8001,1991.014,66.44107,0,0,0,0,100,0), +(@PATH,7,-941.426,2015.632,66.31691,0,0,0,0,100,0), +(@PATH,8,-965.7396,2015.727,67.03322,0,0,0,0,100,0), +(@PATH,9,-968.4443,2047.705,67.06454,0,0,0,0,100,0), +(@PATH,10,-965.7396,2015.727,67.03322,0,0,0,0,100,0), +(@PATH,11,-965.7396,2015.727,67.03322,0,0,0,0,100,0), +(@PATH,12,-941.426,2015.632,66.31691,0,0,0,0,100,0), +(@PATH,13,-929.8001,1991.014,66.44107,0,0,0,0,100,0), +(@PATH,14,-914.9733,1976.555,67.05032,0,0,0,0,100,0), +(@PATH,15,-914.9733,1976.555,67.05032,0,0,0,0,100,0), +(@PATH,16,-932.1639,1983.549,66.96194,0,0,0,0,100,0), +(@PATH,17,-946.7964,1966.628,67.06455,0,0,0,0,100,0); +-- 0xF13041E90061F326 .go -945.313 1948.252 67.06455 From 747e72fc1c56384ccda5ea6972ece0c06f9fc832 Mon Sep 17 00:00:00 2001 From: Aokromes Date: Mon, 29 Dec 2014 11:39:23 +0100 Subject: [PATCH 13/18] DB/Creature: Icecrown/Wrathgate - 1 By Kittnz, closes #13801 --- sql/updates/world/2014_12_29_01_world.sql | 348 ++++++++++++++++++++++ 1 file changed, 348 insertions(+) create mode 100644 sql/updates/world/2014_12_29_01_world.sql diff --git a/sql/updates/world/2014_12_29_01_world.sql b/sql/updates/world/2014_12_29_01_world.sql new file mode 100644 index 00000000000..06af046dc68 --- /dev/null +++ b/sql/updates/world/2014_12_29_01_world.sql @@ -0,0 +1,348 @@ +-- Too many or incorrect npc spawns +DELETE FROM `creature` WHERE `guid` IN (105129,97882,97881,97886,97888,97880,97898,111144,111168, 99232); + +-- Pathing for Rustler Burnhoof Entry: 27750 'TDB FORMAT' +SET @NPC := 105130; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=4903.906,`position_y`=1220.93,`position_z`=223.7604 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,4903.906,1220.93,223.7604,0,1000,0,0,100,0), +(@PATH,2,4907.209,1219.953,222.8496,0,0,0,0,100,0), +(@PATH,3,4905.934,1220.017,223.2021,0,0,0,0,100,0), +(@PATH,4,4902.668,1221.12,224.2068,0,1000,0,0,100,0), +(@PATH,5,4903.906,1220.93,223.7604,0,0,0,0,100,0), +(@PATH,6,4907.628,1220.036,222.8975,0,0,0,0,100,0), +(@PATH,7,4905.934,1220.017,223.2021,0,0,0,0,100,0), +(@PATH,8,4902.884,1221.202,224.2569,0,0,0,0,100,0); +-- 0x1C10F047601B198000000900001F1A2A .go 4903.906 1220.93 223.7604 + +-- Update SAI for waypoints +-- Darkspear Spear Thrower SAI +SET @ENTRY := 27560; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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 +(@ENTRY,0,0,1,1,0,100,1,0,0,0,0,21,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Darkspear Spear Thrower - Out of Combat - Enable Combat Movement (No Repeat)"), +(@ENTRY,0,1,0,61,0,100,0,0,0,0,0,20,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Darkspear Spear Thrower - Out of Combat - Stop Attacking (No Repeat)"), +(@ENTRY,0,2,3,4,0,100,1,0,0,0,0,11,6660,0,0,0,0,0,2,0,0,0,0,0,0,0,"Darkspear Spear Thrower - On Aggro - Cast 'Shoot' (No Repeat)"), +(@ENTRY,0,3,0,61,0,100,0,0,0,0,0,23,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Darkspear Spear Thrower - On Aggro - Increment Phase By 1 (No Repeat)"), +(@ENTRY,0,4,5,9,1,100,0,5,35,2300,3900,11,6660,0,0,0,0,0,2,0,0,0,0,0,0,0,"Darkspear Spear Thrower - Within 5-35 Range - Cast 'Shoot' (Phase 1)"), +(@ENTRY,0,5,0,61,1,100,0,0,0,0,0,40,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Darkspear Spear Thrower - Within 5-35 Range - Set Sheath Ranged (Phase 1)"), +(@ENTRY,0,6,7,9,1,100,0,30,80,0,0,21,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Darkspear Spear Thrower - Within 30-80 Range - Enable Combat Movement (Phase 1)"), +(@ENTRY,0,7,0,61,1,100,0,0,0,0,0,20,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Darkspear Spear Thrower - Within 30-80 Range - Start Attacking (Phase 1)"), +(@ENTRY,0,8,9,9,1,100,0,0,5,0,0,21,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Darkspear Spear Thrower - Within 0-5 Range - Enable Combat Movement (Phase 1)"), +(@ENTRY,0,9,10,61,1,100,0,0,0,0,0,40,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Darkspear Spear Thrower - Within 0-5 Range - Set Sheath Melee (Phase 1)"), +(@ENTRY,0,10,0,61,1,100,0,0,0,0,0,20,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Darkspear Spear Thrower - Within 0-5 Range - Start Attacking (Phase 1)"), +(@ENTRY,0,11,12,9,1,100,0,5,15,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Darkspear Spear Thrower - Within 5-15 Range - Disable Combat Movement (Phase 1)"), +(@ENTRY,0,12,0,61,1,100,0,0,0,0,0,20,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Darkspear Spear Thrower - Within 5-15 Range - Stop Attacking (Phase 1)"), +(@ENTRY,0,13,0,9,0,100,0,0,20,9000,14000,11,12024,1,0,0,0,0,2,0,0,0,0,0,0,0,"Darkspear Spear Thrower - Within 0-20 Range - Cast 'Net' (Phase 1)"), +(@ENTRY,0,14,0,7,0,100,1,0,0,0,0,40,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Darkspear Spear Thrower - On Evade - Set Sheath Melee (Phase 1)"); + +-- Pathing for Darkspear Spear Thrower Entry: 27560 'TDB FORMAT' +SET @NPC := 111723; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=5064.595,`position_y`=1152.95,`position_z`=256.9933 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,5064.595,1152.95,256.9933,0,0,0,0,100,0), +(@PATH,2,5070.195,1148.834,258.9739,0,0,0,0,100,0), +(@PATH,3,5073.693,1146.814,259.7574,0,0,0,0,100,0), +(@PATH,4,5064.595,1152.95,256.9933,0,0,0,0,100,0), +(@PATH,5,5070.188,1148.872,259.0485,0,0,0,0,100,0), +(@PATH,6,5073.804,1146.81,259.5706,0,0,0,0,100,0), +(@PATH,7,5078.612,1145.942,259.8978,0,0,0,0,100,0), +(@PATH,8,5067.567,1150.284,258.2607,0,0,0,0,100,0), +(@PATH,9,5063.21,1155.218,255.487,0,0,0,0,100,0); +-- 0x1C10F047601AEA0000000B00019A427C .go 5064.595 1152.95 256.9933 + +-- Pathing for Darkspear Spear Thrower Entry: 27560 'TDB FORMAT' +SET @NPC := 111724; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=4911.591,`position_y`=1159.036,`position_z`=236.6868 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,4911.591,1159.036,236.6868,0,0,0,0,100,0), +(@PATH,2,4911.276,1158.72,236.4579,0,0,0,0,100,0), +(@PATH,3,4911.188,1158.772,236.7394,0,0,0,0,100,0), +(@PATH,4,4899.376,1152.87,236.8453,0,0,0,0,100,0), +(@PATH,5,4894.586,1145.359,234.9626,0,0,0,0,100,0), +(@PATH,6,4897.318,1151.077,236.903,0,0,0,0,100,0), +(@PATH,7,4901.86,1152.988,236.7417,0,0,0,0,100,0), +(@PATH,8,4906.159,1153.659,236.4303,0,0,0,0,100,0); +-- 0x1C10F047601AEA0000000B00009A427C .go 4911.591 1159.036 236.6868 + +-- Pathing for Darkspear Spear Thrower Entry: 27560 'TDB FORMAT' +SET @NPC := 111725; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=4920.973,`position_y`=1199.484,`position_z`=220.5279 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,4920.973,1199.484,220.5279,0,10000,0,0,100,0), +(@PATH,2,4906.262,1193.945,216.8263,0,0,0,0,100,0), +(@PATH,3,4896.307,1191.923,213.5118,0,0,0,0,100,0), +(@PATH,4,4877.854,1191.151,207.1242,0,0,0,0,100,0), +(@PATH,5,4869.318,1191.457,203.3286,0,0,0,0,100,0), +(@PATH,6,4861.047,1185.213,197.0835,0,0,0,0,100,0), +(@PATH,7,4855.936,1177.188,191.9594,0,0,0,0,100,0), +(@PATH,8,4851.635,1166.61,185.649,0,0,0,0,100,0), +(@PATH,9,4851.767,1158.619,182.5839,0,0,0,0,100,0), +(@PATH,10,4851.611,1145.529,178.0937,0,0,0,0,100,0), +(@PATH,11,4848.171,1135.259,173.5705,0,0,0,0,100,0), +(@PATH,12,4841.896,1128.136,169.8648,0,0,0,0,100,0), +(@PATH,13,4829.645,1127.843,162.5515,0,0,0,0,100,0), +(@PATH,14,4817.105,1120.131,150.2594,0,0,0,0,100,0), +(@PATH,15,4837.624,1131.328,167.8283,0,0,0,0,100,0), +(@PATH,16,4843.094,1133.076,170.812,0,0,0,0,100,0), +(@PATH,17,4849.752,1146.139,177.2836,0,0,0,0,100,0), +(@PATH,18,4851.623,1160.048,182.5452,0,0,0,0,100,0), +(@PATH,19,4853.529,1172.237,188.9928,0,0,0,0,100,0), +(@PATH,20,4860.48,1186.084,197.2776,0,0,0,0,100,0), +(@PATH,21,4865.775,1191.164,201.062,0,0,0,0,100,0), +(@PATH,22,4882.853,1189.864,208.7863,0,0,0,0,100,0), +(@PATH,23,4898.756,1190.01,214.2629,0,0,0,0,100,0), +(@PATH,24,4903.106,1189.946,216.3225,0,0,0,0,100,0), +(@PATH,25,4916.818,1193.317,219.5798,0,0,0,0,100,0), +(@PATH,26,4927.818,1197.552,223.1037,0,0,0,0,100,0), +(@PATH,27,4934.524,1200.075,224.6629,0,0,0,0,100,0); +-- 0x1C10F047601AEA0000000900001F18A3 .go 4920.973 1199.484 220.5279 + +DELETE FROM `creature_formations` WHERE `leaderGUID`=111218; +INSERT INTO `creature_formations` (`leaderGUID`, `memberGUID`, `dist`, `angle`, `groupAI`) VALUES +(111218, 111218, 0, 0, 2), +(111218, 111212, 3, 270, 2); + +-- Make the second guard sit on a wolf +DELETE FROM `creature_addon` WHERE `guid`=111212; +INSERT INTO `creature_addon` (`guid`, `mount`, `bytes2`) VALUES (111212, 14574, 1); + +-- Pathing for Kor'kron Vanguard Entry: 27553 'TDB FORMAT' +SET @NPC := 111218; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=4924.406,`position_y`=1275.88,`position_z`=226.2913 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,14574,0,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,4924.406,1275.88,226.2913,0,0,0,0,100,0), +(@PATH,2,4937.631,1293.169,231.839,0,0,0,0,100,0), +(@PATH,3,4942.635,1298.434,233.2347,0,0,0,0,100,0), +(@PATH,4,4945.541,1308.453,235.1535,0,0,0,0,100,0), +(@PATH,5,4945.916,1311.464,235.4867,0,0,0,0,100,0), +(@PATH,6,4933.331,1328.104,234.9145,0,0,0,0,100,0), +(@PATH,7,4920.956,1329.519,232.9218,0,0,0,0,100,0), +(@PATH,8,4910.192,1318.32,229.7501,0,0,0,0,100,0), +(@PATH,9,4907.542,1298.864,227.4101,0,0,0,0,100,0), +(@PATH,10,4920.273,1273.854,225.6455,0,0,0,0,100,0), +(@PATH,11,4921.565,1272.237,225.4687,0,0,0,0,100,0), +(@PATH,12,4934.279,1260.357,225.9705,0,0,0,0,100,0), +(@PATH,13,4942.9,1231.032,225.8454,0,0,0,0,100,0), +(@PATH,14,4937.212,1219.435,224.397,0,0,0,0,100,0), +(@PATH,15,4911.338,1207.108,217.914,0,0,0,0,100,0), +(@PATH,16,4891.614,1199.313,212.0708,0,0,0,0,100,0), +(@PATH,17,4863.26,1198.326,202.0412,0,0,0,0,100,0), +(@PATH,18,4850.935,1180.464,192.229,0,0,0,0,100,0), +(@PATH,19,4847.402,1162.623,182.7594,0,0,0,0,100,0), +(@PATH,20,4841.849,1139.334,171.3826,0,0,0,0,100,0), +(@PATH,21,4820.599,1131.604,157.3213,0,0,0,0,100,0), +(@PATH,22,4801.356,1123.592,143.7112,0,0,0,0,100,0), +(@PATH,23,4793.032,1123.066,139.6156,0,0,0,0,100,0), +(@PATH,24,4768.374,1127.539,137.6369,0,0,0,0,100,0), +(@PATH,25,4754.815,1120.818,134.7707,0,0,0,0,100,0), +(@PATH,26,4756.951,1111.815,133.9409,0,0,0,0,100,0), +(@PATH,27,4783.79,1110.19,135.937,0,0,0,0,100,0), +(@PATH,28,4794.232,1119.631,139.188,0,0,0,0,100,0), +(@PATH,29,4821.204,1132.168,157.943,0,0,0,0,100,0), +(@PATH,30,4839.43,1138.844,170.0454,0,0,0,0,100,0), +(@PATH,31,4845.836,1150.71,177.3853,0,0,0,0,100,0), +(@PATH,32,4845.682,1166.896,184.5937,0,0,0,0,100,0), +(@PATH,33,4851.188,1179.674,191.6429,0,0,0,0,100,0), +(@PATH,34,4856.156,1191.45,197.6969,0,0,0,0,100,0), +(@PATH,35,4866.021,1197.9,202.6528,0,0,0,0,100,0), +(@PATH,36,4877.186,1197.585,207.2055,0,0,0,0,100,0), +(@PATH,37,4886.485,1195.461,210.3322,0,0,0,0,100,0), +(@PATH,38,4899.135,1196.966,214.2494,0,0,0,0,100,0), +(@PATH,39,4918.985,1205.409,219.7656,0,0,0,0,100,0), +(@PATH,40,4937.731,1213.068,223.7986,0,0,0,0,100,0), +(@PATH,41,4945.257,1216.732,225.4393,0,0,0,0,100,0), +(@PATH,42,4964.039,1213.632,227.3908,0,0,0,0,100,0), +(@PATH,43,4977.262,1211.667,228.8397,0,0,0,0,100,0), +(@PATH,44,4995.401,1220.229,230.2568,0,0,0,0,100,0), +(@PATH,45,5005.794,1216.344,229.7073,0,0,0,0,100,0), +(@PATH,46,4999.293,1203.755,229.2162,0,0,0,0,100,0), +(@PATH,47,4998.588,1202.614,228.9512,0,0,0,0,100,0), +(@PATH,48,4990.875,1206.203,228.9671,0,0,0,0,100,0), +(@PATH,49,4981.535,1210.325,228.6667,0,0,0,0,100,0), +(@PATH,50,4954.279,1220.26,226.6951,0,0,0,0,100,0), +(@PATH,51,4947.755,1223.85,226.0268,0,0,0,0,100,0), +(@PATH,52,4940.268,1236.863,226.4474,0,0,0,0,100,0), +(@PATH,53,4938.791,1241.772,226.2903,0,0,0,0,100,0), +(@PATH,54,4938.446,1241.541,226.0408,0,0,0,0,100,0), +(@PATH,55,4942.353,1231.415,225.6545,0,0,0,0,100,0), +(@PATH,56,4951.323,1221.968,226.2391,0,0,0,0,100,0), +(@PATH,57,4968.059,1214.005,228.1602,0,0,0,0,100,0), +(@PATH,58,4968.759,1213.868,228.1815,0,0,0,0,100,0), +(@PATH,59,4981.347,1210.41,228.6719,0,0,0,0,100,0), +(@PATH,60,4990.792,1206.41,229.0509,0,0,0,0,100,0), +(@PATH,61,5001.532,1208.859,229.2795,0,0,0,0,100,0), +(@PATH,62,5006.636,1217.603,229.9853,0,0,0,0,100,0), +(@PATH,63,4988.494,1214.931,229.4006,0,0,0,0,100,0), +(@PATH,64,4970.586,1211.76,228.4952,0,0,0,0,100,0), +(@PATH,65,4955.156,1216.567,226.4764,0,0,0,0,100,0), +(@PATH,66,4920.63,1206.658,220.0801,0,0,0,0,100,0), +(@PATH,67,4908.19,1199.289,216.899,0,0,0,0,100,0), +(@PATH,68,4888.762,1195.545,210.6963,0,0,0,0,100,0), +(@PATH,69,4878.838,1197.535,207.8827,0,0,0,0,100,0), +(@PATH,70,4868.977,1198.564,204.075,0,0,0,0,100,0), +(@PATH,71,4857.268,1192.864,198.429,0,0,0,0,100,0), +(@PATH,72,4852.329,1182.311,193.1272,0,0,0,0,100,0), +(@PATH,73,4846.871,1170.936,186.4543,0,0,0,0,100,0), +(@PATH,74,4846.116,1153.266,178.4778,0,0,0,0,100,0), +(@PATH,75,4840.938,1140.415,171.2645,0,0,0,0,100,0), +(@PATH,76,4822.356,1132.747,159.001,0,0,0,0,100,0), +(@PATH,77,4795.46,1120.689,140.3265,0,0,0,0,100,0), +(@PATH,78,4786.737,1111.815,136.5621,0,0,0,0,100,0), +(@PATH,79,4761.876,1105.746,133.8939,0,0,0,0,100,0), +(@PATH,80,4754.403,1118.203,134.364,0,0,0,0,100,0), +(@PATH,81,4764.019,1125.688,136.6772,0,0,0,0,100,0), +(@PATH,82,4782.308,1124.246,137.7441,0,0,0,0,100,0), +(@PATH,83,4797.498,1123.224,141.726,0,0,0,0,100,0), +(@PATH,84,4818.895,1130.859,156.3943,0,0,0,0,100,0), +(@PATH,85,4839.273,1137.457,169.8718,0,0,0,0,100,0), +(@PATH,86,4846.415,1158.605,180.5813,0,0,0,0,100,0), +(@PATH,87,4849.638,1177.232,190.3028,0,0,0,0,100,0), +(@PATH,88,4860.67,1196.271,200.4404,0,0,0,0,100,0), +(@PATH,89,4886.715,1198.448,210.6501,0,0,0,0,100,0), +(@PATH,90,4906.66,1204.837,216.6283,0,0,0,0,100,0), +(@PATH,91,4934.462,1217.512,223.728,0,0,0,0,100,0), +(@PATH,92,4940.261,1224.569,225.2942,0,0,0,0,100,0), +(@PATH,93,4940.506,1242.196,226.2575,0,0,0,0,100,0), +(@PATH,94,4933.305,1263.189,225.7185,0,0,0,0,100,0), +(@PATH,95,4931.952,1265.79,225.6381,0,0,0,0,100,0), +(@PATH,96,4907.601,1289.275,226.642,0,0,0,0,100,0), +(@PATH,97,4907.739,1309.926,228.4361,0,0,0,0,100,0), +(@PATH,98,4916.103,1327.044,231.7567,0,0,0,0,100,0), +(@PATH,99,4928.627,1329.424,234.3804,0,0,0,0,100,0), +(@PATH,100,4940.942,1320.479,235.4543,0,0,0,0,100,0), +(@PATH,101,4944.531,1301.983,234.3128,0,0,0,0,100,0), +(@PATH,102,4940.48,1296.446,232.8031,0,0,0,0,100,0), +(@PATH,103,4924.831,1276.205,226.2591,0,0,0,0,100,0); +-- 0x1C10F047601AE84000000A00001FFDD8 .go 4924.406 1275.88 226.2913 + +-- Pathing for Kor'kron Battle Wyvern Entry: 31269 'TDB FORMAT' +SET @NPC := 99228; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=5001.591,`position_y`=1222.632,`position_z`=256.7944 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,50331648,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,5001.591,1222.632,256.7944,0,0,0,0,100,0), +(@PATH,2,5030.151,1242.143,268.1555,0,0,0,0,100,0), +(@PATH,3,5016.198,1276.81,265.4842,0,0,0,0,100,0), +(@PATH,4,4991.751,1280.123,265.4842,0,0,0,0,100,0), +(@PATH,5,4956.835,1268.773,265.4842,0,0,0,0,100,0), +(@PATH,6,4938.806,1223.236,259.9842,0,0,0,0,100,0), +(@PATH,7,4926.227,1191.379,255.3177,0,0,0,0,100,0), +(@PATH,8,4900.753,1152.352,243.8777,0,0,0,0,100,0), +(@PATH,9,4881.784,1164.878,242.3777,0,0,0,0,100,0), +(@PATH,10,4851.181,1199.767,234.0444,0,0,0,0,100,0), +(@PATH,11,4846.833,1226.647,234.0444,0,0,0,0,100,0), +(@PATH,12,4855.959,1279.159,239.3777,0,0,0,0,100,0), +(@PATH,13,4911.077,1262.704,243.6555,0,0,0,0,100,0), +(@PATH,14,4964.954,1234.062,250.3221,0,0,0,0,100,0); +-- 0x2010F047601E894000000B00029A427C .go 5001.591 1222.632 256.7944 + +-- Pathing for Kor'kron Battle Wyvern Entry: 31269 'TDB FORMAT' +SET @NPC := 99227; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=4875.777,`position_y`=1347.747,`position_z`=240.9708 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,50331648,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,4875.777,1347.747,240.9708,0,0,0,0,100,0), +(@PATH,2,4900.708,1348.037,250.7207,0,0,0,0,100,0), +(@PATH,3,4926.32,1316.925,257.1653,0,0,0,0,100,0), +(@PATH,4,4938.213,1286.196,257.1653,0,0,0,0,100,0), +(@PATH,5,4947.025,1253.411,257.1653,0,0,0,0,100,0), +(@PATH,6,4945.441,1212.37,257.1653,0,0,0,0,100,0), +(@PATH,7,4948.411,1192.561,257.1653,0,0,0,0,100,0), +(@PATH,8,4972.647,1168.416,257.1653,0,0,0,0,100,0), +(@PATH,9,4995.961,1172.082,257.1653,0,0,0,0,100,0), +(@PATH,10,5004.243,1187.687,257.1653,0,0,0,0,100,0), +(@PATH,11,4989.543,1213.347,257.1653,0,0,0,0,100,0), +(@PATH,12,4965.152,1218.435,257.1653,0,0,0,0,100,0), +(@PATH,13,4923.045,1229.254,257.1653,0,0,0,0,100,0), +(@PATH,14,4887.481,1234.967,253.9984,0,0,0,0,100,0), +(@PATH,15,4851.523,1249.735,247.804,0,0,0,0,100,0), +(@PATH,16,4823.958,1288.316,234.6374,0,0,0,0,100,0), +(@PATH,17,4814.918,1327.853,230.693,0,0,0,0,100,0), +(@PATH,18,4853.216,1355.696,237.3319,0,0,0,0,100,0); +-- 0x2010F047601E894000000B00021A427C .go 4875.777 1347.747 240.9708 + +-- Pathing for Kor'kron Battle Wyvern Entry: 31269 'TDB FORMAT' +SET @NPC := 99230; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=5079.162,`position_y`=1142.135,`position_z`=267.7354 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,5079.162,1142.135,267.7354,0,0,0,0,100,0), +(@PATH,2,5078.512,1126.875,267.7354,0,0,0,0,100,0), +(@PATH,3,5055.61,1116.456,267.7354,0,0,0,0,100,0), +(@PATH,4,5039.365,1121.131,267.7354,0,0,0,0,100,0), +(@PATH,5,4967.615,1187.905,260.0954,0,0,0,0,100,0), +(@PATH,6,4945.081,1216.898,260.0954,0,0,0,0,100,0), +(@PATH,7,4956.427,1234.148,260.0954,0,0,0,0,100,0), +(@PATH,8,4960.777,1262.983,260.0954,0,0,0,0,100,0), +(@PATH,9,4914.742,1284.397,254.9566,0,0,0,0,100,0), +(@PATH,10,4891.905,1273.239,254.5677,0,0,0,0,100,0), +(@PATH,11,4867.362,1252.014,255.6233,0,0,0,0,100,0), +(@PATH,12,4872.584,1220.825,255.6233,0,0,0,0,100,0), +(@PATH,13,4921.48,1192.52,255.6233,0,0,0,0,100,0), +(@PATH,14,4940.803,1188.571,255.6233,0,0,0,0,100,0), +(@PATH,15,4982.143,1184.493,255.6233,0,0,0,0,100,0), +(@PATH,16,5063.028,1170.208,265.2344,0,0,0,0,100,0), +(@PATH,17,5072.713,1157.194,267.7354,0,0,0,0,100,0); +-- 0x2010F047601E894000000B00009A427C .go 5079.162 1142.135 267.7354 + +-- Some specific Kor'kron Battle Wyvern's shouldn't move. +UPDATE `creature` SET `MovementType`=0 WHERE `guid` IN (99246,99225,99226,99233); + +-- Make those peon's work +SET @NPC := 27558; +DELETE FROM `creature_template_addon` WHERE `entry`=@NPC; +INSERT INTO `creature_template_addon` (`entry`, `emote`) VALUES (@NPC, 234); + +-- Pathing for Warsong Peon Entry: 27558 'TDB FORMAT' +SET @NPC := 111465; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=5033.687,`position_y`=1241.426,`position_z`=231.0835 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,234, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,5033.687,1241.426,231.0835,0,10000,0,0,100,0), +(@PATH,2,5035.556,1229.439,230.2363,0,0,0,0,100,0), +(@PATH,3,5040.211,1214.877,229.068,0,0,0,0,100,0), +(@PATH,4,5040.954,1202.383,228.5539,0,0,0,0,100,0), +(@PATH,5,5040.104,1193.25,228.4282,0,0,0,0,100,0), +(@PATH,6,5031.986,1186.173,228.1725,0,10000,0,0,100,0), +(@PATH,7,5040.118,1194.927,228.1124,0,0,0,0,100,0), +(@PATH,8,5040.393,1195.888,228.1124,0,0,0,0,100,0), +(@PATH,9,5042.309,1202.575,228.527,0,0,0,0,100,0), +(@PATH,10,5040.336,1213.374,228.7625,0,0,0,0,100,0), +(@PATH,11,5040.336,1213.374,228.7625,0,0,0,0,100,0), +(@PATH,12,5038.792,1223.162,229.6375,0,0,0,0,100,0), +(@PATH,13,5033.343,1233.986,230.8479,0,0,0,0,100,0); +-- 0x1C10F047601AE98000000B00029A427C .go 5033.687 1241.426 231.0835 From cc00321409707e50da0826b758bcd1242d7fcec7 Mon Sep 17 00:00:00 2001 From: Aokromes Date: Mon, 29 Dec 2014 12:25:17 +0100 Subject: [PATCH 14/18] DB/Creature: Fix some startup errors By Kittnz, closes #13811 --- sql/updates/world/2014_12_29_02_world.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 sql/updates/world/2014_12_29_02_world.sql diff --git a/sql/updates/world/2014_12_29_02_world.sql b/sql/updates/world/2014_12_29_02_world.sql new file mode 100644 index 00000000000..2872d26acd1 --- /dev/null +++ b/sql/updates/world/2014_12_29_02_world.sql @@ -0,0 +1,4 @@ +-- +UPDATE `creature` SET `spawndist`=0 WHERE `guid` IN (99225, 99226, 99233, 99246); +DELETE FROM `creature_addon` WHERE `guid`=99232; +UPDATE `creature` SET `orientation`=0 WHERE `guid`=29978; From a5d6f1d6cd4f9127bc788c24e53d04fa1ba55a10 Mon Sep 17 00:00:00 2001 From: Dr-J Date: Tue, 30 Dec 2014 20:27:31 +0000 Subject: [PATCH 15/18] DB/Misc: Commoner Texts Add various texts to racial commoners in game, this is not complete yet and the gaps in sai and text groups are deliberate so that when missing texts come up these can be added easily If anyone has any sniffs of any more of these texts please let me know as have noticed the majority of these exist in broadcast text in languages 0,1 & 7, 0 for goblin commoners, 1 for horde commoners, 7 for alliance commoners theres only certain texts which only exist in one or the other faction, Anyway this will take a while to complete if anyone already has sniffs of texts from commoners during events they will help or otherwise this will take at least a year to complete if I have to sniff myself --- sql/updates/world/2014_12_30_00_world.sql | 125 ++++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 sql/updates/world/2014_12_30_00_world.sql diff --git a/sql/updates/world/2014_12_30_00_world.sql b/sql/updates/world/2014_12_30_00_world.sql new file mode 100644 index 00000000000..c977412e5d3 --- /dev/null +++ b/sql/updates/world/2014_12_30_00_world.sql @@ -0,0 +1,125 @@ +-- Lunar 0 +-- Lita 1 +-- Noblegarden 2 +-- Childrens week 3 +-- Midsummer 4 +-- Brewfest 5 +-- Hallows End 6 +-- Pilgrims 7 +-- Winterveil 8 + +-- Undead Hallows End Winterveil +-- Bloodelf Luna winterveil midsummer +-- Orc Luna brewfest hallows end +-- Troll Luna +-- Tauren +-- Goblin Hallows end Winterveil +-- Human Luna Hallows end +-- Gnome Hallows end +-- Dwarf +-- Lunar +-- Night elf +-- Dreanei Brewfest + +UPDATE `creature_template` SET `ainame`='SmartAI', `scriptname`='' WHERE `entry`IN(20102,18927,19177,19169,19175,19171,19172,19176,19178); + +DELETE FROM `smart_scripts` WHERE `entryorguid`IN(20102,18927,19177,19169,19175,19171,19172,19176,19178) 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 +(20102,0,0,0,1,0,100,0,3000,15000,45000,90000,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Goblin Commoner - OOC - Say'), +(18927,0,0,0,1,0,100,0,3000,15000,45000,90000,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Human Commoner - OOC - Say'), +(19177,0,0,0,1,0,100,0,3000,15000,45000,90000,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Troll Commoner - OOC - Say'), +(19169,0,0,0,1,0,100,0,3000,15000,45000,90000,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Blood Elf Commoner - OOC - Say'), +(19175,0,0,0,1,0,100,0,3000,15000,45000,90000,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Orc Commoner - OOC - Say'), +(19169,0,4,0,1,0,100,0,3000,15000,45000,90000,1,4,0,0,0,0,0,1,0,0,0,0,0,0,0,'Blood Elf Commoner - OOC - Say'), +(19175,0,5,0,1,0,100,0,3000,15000,45000,90000,1,5,0,0,0,0,0,1,0,0,0,0,0,0,0,'Orc Commoner - OOC - Say'), +(19171,0,5,0,1,0,100,0,3000,15000,45000,90000,1,5,0,0,0,0,0,1,0,0,0,0,0,0,0,'Blood Elf Commoner - OOC - Say'), +(20102,0,6,0,1,0,100,0,3000,15000,45000,90000,1,6,0,0,0,0,0,1,0,0,0,0,0,0,0,'Goblin Commoner - OOC - Say'), +(19172,0,6,0,1,0,100,0,3000,15000,45000,90000,1,6,0,0,0,0,0,1,0,0,0,0,0,0,0,'Gnome Commoner - OOC - Say'), +(18927,0,6,0,1,0,100,0,3000,15000,45000,90000,1,6,0,0,0,0,0,1,0,0,0,0,0,0,0,'Human Commoner - OOC - Say'), +(19175,0,6,0,1,0,100,0,3000,15000,45000,90000,1,6,0,0,0,0,0,1,0,0,0,0,0,0,0,'Orc Commoner - OOC - Say'), +(19178,0,6,0,1,0,100,0,3000,15000,45000,90000,1,6,0,0,0,0,0,1,0,0,0,0,0,0,0,'Forsaken Commoner - OOC - Say'), +(19178,0,8,0,1,0,100,0,3000,15000,45000,90000,1,8,0,0,0,0,0,1,0,0,0,0,0,0,0,'Forsaken Commoner - OOC - Say'), +(20102,0,8,0,1,0,100,0,3000,15000,45000,90000,1,8,0,0,0,0,0,1,0,0,0,0,0,0,0,'Goblin Commoner - OOC - Say'), +(19169,0,8,0,1,0,100,0,3000,15000,45000,90000,1,8,0,0,0,0,0,1,0,0,0,0,0,0,0,'Blood Elf Commoner - OOC - Say'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry` in(20102,18927,19177,19169,19175,19171,19172,19176,19178); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(22, 1, 20102, 0, 0, 12, 1, 7, 0, 0, 0, 0, 0, '', 'Commoner - Luna Festival must be active'), +(22, 1, 18927, 0, 0, 12, 1, 7, 0, 0, 0, 0, 0, '', 'Commoner - Luna Festival must be active'), +(22, 1, 19175, 0, 0, 12, 1, 7, 0, 0, 0, 0, 0, '', 'Commoner - Luna Festival must be active'), +(22, 1, 19169, 0, 0, 12, 1, 7, 0, 0, 0, 0, 0, '', 'Commoner - Luna Festival must be active'), +(22, 1, 19177, 0, 0, 12, 1, 7, 0, 0, 0, 0, 0, '', 'Commoner - Luna Festival must be active'), +(22, 5, 19169, 0, 0, 12, 1, 1, 0, 0, 0, 0, 0, '', 'Commoner - Midsummer must be active'), +(22, 6, 19175, 0, 0, 12, 1, 24, 0, 0, 0, 0, 0, '', 'Commoner - BrewFest must be active'), +(22, 6, 19171, 0, 0, 12, 1, 24, 0, 0, 0, 0, 0, '', 'Commoner - BrewFest must be active'), +(22, 7, 20102, 0, 0, 12, 1, 12, 0, 0, 0, 0, 0, '', 'Commoner - Hallows End must be active'), +(22, 7, 19172, 0, 0, 12, 1, 12, 0, 0, 0, 0, 0, '', 'Commoner - Hallows End must be active'), +(22, 7, 18927, 0, 0, 12, 1, 12, 0, 0, 0, 0, 0, '', 'Commoner - Hallows End must be active'), +(22, 7, 19175, 0, 0, 12, 1, 12, 0, 0, 0, 0, 0, '', 'Commoner - Hallows End must be active'), +(22, 7, 19178, 0, 0, 12, 1, 12, 0, 0, 0, 0, 0, '', 'Commoner - Hallows End must be active'), +(22, 9, 20102, 0, 0, 12, 1, 2, 0, 0, 0, 0, 0, '', 'Commoner - Winterveil must be active'), +(22, 9, 19169, 0, 0, 12, 1, 2, 0, 0, 0, 0, 0, '', 'Commoner - Winterveil must be active'), +(22, 9, 19178, 0, 0, 12, 1, 2, 0, 0, 0, 0, 0, '', 'Commoner - Winterveil must be active'); + +DELETE FROM `creature_text` WHERE `entry` IN(20102,18927,19177,19169,19175,19171,19172,19176,19178); +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextID`, `comment`) VALUES +(20102, 0, 0, 'Legend says that the great beast Omen sleeps in the waters of Lake Elune''ara in Moonglade, only to appear once a year. But that''s just a legend.', 12, 0, 100, 0, 0, 0, 16465, 'Goblin Commoner to Goblin Commoner'), +(20102, 0, 1, 'The druids of Nighthaven are holding a great celebration in Moonglade for the Lunar Festival.', 12, 0, 100, 0, 0, 0, 16468, 'Goblin Commoner to Goblin Commoner'), +(18927, 0, 0, 'During the Lunar Festival, we should take time to seek out our elders and consider their wisdom.', 12, 7, 100, 274, 0, 0, 24350, 'Human Commoner to Human Commoner'), +(19177, 0, 0, 'Legend says that the great beast Omen sleeps in the waters of Lake Elune''ara in Moonglade, only to appear once a year. But that''s just a legend.', 12, 1, 100, 0, 0, 0, 24332, 'Troll Commoner to Troll Commoner'), +(19169, 0, 0, 'Legend says that the great beast Omen sleeps in the waters of Lake Elune''ara in Moonglade, only to appear once a year. But that''s just a legend.', 12, 1, 100, 0, 0, 0, 24332, 'Blood Elf Commoner to Blood Elf Commoner'), +(19169, 0, 1, 'The festival of the moon was ever more important to the kaldorei. The great festival of the druids is surely in full swing.', 12, 1, 100, 274, 0, 0, 16171, 'Blood Elf Commoner to Blood Elf Commoner'), +(19175, 0, 0, 'During the Lunar Festival, we should take time to seek out our elders and consider their wisdom.', 12, 1, 100, 0, 0, 0, 24333, 'Orc Commoner to Orc Commoner'), +(19175, 0, 1, 'Have you seen the fireworks? This is the best time of year to buy them.', 12, 1, 100, 0, 0, 0, 24334, 'Orc Commoner to Orc Commoner'), +(19175, 0, 2, 'The druids of Nighthaven are holding a great celebration in Moonglade for the Lunar Festival.', 12, 1, 100, 0, 0, 0, 24335, 'Orc Commoner to Orc Commoner'), +-- Brew Fest +(19171, 5, 0, 'To Brewfest!', 12, 7, 100, 5, 0, 0, 23630, 'Draenei Commoner to Draenei Commoner'), +(19175, 5, 0, 'Where''s me gold? Where''s me beer? Where''s me feet?', 12, 1, 100, 5, 0, 0, 23352, 'Orc Commoner to Orc Commoner'), +-- Hallows end +(20102, 6, 0, 'There MUST be a way to make more money off of this holiday.', 12, 0, 100, 0, 0, 0, 23299, 'Goblin Commoner to Goblin Commoner'), +(20102, 6, 1, 'For the Alliance! Wait... the Horde! Wait... which was I again?', 12, 0, 100, 4, 0, 149, 23364, 'Goblin Commoner to Goblin Commoner'), +(20102, 6, 2, 'The innkeepers are mad to be giving away treats for free.', 12, 0, 100, 0, 0, 0, 23300, 'Goblin Commoner to Goblin Commoner'), +(20102, 6, 3, 'Happy Hallow''s End!', 12, 0, 100, 0, 0, 0, 23284, 'Goblin Commoner to Goblin Commoner'), +(19172, 6, 0, 'We should go trick or treating later.', 12, 7, 100, 0, 0, 0, 24348, 'Gnome Commoner to Gnome Commoner'), +(19172, 6, 1, 'Happy Hallow''s End!', 12, 7, 100, 0, 0, 0, 24346, 'Gnome Commoner to Gnome Commoner'), +(19172, 6, 2, 'We should go trick or treating later.', 12, 7, 100, 1, 0, 0, 24348, 'Gnome Commoner to Gnome Commoner'), +(19172, 6, 3, 'Me got the mad voodoo, mon!', 12, 7, 100, 1, 0, 0, 23361, 'Gnome Commoner to Gnome Commoner'), +(18927, 6, 0, 'I think I''ve eaten too much candy...', 12, 7, 100, 15, 0, 0, 24347, 'Human Commoner to Human Commoner'), +(18927, 6, 1, 'Brains... braaaiiins!', 12, 7, 100, 15, 0, 0, 23358, 'Human Commoner to Human Commoner'), +(18927, 6, 2, 'We should go trick or treating later.', 12, 7, 100, 0, 0, 0, 24348, 'Human Commoner to Human Commoner'), +(18927, 6, 3, 'I think I''ve eaten too much candy...', 12, 7, 100, 0, 0, 0, 24347, 'Human Commoner to Human Commoner'), +(18927, 6, 4, 'Are there any more inns we can visit for treats?', 12, 7, 100, 0, 0, 0, 23293, 'Human Commoner to Human Commoner'), +(18927, 6, 5, 'Next year, I''m dressing up as either a corsair or an assassin.', 12, 7, 100, 0, 0, 0, 24338, 'Human Commoner to Human Commoner'), +(18927, 6, 6, 'What do you think of the mask?', 12, 7, 100, 0, 0, 0, 24339, 'Human Commoner to Human Commoner'), +(18927, 6, 7, 'You know... why DO we celebrate this holiday?', 12, 7, 100, 0, 0, 0, 23287, 'Human Commoner to Human Commoner'), +(19175, 6, 0, 'Happy Hallow''s End!', 12, 1, 100, 0, 0, 0, 24329, 'Orc Commoner to Orc Commoner'), +(19175, 6, 1, 'Next year, I''m dressing up as either a corsair or an assassin.', 12, 1, 100, 0, 0, 0, 24336, 'Orc Commoner to Orc Commoner'), +(19175, 6, 2, 'The Forsaken are right to celebrate their freedom.', 12, 1, 100, 0, 0, 0, 23295, 'Orc Commoner to Orc Commoner'), +(19175, 6, 3, 'We should attend the next burning of the Wickerman.', 12, 1, 100, 0, 0, 0, 23292, 'Orc Commoner to Orc Commoner'), +(19175, 6, 4, 'What do you think of the mask?', 12, 1, 100, 0, 0, 0, 24337, 'Orc Commoner to Orc Commoner'), +(19175, 6, 5, 'We should go trick or treating later.', 12, 1, 100, 1, 0, 0, 24331, 'Orc Commoner to Orc Commoner'), +(19178, 6, 0, 'We should go trick or treating later.', 12, 1, 100, 0, 0, 0, 24331, 'Forsaken Commoner to Forsaken Commoner'), +(19178, 6, 1, 'Happy Hallow''s End!', 12, 1, 100, 0, 0, 0, 24329, 'Forsaken Commoner to Forsaken Commoner'), +(19178, 6, 2, 'I think I''ve eaten too much candy...', 12, 1, 100, 15, 0, 0, 24330, 'Forsaken Commoner to Forsaken Commoner'), +-- Winterveil +(19178, 8, 0, 'Winter Veil just isn''t the same now, but going through the motions still makes me feel something.', 12, 1, 100, 0, 0, 0, 16167, 'Forsaken Commoner to Forsaken Commoner'), +(19178, 8, 1, 'Greatfather Winter will leave presents for everyone under the tree in Orgrimmar. I wonder what he''ll bring me this year.', 12, 1, 100, 6, 0, 0, 16464, 'Forsaken Commoner to Forsaken Commoner'), +(19178, 8, 2, 'Where are all those wonderful winter hats coming from?', 12, 1, 100, 0, 0, 0, 24325, 'Forsaken Commoner to Forsaken Commoner'), +(19178, 8, 3, 'I hope I have a chance to visit with Greatfather Winter before Winter Veil is over.', 12, 1, 100, 0, 0, 0, 24323, 'Forsaken Commoner to Forsaken Commoner'), +(19178, 8, 4, 'Winter Veil just isn''t the same now, but going through the motions still makes me feel something.', 12, 1, 100, 396, 0, 0, 16167, 'Forsaken Commoner to Forsaken Commoner'), +(19178, 8, 5, 'I hope I have a chance to visit with Greatfather Winter before Winter Veil is over.', 12, 1, 100, 273, 0, 0, 24323, 'Forsaken Commoner to Forsaken Commoner'), +(19178, 8, 6, 'Where are all those wonderful winter hats coming from?', 12, 1, 100, 273, 0, 0, 24325, 'Forsaken Commoner to Forsaken Commoner'), +(19178, 8, 7, 'Winter Veil just isn''t the same now, but going through the motions still makes me feel something.', 12, 1, 100, 6, 0, 0, 16167, 'Forsaken Commoner to Forsaken Commoner'), +(19178, 8, 8, 'The goblins of Smokywood Pastures always have such wonderful treats for sale this time of year.', 12, 1, 100, 273, 0, 0, 24324, 'Forsaken Commoner to Forsaken Commoner'), +(19178, 8, 9, 'Greatfather Winter will leave presents for everyone under the tree in Orgrimmar. I wonder what he''ll bring me this year.', 12, 1, 100, 396, 0, 0, 16464, 'Forsaken Commoner to Forsaken Commoner'), +(20102, 8, 0, 'Where are all those wonderful winter hats coming from?', 12, 0, 100, 0, 0, 0, 16503, 'Goblin Commoner to Goblin Commoner'), +(20102, 8, 1, 'Ah, the Winter Wondervolt. What will we think of next?', 12, 0, 100, 0, 0, 0, 16501, 'Goblin Commoner to Goblin Commoner'), +(20102, 8, 2, 'The goblins of Smokywood Pastures always have such wonderful treats for sale this time of year.', 12, 0, 100, 0, 0, 0, 0, 'Goblin Commoner to Goblin Commoner'), +(20102, 8, 3, 'Ah, the Winter Wondervolt. What will we think of next?', 12, 0, 100, 274, 0, 0, 16501, 'Goblin Commoner to Goblin Commoner'), +(19169, 8, 0, 'Winter Veil has always been a human thing. To see the goblins and orcs take it up is rather strange.', 12, 1, 100, 0, 0, 0, 16173, 'Blood Elf Commoner to Blood Elf Commoner'), +(19169, 8, 1, 'Greatfather Winter will leave presents for everyone under the tree in Orgrimmar. I wonder what he''ll bring me this year.', 12, 1, 100, 0, 0, 0, 16464, 'Blood Elf Commoner to Blood Elf Commoner'), +(19169, 8, 2, 'Greatfather Winter will leave presents for everyone under the tree in Orgrimmar. I wonder what he''ll bring me this year.', 12, 1, 100, 6, 0, 0, 16464, 'Blood Elf Commoner to Blood Elf Commoner'), +(19169, 8, 3, 'I hope I have a chance to visit with Greatfather Winter before Winter Veil is over.', 12, 1, 100, 0, 0, 0, 24323, 'Blood Elf Commoner to Blood Elf Commoner'), +-- Midsummer +(19169, 4, 0, 'The Horde fires will never be extinguished!', 12, 1, 100, 4, 0, 0, 24534, 'Blood Elf Commoner to Blood Elf Commoner'); From b70b4c585c8973284b72b36c473b4087ba2567c4 Mon Sep 17 00:00:00 2001 From: Dr-J Date: Tue, 30 Dec 2014 23:21:11 +0000 Subject: [PATCH 16/18] DB/Misc: Fleeing Soldiers Set the remaining Fleeing Horde and Alliance soldiers at Wrathgate to ingame phasemask 2 (the ones I added already are) but was reported on original commit https://github.com/TrinityCore/TrinityCore/commit/bf0a546880ac3e0c75f3738a25734aad4e840e87 that these are visible without doing any quest, but the ones which where visible where the ones which where already spawned. Ps have had to set phase in db here due to missing effects from server side spells. --- sql/updates/world/2014_12_30_01_world.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 sql/updates/world/2014_12_30_01_world.sql diff --git a/sql/updates/world/2014_12_30_01_world.sql b/sql/updates/world/2014_12_30_01_world.sql new file mode 100644 index 00000000000..51c93e32be9 --- /dev/null +++ b/sql/updates/world/2014_12_30_01_world.sql @@ -0,0 +1 @@ +UPDATE `creature` SET `phaseMask`=2 WHERE `id` In(31310,31313,31328,31330); From 6ad8f4b3403f86bfe93eebe2487a98a48768eba6 Mon Sep 17 00:00:00 2001 From: Dr-J Date: Wed, 31 Dec 2014 11:42:03 +0000 Subject: [PATCH 17/18] DB/Misc: Winterveil * All winter veil texts for Human, Gnome, Dwarf, Dreanei, Night Elf, Troll, Orc, Tauren (Forsaken, Blood Elf and Goblin done in previous commit) * Gossip text for winterveil for all of these * Texts for Great-Father winters helpers once winterveil gifts event as started --- sql/updates/world/2014_12_31_00_world.sql | 109 ++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 sql/updates/world/2014_12_31_00_world.sql diff --git a/sql/updates/world/2014_12_31_00_world.sql b/sql/updates/world/2014_12_31_00_world.sql new file mode 100644 index 00000000000..62d9c4e8f94 --- /dev/null +++ b/sql/updates/world/2014_12_31_00_world.sql @@ -0,0 +1,109 @@ +DELETE FROM `creature_text` WHERE `entry` IN(18927,19171,19175,19177,19173,19172,19176,19148) AND `groupid`=8; +DELETE FROM `creature_text` WHERE `entry` =15746; +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextID`, `comment`) VALUES +(18927, 8, 0, 'The goblins of Smokywood Pastures always have such wonderful treats for sale this time of year.', 12, 7, 100, 6, 0, 0, 24341, 'Human Commoner to Human Commoner'), +(18927, 8, 1, 'The goblins of Smokywood Pastures always have such wonderful treats for sale this time of year.', 12, 7, 100, 0, 0, 0, 24341, 'Human Commoner to Human Commoner'), +(18927, 8, 2, 'I should take the tram to Ironforge and visit Greatfather Winter.', 12, 7, 100, 6, 0, 0, 16032, 'Human Commoner to Human Commoner'), +(18927, 8, 3, 'Greatfather Winter will leave presents for everyone under the tree in Ironforge. I can''t wait to get mine!', 12, 7, 100, 0, 0, 0, 16422, 'Human Commoner to Human Commoner'), +(18927, 8, 4, 'Greatfather Winter will leave presents for everyone under the tree in Ironforge. I can''t wait to get mine!', 12, 7, 100, 396, 0, 0, 16422, 'Human Commoner to Human Commoner'), +(18927, 8, 5, 'I should take the tram to Ironforge and visit Greatfather Winter.', 12, 7, 100, 0, 0, 0, 16032, 'Human Commoner to Human Commoner'), +(18927, 8, 6, 'Where are all those wonderful winter hats coming from?', 12, 7, 100, 0, 0, 0, 24342, 'Human Commoner to Human Commoner'), +(18927, 8, 7, 'I should take the tram to Ironforge and visit Greatfather Winter.', 12, 7, 100, 396, 0, 0, 16032, 'Human Commoner to Human Commoner'), +(19171, 8, 0, 'The goblins of Smokywood Pastures always have such wonderful treats for sale this time of year.', 12, 7, 100, 0, 0, 0, 24341, 'Draenei Commoner to Draenei Commoner'), +(19171, 8, 1, 'Where are all those wonderful winter hats coming from?', 12, 7, 100, 0, 0, 0, 24342, 'Draenei Commoner to Draenei Commoner'), +(19171, 8, 2, 'Greatfather Winter will leave presents for everyone under the tree in Ironforge. I can''t wait to get mine!', 12, 7, 100, 0, 0, 0, 16422, 'Draenei Commoner to Draenei Commoner'), +(19171, 8, 3, 'It is my understanding that the people of the Alliance celebrate this Winter Veil in Ironforge.', 12, 7, 100, 0, 0, 0, 16161, 'Draenei Commoner to Draenei Commoner'), +(19175, 8, 0, 'Though we do not truly understand the traditions of Winter Veil, we have taken to them.', 12, 1, 100, 0, 0, 0, 16164, 'Orc Commoner to Orc Commoner'), +(19175, 8, 1, 'I hope I have a chance to visit with Greatfather Winter before Winter Veil is over.', 12, 1, 100, 0, 0, 0, 24323, 'Orc Commoner to Orc Commoner'), +(19175, 8, 2, 'I hope I have a chance to visit with Greatfather Winter before Winter Veil is over.', 12, 1, 100, 6, 0, 0, 24323, 'Orc Commoner to Orc Commoner'), +(19177, 8, 0, 'I hope I have a chance to visit with Greatfather Winter before Winter Veil is over.', 12, 1, 100, 0, 0, 0, 24323, 'Troll Commoner to Troll Commoner'), +(19177, 8, 1, 'Greatfather Winter will leave presents for everyone under the tree in Orgrimmar. I wonder what he''ll bring me this year.', 12, 1, 100, 0, 0, 0, 16464, 'Troll Commoner to Troll Commoner'), +(19177, 8, 2, 'The goblins of Smokywood Pastures always have such wonderful treats for sale this time of year.', 12, 1, 100, 0, 0, 0, 24324, 'Troll Commoner to Troll Commoner'), +(15746, 8, 0, 'Presents for everyone! Father Winter''s put gifts under the tree for all.', 14, 0, 100, 0, 0, 0, 11430, 'Great-father Winter''s Helper'), +(19173, 8, 0, 'It feels like everyone wants to kiss me under the mistletoe.', 12, 7, 100, 0, 0, 0, 16158, 'Night Elf Commoner to Night Elf Commoner'), +(19173, 8, 1, 'It feels like everyone wants to kiss me under the mistletoe.', 12, 7, 100, 396, 0, 0, 16158, 'Night Elf Commoner to Night Elf Commoner'), +(19173, 8, 2, 'Where are all those wonderful winter hats coming from?', 12, 7, 100, 0, 0, 0, 24342, 'Night Elf Commoner to Night Elf Commoner'), +(19173, 8, 3, 'Greatfather Winter will leave presents for everyone under the tree in Ironforge. I can''t wait to get mine!', 12, 7, 100, 6, 0, 0, 16422, 'Night Elf Commoner to Night Elf Commoner'), +(19173, 8, 4, 'I hope I have a chance to visit with Greatfather Winter before Winter Veil is over.', 12, 7, 100, 0, 0, 0, 0, 'Night Elf Commoner to Night Elf Commoner'), +(19172, 8, 0, 'Greatfather Winter will leave presents for everyone under the tree in Ironforge. I can''t wait to get mine!', 12, 7, 100, 0, 0, 0, 16422, 'Gnome Commoner to Gnome Commoner'), +(19172, 8, 1, 'I hope I have a chance to visit with Greatfather Winter before Winter Veil is over.', 12, 7, 100, 0, 0, 0, 24340, 'Gnome Commoner to Gnome Commoner'), +(19172, 8, 2, 'How embarrassing! Someone mistook me for one of Greatfather Winter''s helpers.', 12, 7, 100, 0, 0, 0, 016204, 'Gnome Commoner to Gnome Commoner'), +(19172, 8, 3, 'I hope I have a chance to visit with Greatfather Winter before Winter Veil is over.', 12, 7, 100, 273, 0, 0, 24340, 'Gnome Commoner to Gnome Commoner'), +(19172, 8, 4, 'Where are all those wonderful winter hats coming from?', 12, 7, 100, 0, 0, 0, 24342, 'Gnome Commoner to Gnome Commoner'), +(19176, 8, 0, 'I hope I have a chance to visit with Greatfather Winter before Winter Veil is over.', 12, 1, 100, 0, 0, 0, 24323, 'Tauren Commoner to Tauren Commoner'), +(19176, 8, 1, 'Greatfather Winter will leave presents for everyone under the tree in Orgrimmar. I wonder what he''ll bring me this year.', 12, 1, 100, 0, 0, 0, 16464, 'Tauren Commoner to Tauren Commoner'), +(19176, 8, 2, 'The goblins of Smokywood Pastures always have such wonderful treats for sale this time of year.', 12, 1, 100, 0, 0, 0, 24324, 'Tauren Commoner to Tauren Commoner'), +(19176, 8, 3, 'Greatfather Winter is only a wyvern''s ride away to Orgrimmar.', 12, 1, 100, 0, 0, 0, 16170, 'Tauren Commoner to Tauren Commoner'), +(19148, 8, 0, 'The goblins of Smokywood Pastures always have such wonderful treats for sale this time of year.', 12, 7, 100, 0, 0, 0, 24341, 'Dwarf Commoner to Dwarf Commoner'), +(19148, 8, 1, 'Where are all those wonderful winter hats coming from?', 12, 7, 100, 274, 0, 0, 24342, 'Dwarf Commoner to Dwarf Commoner'), +(19148, 8, 2, 'I hope I have a chance to visit with Greatfather Winter before Winter Veil is over.', 12, 7, 100, 0, 0, 0, 24340, 'Dwarf Commoner to Dwarf Commoner'), +(19148, 8, 3, 'The goblins of Smokywood Pastures always have such wonderful treats for sale this time of year.', 12, 7, 100, 0, 0, 0, 24341, 'Dwarf Commoner to Dwarf Commoner'); + + +UPDATE `creature_template` SET `ainame`='SmartAI', `scriptname`='' WHERE `entry`IN(19148,15746,19173); +DELETE FROM `smart_scripts` WHERE `entryorguid`=15746 AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid`IN(18927,19171,19175,19177,19173,19172,19176,19148) AND `source_type`=0 AND `id`=8; +DELETE FROM `smart_scripts` WHERE `entryorguid`IN(18927,19171,19175,19177,19173,19172,19176,19148,19148,19173) AND `source_type`=0 AND `id`=9; + +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 + +(18927,0,8,0,1,0,100,0,3000,15000,45000,90000,1,8,0,0,0,0,0,1,0,0,0,0,0,0,0,'Human Commoner - OOC - Say'), +(19171,0,8,0,1,0,100,0,3000,15000,45000,90000,1,8,0,0,0,0,0,1,0,0,0,0,0,0,0,'Dreani Commoner - OOC - Say'), +(19175,0,8,0,1,0,100,0,3000,15000,45000,90000,1,8,0,0,0,0,0,1,0,0,0,0,0,0,0,'Orc Commoner - OOC - Say'), +(19177,0,8,0,1,0,100,0,3000,15000,45000,90000,1,8,0,0,0,0,0,1,0,0,0,0,0,0,0,'Troll Commoner - OOC - Say'), +(19173,0,8,0,1,0,100,0,3000,15000,45000,90000,1,8,0,0,0,0,0,1,0,0,0,0,0,0,0,'Night Elf Commoner - OOC - Say'), +(19172,0,8,0,1,0,100,0,3000,15000,45000,90000,1,8,0,0,0,0,0,1,0,0,0,0,0,0,0,'Gnome Commoner - OOC - Say'), +(19176,0,8,0,1,0,100,0,3000,15000,45000,90000,1,8,0,0,0,0,0,1,0,0,0,0,0,0,0,'Tauren Commoner - OOC - Say'), +(19148,0,8,0,1,0,100,0,3000,15000,45000,90000,1,8,0,0,0,0,0,1,0,0,0,0,0,0,0,'Dwarf Commoner - OOC - Say'), +(15746,0,0,0,1,0,100,0,3000,15000,600000,600000,1,8,0,0,0,0,0,1,0,0,0,0,0,0,0,'Great-father Winter''s Helper - OOC - Say'), + +(18927,0,9,0,64,0,100,0,0,0,0,0,98,7862, 9626,0,0,0,0,7,0,0,0,0,0,0,0,'Human Commoner - On Gossip Hello - Send Gossip Menu'), +(19148,0,9,0,64,0,100,0,0,0,0,0,98,7907, 9686,0,0,0,0,7,0,0,0,0,0,0,0,'Dwarf Commoner - On Gossip Hello - Send Gossip Menu'), +(19169,0,9,0,64,0,100,0,0,0,0,0,98,7911, 9698,0,0,0,0,7,0,0,0,0,0,0,0,'Blood Elf Commoner - On Gossip Hello - Send Gossip Menu'), +(19171,0,9,0,64,0,100,0,0,0,0,0,98,7910, 9694,0,0,0,0,7,0,0,0,0,0,0,0,'Draeni Commoner - On Gossip Hello - Send Gossip Menu'), +(19172,0,9,0,64,0,100,0,0,0,0,0,98,7929, 9717,0,0,0,0,7,0,0,0,0,0,0,0,'Gnome Commoner - On Gossip Hello - Send Gossip Menu'), +(19173,0,9,0,64,0,100,0,0,0,0,0,98,7909, 9690,0,0,0,0,7,0,0,0,0,0,0,0,'Night Elf Commoner - On Gossip Hello - Send Gossip Menu'), +(19175,0,9,0,64,0,100,0,0,0,0,0,98,7912, 9702,0,0,0,0,7,0,0,0,0,0,0,0,'Orc Commoner - On Gossip Hello - Send Gossip Menu'), +(19176,0,9,0,64,0,100,0,0,0,0,0,98,7913, 9706,0,0,0,0,7,0,0,0,0,0,0,0,'Tauren Commoner - On Gossip Hello - Send Gossip Menu'), +(19177,0,9,0,64,0,100,0,0,0,0,0,98,7933, 9718,0,0,0,0,7,0,0,0,0,0,0,0,'Troll Commoner - On Gossip Hello - Send Gossip Menu'), +(19178,0,9,0,64,0,100,0,0,0,0,0,98,7914, 9710,0,0,0,0,7,0,0,0,0,0,0,0,'Forsaken Commoner - On Gossip Hello - Send Gossip Menu'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry` in(18927,19171,19175,19177,19173,19172,19176,19148) AND `SourceGroup`=9; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry` in(18927,19171,19175,19177,19173,19172,19176,19148,19148,19173) AND `SourceGroup`=10; + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry` =15746; + +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(22, 9, 18927, 0, 0, 12, 1, 2, 0, 0, 0, 0, 0, '', 'Commoner - Winterveil must be active'), +(22, 9, 19171, 0, 0, 12, 1, 2, 0, 0, 0, 0, 0, '', 'Commoner - Winterveil must be active'), +(22, 9, 19175, 0, 0, 12, 1, 2, 0, 0, 0, 0, 0, '', 'Commoner - Winterveil must be active'), +(22, 9, 19177, 0, 0, 12, 1, 2, 0, 0, 0, 0, 0, '', 'Commoner - Winterveil must be active'), +(22, 9, 19173, 0, 0, 12, 1, 2, 0, 0, 0, 0, 0, '', 'Commoner - Winterveil must be active'), +(22, 9, 19172, 0, 0, 12, 1, 2, 0, 0, 0, 0, 0, '', 'Commoner - Winterveil must be active'), +(22, 9, 19176, 0, 0, 12, 1, 2, 0, 0, 0, 0, 0, '', 'Commoner - Winterveil must be active'), +(22, 9, 19148, 0, 0, 12, 1, 2, 0, 0, 0, 0, 0, '', 'Commoner - Winterveil must be active'), +(22, 1, 15746, 0, 0, 12, 1, 52, 0, 0, 0, 0, 0, '', 'Great-father Winter''s Helper - Winter Veil: Gifts must be active'), +(22, 10, 18927, 0, 0, 12, 1, 2, 0, 0, 0, 0, 0, '', 'Commoner - Winterveil must be active'), +(22, 10, 19148, 0, 0, 12, 1, 2, 0, 0, 0, 0, 0, '', 'Commoner - Winterveil must be active'), +(22, 10, 19169, 0, 0, 12, 1, 2, 0, 0, 0, 0, 0, '', 'Commoner - Winterveil must be active'), +(22, 10, 19171, 0, 0, 12, 1, 2, 0, 0, 0, 0, 0, '', 'Commoner - Winterveil must be active'), +(22, 10, 19172, 0, 0, 12, 1, 2, 0, 0, 0, 0, 0, '', 'Commoner - Winterveil must be active'), +(22, 10, 19173, 0, 0, 12, 1, 2, 0, 0, 0, 0, 0, '', 'Commoner - Winterveil must be active'), +(22, 10, 19175, 0, 0, 12, 1, 2, 0, 0, 0, 0, 0, '', 'Commoner - Winterveil must be active'), +(22, 10, 19176, 0, 0, 12, 1, 2, 0, 0, 0, 0, 0, '', 'Commoner - Winterveil must be active'), +(22, 10, 19177, 0, 0, 12, 1, 2, 0, 0, 0, 0, 0, '', 'Commoner - Winterveil must be active'), +(22, 10, 19178, 0, 0, 12, 1, 2, 0, 0, 0, 0, 0, '', 'Commoner - Winterveil must be active'); + +DELETE FROM `gossip_menu` WHERE `entry` IN(7929,7913,7912,7909,7862,7907,7911,7914,7933,7910); +INSERT INTO `gossip_menu` (`entry`, `text_id`) VALUES +(7929, 9717), -- 19172 +(7913, 9706), -- 19176 +(7912, 9702), -- 19175 +(7909, 9690), -- 19173 +(7862, 9626), -- 18927 +(7907, 9686), -- 19148 +(7911, 9698), -- 19169 +(7914, 9710), -- 19178 +(7933, 9718), -- 19177 +(7910, 9694); -- 19171 + From 6390e6a4cc2d657e7fa49e80c5be32007df56ee1 Mon Sep 17 00:00:00 2001 From: jackpoz Date: Wed, 31 Dec 2014 21:14:53 +0100 Subject: [PATCH 18/18] Core/Dep: Remove unneeded recast files --- .../Detour/DetourObstacleAvoidance.cpp | 544 ------------------ .../Detour/DetourObstacleAvoidance.h | 154 ----- 2 files changed, 698 deletions(-) delete mode 100644 dep/recastnavigation/Detour/DetourObstacleAvoidance.cpp delete mode 100644 dep/recastnavigation/Detour/DetourObstacleAvoidance.h diff --git a/dep/recastnavigation/Detour/DetourObstacleAvoidance.cpp b/dep/recastnavigation/Detour/DetourObstacleAvoidance.cpp deleted file mode 100644 index d3f90b7ab17..00000000000 --- a/dep/recastnavigation/Detour/DetourObstacleAvoidance.cpp +++ /dev/null @@ -1,544 +0,0 @@ -// -// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. -// - -#include "DetourObstacleAvoidance.h" -#include "DetourCommon.h" -#include "DetourAlloc.h" -#include "DetourAssert.h" -#include -#include -#include -#include - -static const float DT_PI = 3.14159265f; - -static int sweepCircleCircle(const float* c0, const float r0, const float* v, - const float* c1, const float r1, - float& tmin, float& tmax) -{ - static const float EPS = 0.0001f; - float s[3]; - dtVsub(s,c1,c0); - float r = r0+r1; - float c = dtVdot2D(s,s) - r*r; - float a = dtVdot2D(v,v); - if (a < EPS) return 0; // not moving - - // Overlap, calc time to exit. - float b = dtVdot2D(v,s); - float d = b*b - a*c; - if (d < 0.0f) return 0; // no intersection. - a = 1.0f / a; - const float rd = dtSqrt(d); - tmin = (b - rd) * a; - tmax = (b + rd) * a; - return 1; -} - -static int isectRaySeg(const float* ap, const float* u, - const float* bp, const float* bq, - float& t) -{ - float v[3], w[3]; - dtVsub(v,bq,bp); - dtVsub(w,ap,bp); - float d = dtVperp2D(u,v); - if (fabsf(d) < 1e-6f) return 0; - d = 1.0f/d; - t = dtVperp2D(v,w) * d; - if (t < 0 || t > 1) return 0; - float s = dtVperp2D(u,w) * d; - if (s < 0 || s > 1) return 0; - return 1; -} - - - -dtObstacleAvoidanceDebugData* dtAllocObstacleAvoidanceDebugData() -{ - void* mem = dtAlloc(sizeof(dtObstacleAvoidanceDebugData), DT_ALLOC_PERM); - if (!mem) return 0; - return new(mem) dtObstacleAvoidanceDebugData; -} - -void dtFreeObstacleAvoidanceDebugData(dtObstacleAvoidanceDebugData* ptr) -{ - if (!ptr) return; - ptr->~dtObstacleAvoidanceDebugData(); - dtFree(ptr); -} - - -dtObstacleAvoidanceDebugData::dtObstacleAvoidanceDebugData() : - m_nsamples(0), - m_maxSamples(0), - m_vel(0), - m_ssize(0), - m_pen(0), - m_vpen(0), - m_vcpen(0), - m_spen(0), - m_tpen(0) -{ -} - -dtObstacleAvoidanceDebugData::~dtObstacleAvoidanceDebugData() -{ - dtFree(m_vel); - dtFree(m_ssize); - dtFree(m_pen); - dtFree(m_vpen); - dtFree(m_vcpen); - dtFree(m_spen); - dtFree(m_tpen); -} - -bool dtObstacleAvoidanceDebugData::init(const int maxSamples) -{ - dtAssert(maxSamples); - m_maxSamples = maxSamples; - - m_vel = (float*)dtAlloc(sizeof(float)*3*m_maxSamples, DT_ALLOC_PERM); - if (!m_vel) - return false; - m_pen = (float*)dtAlloc(sizeof(float)*m_maxSamples, DT_ALLOC_PERM); - if (!m_pen) - return false; - m_ssize = (float*)dtAlloc(sizeof(float)*m_maxSamples, DT_ALLOC_PERM); - if (!m_ssize) - return false; - m_vpen = (float*)dtAlloc(sizeof(float)*m_maxSamples, DT_ALLOC_PERM); - if (!m_vpen) - return false; - m_vcpen = (float*)dtAlloc(sizeof(float)*m_maxSamples, DT_ALLOC_PERM); - if (!m_vcpen) - return false; - m_spen = (float*)dtAlloc(sizeof(float)*m_maxSamples, DT_ALLOC_PERM); - if (!m_spen) - return false; - m_tpen = (float*)dtAlloc(sizeof(float)*m_maxSamples, DT_ALLOC_PERM); - if (!m_tpen) - return false; - - return true; -} - -void dtObstacleAvoidanceDebugData::reset() -{ - m_nsamples = 0; -} - -void dtObstacleAvoidanceDebugData::addSample(const float* vel, const float ssize, const float pen, - const float vpen, const float vcpen, const float spen, const float tpen) -{ - if (m_nsamples >= m_maxSamples) - return; - dtAssert(m_vel); - dtAssert(m_ssize); - dtAssert(m_pen); - dtAssert(m_vpen); - dtAssert(m_vcpen); - dtAssert(m_spen); - dtAssert(m_tpen); - dtVcopy(&m_vel[m_nsamples*3], vel); - m_ssize[m_nsamples] = ssize; - m_pen[m_nsamples] = pen; - m_vpen[m_nsamples] = vpen; - m_vcpen[m_nsamples] = vcpen; - m_spen[m_nsamples] = spen; - m_tpen[m_nsamples] = tpen; - m_nsamples++; -} - -static void normalizeArray(float* arr, const int n) -{ - // Normalize penaly range. - float minPen = FLT_MAX; - float maxPen = -FLT_MAX; - for (int i = 0; i < n; ++i) - { - minPen = dtMin(minPen, arr[i]); - maxPen = dtMax(maxPen, arr[i]); - } - const float penRange = maxPen-minPen; - const float s = penRange > 0.001f ? (1.0f / penRange) : 1; - for (int i = 0; i < n; ++i) - arr[i] = dtClamp((arr[i]-minPen)*s, 0.0f, 1.0f); -} - -void dtObstacleAvoidanceDebugData::normalizeSamples() -{ - normalizeArray(m_pen, m_nsamples); - normalizeArray(m_vpen, m_nsamples); - normalizeArray(m_vcpen, m_nsamples); - normalizeArray(m_spen, m_nsamples); - normalizeArray(m_tpen, m_nsamples); -} - - -dtObstacleAvoidanceQuery* dtAllocObstacleAvoidanceQuery() -{ - void* mem = dtAlloc(sizeof(dtObstacleAvoidanceQuery), DT_ALLOC_PERM); - if (!mem) return 0; - return new(mem) dtObstacleAvoidanceQuery; -} - -void dtFreeObstacleAvoidanceQuery(dtObstacleAvoidanceQuery* ptr) -{ - if (!ptr) return; - ptr->~dtObstacleAvoidanceQuery(); - dtFree(ptr); -} - - -dtObstacleAvoidanceQuery::dtObstacleAvoidanceQuery() : - m_maxCircles(0), - m_circles(0), - m_ncircles(0), - m_maxSegments(0), - m_segments(0), - m_nsegments(0) -{ -} - -dtObstacleAvoidanceQuery::~dtObstacleAvoidanceQuery() -{ - dtFree(m_circles); - dtFree(m_segments); -} - -bool dtObstacleAvoidanceQuery::init(const int maxCircles, const int maxSegments) -{ - m_maxCircles = maxCircles; - m_ncircles = 0; - m_circles = (dtObstacleCircle*)dtAlloc(sizeof(dtObstacleCircle)*m_maxCircles, DT_ALLOC_PERM); - if (!m_circles) - return false; - memset(m_circles, 0, sizeof(dtObstacleCircle)*m_maxCircles); - - m_maxSegments = maxSegments; - m_nsegments = 0; - m_segments = (dtObstacleSegment*)dtAlloc(sizeof(dtObstacleSegment)*m_maxSegments, DT_ALLOC_PERM); - if (!m_segments) - return false; - memset(m_segments, 0, sizeof(dtObstacleSegment)*m_maxSegments); - - return true; -} - -void dtObstacleAvoidanceQuery::reset() -{ - m_ncircles = 0; - m_nsegments = 0; -} - -void dtObstacleAvoidanceQuery::addCircle(const float* pos, const float rad, - const float* vel, const float* dvel) -{ - if (m_ncircles >= m_maxCircles) - return; - - dtObstacleCircle* cir = &m_circles[m_ncircles++]; - dtVcopy(cir->p, pos); - cir->rad = rad; - dtVcopy(cir->vel, vel); - dtVcopy(cir->dvel, dvel); -} - -void dtObstacleAvoidanceQuery::addSegment(const float* p, const float* q) -{ - if (m_nsegments > m_maxSegments) - return; - - dtObstacleSegment* seg = &m_segments[m_nsegments++]; - dtVcopy(seg->p, p); - dtVcopy(seg->q, q); -} - -void dtObstacleAvoidanceQuery::prepare(const float* pos, const float* dvel) -{ - // Prepare obstacles - for (int i = 0; i < m_ncircles; ++i) - { - dtObstacleCircle* cir = &m_circles[i]; - - // Side - const float* pa = pos; - const float* pb = cir->p; - - const float orig[3] = {0,0}; - float dv[3]; - dtVsub(cir->dp,pb,pa); - dtVnormalize(cir->dp); - dtVsub(dv, cir->dvel, dvel); - - const float a = dtTriArea2D(orig, cir->dp,dv); - if (a < 0.01f) - { - cir->np[0] = -cir->dp[2]; - cir->np[2] = cir->dp[0]; - } - else - { - cir->np[0] = cir->dp[2]; - cir->np[2] = -cir->dp[0]; - } - } - - for (int i = 0; i < m_nsegments; ++i) - { - dtObstacleSegment* seg = &m_segments[i]; - - // Precalc if the agent is really close to the segment. - const float r = 0.01f; - float t; - seg->touch = dtDistancePtSegSqr2D(pos, seg->p, seg->q, t) < dtSqr(r); - } -} - -float dtObstacleAvoidanceQuery::processSample(const float* vcand, const float cs, - const float* pos, const float rad, - const float* vel, const float* dvel, - dtObstacleAvoidanceDebugData* debug) -{ - // Find min time of impact and exit amongst all obstacles. - float tmin = m_params.horizTime; - float side = 0; - int nside = 0; - - for (int i = 0; i < m_ncircles; ++i) - { - const dtObstacleCircle* cir = &m_circles[i]; - - // RVO - float vab[3]; - dtVscale(vab, vcand, 2); - dtVsub(vab, vab, vel); - dtVsub(vab, vab, cir->vel); - - // Side - side += dtClamp(dtMin(dtVdot2D(cir->dp,vab)*0.5f+0.5f, dtVdot2D(cir->np,vab)*2), 0.0f, 1.0f); - nside++; - - float htmin = 0, htmax = 0; - if (!sweepCircleCircle(pos,rad, vab, cir->p,cir->rad, htmin, htmax)) - continue; - - // Handle overlapping obstacles. - if (htmin < 0.0f && htmax > 0.0f) - { - // Avoid more when overlapped. - htmin = -htmin * 0.5f; - } - - if (htmin >= 0.0f) - { - // The closest obstacle is somewhere ahead of us, keep track of nearest obstacle. - if (htmin < tmin) - tmin = htmin; - } - } - - for (int i = 0; i < m_nsegments; ++i) - { - const dtObstacleSegment* seg = &m_segments[i]; - float htmin = 0; - - if (seg->touch) - { - // Special case when the agent is very close to the segment. - float sdir[3], snorm[3]; - dtVsub(sdir, seg->q, seg->p); - snorm[0] = -sdir[2]; - snorm[2] = sdir[0]; - // If the velocity is pointing towards the segment, no collision. - if (dtVdot2D(snorm, vcand) < 0.0f) - continue; - // Else immediate collision. - htmin = 0.0f; - } - else - { - if (!isectRaySeg(pos, vcand, seg->p, seg->q, htmin)) - continue; - } - - // Avoid less when facing walls. - htmin *= 2.0f; - - // The closest obstacle is somewhere ahead of us, keep track of nearest obstacle. - if (htmin < tmin) - tmin = htmin; - } - - // Normalize side bias, to prevent it dominating too much. - if (nside) - side /= nside; - - const float vpen = m_params.weightDesVel * (dtVdist2D(vcand, dvel) * m_invVmax); - const float vcpen = m_params.weightCurVel * (dtVdist2D(vcand, vel) * m_invVmax); - const float spen = m_params.weightSide * side; - const float tpen = m_params.weightToi * (1.0f/(0.1f+tmin*m_invHorizTime)); - - const float penalty = vpen + vcpen + spen + tpen; - - // Store different penalties for debug viewing - if (debug) - debug->addSample(vcand, cs, penalty, vpen, vcpen, spen, tpen); - - return penalty; -} - -int dtObstacleAvoidanceQuery::sampleVelocityGrid(const float* pos, const float rad, const float vmax, - const float* vel, const float* dvel, float* nvel, - const dtObstacleAvoidanceParams* params, - dtObstacleAvoidanceDebugData* debug) -{ - prepare(pos, dvel); - - memcpy(&m_params, params, sizeof(dtObstacleAvoidanceParams)); - m_invHorizTime = 1.0f / m_params.horizTime; - m_vmax = vmax; - m_invVmax = 1.0f / vmax; - - dtVset(nvel, 0,0,0); - - if (debug) - debug->reset(); - - const float cvx = dvel[0] * m_params.velBias; - const float cvz = dvel[2] * m_params.velBias; - const float cs = vmax * 2 * (1 - m_params.velBias) / (float)(m_params.gridSize-1); - const float half = (m_params.gridSize-1)*cs*0.5f; - - float minPenalty = FLT_MAX; - int ns = 0; - - for (int y = 0; y < m_params.gridSize; ++y) - { - for (int x = 0; x < m_params.gridSize; ++x) - { - float vcand[3]; - vcand[0] = cvx + x*cs - half; - vcand[1] = 0; - vcand[2] = cvz + y*cs - half; - - if (dtSqr(vcand[0])+dtSqr(vcand[2]) > dtSqr(vmax+cs/2)) continue; - - const float penalty = processSample(vcand, cs, pos,rad,vel,dvel, debug); - ns++; - if (penalty < minPenalty) - { - minPenalty = penalty; - dtVcopy(nvel, vcand); - } - } - } - - return ns; -} - - -int dtObstacleAvoidanceQuery::sampleVelocityAdaptive(const float* pos, const float rad, const float vmax, - const float* vel, const float* dvel, float* nvel, - const dtObstacleAvoidanceParams* params, - dtObstacleAvoidanceDebugData* debug) -{ - prepare(pos, dvel); - - memcpy(&m_params, params, sizeof(dtObstacleAvoidanceParams)); - m_invHorizTime = 1.0f / m_params.horizTime; - m_vmax = vmax; - m_invVmax = 1.0f / vmax; - - dtVset(nvel, 0,0,0); - - if (debug) - debug->reset(); - - // Build sampling pattern aligned to desired velocity. - float pat[(DT_MAX_PATTERN_DIVS*DT_MAX_PATTERN_RINGS+1)*2]; - int npat = 0; - - const int ndivs = (int)m_params.adaptiveDivs; - const int nrings= (int)m_params.adaptiveRings; - const int depth = (int)m_params.adaptiveDepth; - - const int nd = dtClamp(ndivs, 1, DT_MAX_PATTERN_DIVS); - const int nr = dtClamp(nrings, 1, DT_MAX_PATTERN_RINGS); - const float da = (1.0f/nd) * DT_PI*2; - const float dang = atan2f(dvel[2], dvel[0]); - - // Always add sample at zero - pat[npat*2+0] = 0; - pat[npat*2+1] = 0; - npat++; - - for (int j = 0; j < nr; ++j) - { - const float r = (float)(nr-j)/(float)nr; - float a = dang + (j&1)*0.5f*da; - for (int i = 0; i < nd; ++i) - { - pat[npat*2+0] = cosf(a)*r; - pat[npat*2+1] = sinf(a)*r; - npat++; - a += da; - } - } - - // Start sampling. - float cr = vmax * (1.0f - m_params.velBias); - float res[3]; - dtVset(res, dvel[0] * m_params.velBias, 0, dvel[2] * m_params.velBias); - int ns = 0; - - for (int k = 0; k < depth; ++k) - { - float minPenalty = FLT_MAX; - float bvel[3]; - dtVset(bvel, 0,0,0); - - for (int i = 0; i < npat; ++i) - { - float vcand[3]; - vcand[0] = res[0] + pat[i*2+0]*cr; - vcand[1] = 0; - vcand[2] = res[2] + pat[i*2+1]*cr; - - if (dtSqr(vcand[0])+dtSqr(vcand[2]) > dtSqr(vmax+0.001f)) continue; - - const float penalty = processSample(vcand,cr/10, pos,rad,vel,dvel, debug); - ns++; - if (penalty < minPenalty) - { - minPenalty = penalty; - dtVcopy(bvel, vcand); - } - } - - dtVcopy(res, bvel); - - cr *= 0.5f; - } - - dtVcopy(nvel, res); - - return ns; -} - diff --git a/dep/recastnavigation/Detour/DetourObstacleAvoidance.h b/dep/recastnavigation/Detour/DetourObstacleAvoidance.h deleted file mode 100644 index 8ff6211e867..00000000000 --- a/dep/recastnavigation/Detour/DetourObstacleAvoidance.h +++ /dev/null @@ -1,154 +0,0 @@ -// -// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. -// - -#ifndef DETOUROBSTACLEAVOIDANCE_H -#define DETOUROBSTACLEAVOIDANCE_H - -struct dtObstacleCircle -{ - float p[3]; ///< Position of the obstacle - float vel[3]; ///< Velocity of the obstacle - float dvel[3]; ///< Velocity of the obstacle - float rad; ///< Radius of the obstacle - float dp[3], np[3]; ///< Use for side selection during sampling. -}; - -struct dtObstacleSegment -{ - float p[3], q[3]; ///< End points of the obstacle segment - bool touch; -}; - - -class dtObstacleAvoidanceDebugData -{ -public: - dtObstacleAvoidanceDebugData(); - ~dtObstacleAvoidanceDebugData(); - - bool init(const int maxSamples); - void reset(); - void addSample(const float* vel, const float ssize, const float pen, - const float vpen, const float vcpen, const float spen, const float tpen); - - void normalizeSamples(); - - inline int getSampleCount() const { return m_nsamples; } - inline const float* getSampleVelocity(const int i) const { return &m_vel[i*3]; } - inline float getSampleSize(const int i) const { return m_ssize[i]; } - inline float getSamplePenalty(const int i) const { return m_pen[i]; } - inline float getSampleDesiredVelocityPenalty(const int i) const { return m_vpen[i]; } - inline float getSampleCurrentVelocityPenalty(const int i) const { return m_vcpen[i]; } - inline float getSamplePreferredSidePenalty(const int i) const { return m_spen[i]; } - inline float getSampleCollisionTimePenalty(const int i) const { return m_tpen[i]; } - -private: - int m_nsamples; - int m_maxSamples; - float* m_vel; - float* m_ssize; - float* m_pen; - float* m_vpen; - float* m_vcpen; - float* m_spen; - float* m_tpen; -}; - -dtObstacleAvoidanceDebugData* dtAllocObstacleAvoidanceDebugData(); -void dtFreeObstacleAvoidanceDebugData(dtObstacleAvoidanceDebugData* ptr); - - -static const int DT_MAX_PATTERN_DIVS = 32; ///< Max numver of adaptive divs. -static const int DT_MAX_PATTERN_RINGS = 4; ///< Max number of adaptive rings. - -struct dtObstacleAvoidanceParams -{ - float velBias; - float weightDesVel; - float weightCurVel; - float weightSide; - float weightToi; - float horizTime; - unsigned char gridSize; ///< grid - unsigned char adaptiveDivs; ///< adaptive - unsigned char adaptiveRings; ///< adaptive - unsigned char adaptiveDepth; ///< adaptive -}; - -class dtObstacleAvoidanceQuery -{ -public: - dtObstacleAvoidanceQuery(); - ~dtObstacleAvoidanceQuery(); - - bool init(const int maxCircles, const int maxSegments); - - void reset(); - - void addCircle(const float* pos, const float rad, - const float* vel, const float* dvel); - - void addSegment(const float* p, const float* q); - - int sampleVelocityGrid(const float* pos, const float rad, const float vmax, - const float* vel, const float* dvel, float* nvel, - const dtObstacleAvoidanceParams* params, - dtObstacleAvoidanceDebugData* debug = 0); - - int sampleVelocityAdaptive(const float* pos, const float rad, const float vmax, - const float* vel, const float* dvel, float* nvel, - const dtObstacleAvoidanceParams* params, - dtObstacleAvoidanceDebugData* debug = 0); - - inline int getObstacleCircleCount() const { return m_ncircles; } - const dtObstacleCircle* getObstacleCircle(const int i) { return &m_circles[i]; } - - inline int getObstacleSegmentCount() const { return m_nsegments; } - const dtObstacleSegment* getObstacleSegment(const int i) { return &m_segments[i]; } - -private: - - void prepare(const float* pos, const float* dvel); - - float processSample(const float* vcand, const float cs, - const float* pos, const float rad, - const float* vel, const float* dvel, - dtObstacleAvoidanceDebugData* debug); - - dtObstacleCircle* insertCircle(const float dist); - dtObstacleSegment* insertSegment(const float dist); - - dtObstacleAvoidanceParams m_params; - float m_invHorizTime; - float m_vmax; - float m_invVmax; - - int m_maxCircles; - dtObstacleCircle* m_circles; - int m_ncircles; - - int m_maxSegments; - dtObstacleSegment* m_segments; - int m_nsegments; -}; - -dtObstacleAvoidanceQuery* dtAllocObstacleAvoidanceQuery(); -void dtFreeObstacleAvoidanceQuery(dtObstacleAvoidanceQuery* ptr); - - -#endif // DETOUROBSTACLEAVOIDANCE_H