From 08b760e953fb1a1cdb798d47b8e7681d8422345a Mon Sep 17 00:00:00 2001 From: Blaymoira Date: Mon, 23 Feb 2009 16:03:18 +0100 Subject: [PATCH 1/8] *Fix a typo in DoZoneInCombat function - by Elron --HG-- branch : trunk --- src/bindings/scripts/include/sc_creature.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bindings/scripts/include/sc_creature.cpp b/src/bindings/scripts/include/sc_creature.cpp index 3db6ba1651..d9c6915658 100644 --- a/src/bindings/scripts/include/sc_creature.cpp +++ b/src/bindings/scripts/include/sc_creature.cpp @@ -687,7 +687,7 @@ void ScriptedAI::DoZoneInCombat(Unit* pUnit) for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) { if (Player* i_pl = i->getSource()) - if (!i_pl->isAlive()) + if (i_pl->isAlive()) { pUnit->SetInCombatWith(i_pl); i_pl->SetInCombatWith(pUnit); From 7ca5b9a8e7e5cf8dba02dc6a4a6d027b5892fb89 Mon Sep 17 00:00:00 2001 From: megamage Date: Mon, 23 Feb 2009 09:54:48 -0600 Subject: [PATCH 2/8] *Remove possessed summons when aura is cancelled but not when channelling is canncelled. This fix Eye of Kilrogg. --HG-- branch : trunk --- src/game/Spell.cpp | 19 ------------------- src/game/Unit.cpp | 18 +++++++++++++++++- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index f74bf664c5..90a22d963e 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -2148,25 +2148,6 @@ void Spell::cancel() finish(false); - // Unsummon summon as possessed creatures on spell cancel - if(m_caster->GetTypeId() == TYPEID_PLAYER) - { - for(int i = 0; i < 3; ++i) - { - if(m_spellInfo->Effect[i] == SPELL_EFFECT_SUMMON && - (m_spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED || - m_spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED2 || - m_spellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED3)) - { - ((Player*)m_caster)->StopCastingCharm(); - break; - // Possession is removed in the UnSummon function - //if (m_caster->GetCharm()) - // ((TemporarySummon*)m_caster->GetCharm())->UnSummon(); - } - } - } - m_caster->RemoveDynObject(m_spellInfo->Id); m_caster->RemoveGameObject(m_spellInfo->Id,true); } diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 2e4a552c8d..21a489f188 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -4673,7 +4673,7 @@ void Unit::RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode) // Statue unsummoned at aura remove Totem* statue = NULL; bool channeled = false; - if(IsChanneledSpell(AurSpellInfo)) + if(Aur->GetAuraDuration() && IsChanneledSpell(AurSpellInfo)) { if(!caster) // can be already located for IsSingleTargetSpell case caster = Aur->GetCaster(); @@ -4700,6 +4700,22 @@ void Unit::RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode) } } } + + // Unsummon summon as possessed creatures on spell cancel + if(caster->GetTypeId() == TYPEID_PLAYER) + { + for(int i = 0; i < 3; ++i) + { + if(AurSpellInfo->Effect[i] == SPELL_EFFECT_SUMMON && + (AurSpellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED || + AurSpellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED2 || + AurSpellInfo->EffectMiscValueB[i] == SUMMON_TYPE_POSESSED3)) + { + ((Player*)caster)->StopCastingCharm(); + break; + } + } + } } } From 6395b4856ff124bffee716252295683976878fe1 Mon Sep 17 00:00:00 2001 From: megamage Date: Mon, 23 Feb 2009 10:00:52 -0600 Subject: [PATCH 3/8] *A temp fix for the crash caused by players disconnected in bg. Replace assert(false) by return NULL; --HG-- branch : trunk --- src/game/MapInstanced.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/game/MapInstanced.cpp b/src/game/MapInstanced.cpp index 47c0fb56b0..fe99c5c5e7 100644 --- a/src/game/MapInstanced.cpp +++ b/src/game/MapInstanced.cpp @@ -148,7 +148,13 @@ Map* MapInstanced::GetInstance(const WorldObject* obj) // instantiate or find existing bg map for player // the instance id is set in battlegroundid NewInstanceId = player->GetBattleGroundId(); - assert(NewInstanceId); + if(!NewInstanceId) + { + if(player->GetSession()->PlayerLoading()) + return NULL; + else + assert(NewInstanceId); + } map = _FindMap(NewInstanceId); if(!map) map = CreateBattleGround(NewInstanceId); From e425ba5837427a611f1b5b4856edd35c0e2adef7 Mon Sep 17 00:00:00 2001 From: megamage Date: Mon, 23 Feb 2009 11:11:50 -0600 Subject: [PATCH 4/8] *Send correct move flag to client. --HG-- branch : trunk --- src/game/Unit.cpp | 2 +- src/game/Unit.h | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 21a489f188..8ba170a84f 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -394,7 +394,7 @@ void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint8 ty } //Movement Flags (0x0 = walk, 0x100 = run, 0x200 = fly/swim) - data << uint32(GetTypeId() == TYPEID_PLAYER ? MOVEMENTFLAG_WALK_MODE : MovementFlags); + data << uint32((MovementFlags & MOVEMENTFLAG_LEVITATING) ? MOVEFLAG_FLY : MOVEFLAG_WALK); data << Time; // Time in between points data << uint32(1); // 1 single waypoint diff --git a/src/game/Unit.h b/src/game/Unit.h index 64ac958ee2..6fd7815c32 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -529,6 +529,17 @@ enum NPCFlags UNIT_NPC_FLAG_OUTDOORPVP = 0x20000000, // custom flag for outdoor pvp creatures }; +enum MoveFlags +{ + MOVEFLAG_NONE = 0x00000000, + MOVEFLAG_SLIDE = 0x00000002, + MOVEFLAG_MARCH_ON_SPOT = 0x00000004, + MOVEFLAG_JUMP = 0x00000008, + MOVEFLAG_WALK = 0x00000100, + MOVEFLAG_FLY = 0x00000200, //For dragon (+walk = glide) + MOVEFLAG_ORIENTATION = 0x00000400, //Fix orientation +}; + enum MovementFlags { MOVEMENTFLAG_NONE = 0x00000000, @@ -540,8 +551,8 @@ enum MovementFlags MOVEMENTFLAG_RIGHT = 0x00000020, MOVEMENTFLAG_PITCH_UP = 0x00000040, MOVEMENTFLAG_PITCH_DOWN = 0x00000080, - MOVEMENTFLAG_WALK_MODE = 0x00000100, // Walking - MOVEMENTFLAG_ONTRANSPORT = 0x00000200, // Used for flying on some creatures + MOVEMENTFLAG_WALK_MODE = 0x00000100, + MOVEMENTFLAG_ONTRANSPORT = 0x00000200, MOVEMENTFLAG_LEVITATING = 0x00000400, MOVEMENTFLAG_FLY_UNK1 = 0x00000800, MOVEMENTFLAG_JUMPING = 0x00001000, From 34517a860f018ee8bde34556b83b63a6ff2dd9f2 Mon Sep 17 00:00:00 2001 From: megamage Date: Mon, 23 Feb 2009 13:14:04 -0600 Subject: [PATCH 5/8] *More fix about move flag. --HG-- branch : trunk --- src/bindings/scripts/include/sc_creature.cpp | 6 +++ src/bindings/scripts/include/sc_creature.h | 2 + .../sethekk_halls/boss_tailonking_ikiss.cpp | 3 +- .../zone/black_temple/boss_illidan.cpp | 5 +- .../blackwing_lair/boss_victor_nefarius.cpp | 3 +- .../serpent_shrine/boss_lady_vashj.cpp | 3 +- .../boss_priestess_delrissa.cpp | 3 +- .../zone/molten_core/boss_shazzrah.cpp | 6 ++- .../tempest_keep/the_eye/boss_kaelthas.cpp | 6 +-- .../zone/temple_of_ahnqiraj/boss_bug_trio.cpp | 2 +- .../zone/temple_of_ahnqiraj/boss_ouro.cpp | 3 +- .../scripts/zone/undercity/undercity.cpp | 2 +- .../scripts/zone/zulaman/boss_akilzon.cpp | 2 +- .../scripts/zone/zulaman/boss_janalai.cpp | 6 +-- .../scripts/zone/zulaman/boss_zuljin.cpp | 3 +- .../scripts/zone/zulgurub/boss_jeklik.cpp | 3 -- .../scripts/zone/zulgurub/boss_mandokir.cpp | 2 +- .../scripts/zone/zulgurub/boss_renataki.cpp | 3 +- .../scripts/zone/zulgurub/boss_thekal.cpp | 1 - src/game/Creature.cpp | 2 +- src/game/Traveller.h | 2 +- src/game/Unit.cpp | 46 +++++++++++++++---- src/game/Unit.h | 6 ++- src/game/WaypointMovementGenerator.cpp | 2 +- 24 files changed, 73 insertions(+), 49 deletions(-) diff --git a/src/bindings/scripts/include/sc_creature.cpp b/src/bindings/scripts/include/sc_creature.cpp index d9c6915658..47bc01f183 100644 --- a/src/bindings/scripts/include/sc_creature.cpp +++ b/src/bindings/scripts/include/sc_creature.cpp @@ -729,6 +729,12 @@ void ScriptedAI::DoModifyThreatPercent(Unit *pUnit, int32 pct) m_creature->getThreatManager().modifyThreatPercent(pUnit, pct); } +void ScriptedAI::DoTeleportTo(float x, float y, float z, uint32 time) +{ + m_creature->Relocate(x,y,z); + m_creature->SendMonsterMove(x, y, z, time); +} + void ScriptedAI::DoTeleportPlayer(Unit* pUnit, float x, float y, float z, float o) { if(!pUnit || pUnit->GetTypeId() != TYPEID_PLAYER) diff --git a/src/bindings/scripts/include/sc_creature.h b/src/bindings/scripts/include/sc_creature.h index 683110989b..f9eb8c716d 100644 --- a/src/bindings/scripts/include/sc_creature.h +++ b/src/bindings/scripts/include/sc_creature.h @@ -150,6 +150,8 @@ struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI float DoGetThreat(Unit *u); void DoModifyThreatPercent(Unit *pUnit, int32 pct); + void DoTeleportTo(float x, float y, float z, uint32 time = 0); + //Teleports a player without dropping threat (only teleports to same map) void DoTeleportPlayer(Unit* pUnit, float x, float y, float z, float o); void DoTeleportAll(float x, float y, float z, float o); diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp index 4f02dd1afa..9dc7f53efb 100644 --- a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp +++ b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp @@ -192,8 +192,7 @@ struct TRINITY_DLL_DECL boss_talon_king_ikissAI : public ScriptedAI float Y = target->GetPositionY(); float Z = target->GetPositionZ(); - m_creature->Relocate(X,Y,Z); - m_creature->SendMonsterMove(X, Y, Z, 0, 0, 0); + DoTeleportTo(X,Y,Z); DoCast(target,SPELL_BLINK_TELEPORT); Blink = true; diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp index 1520330591..dba57924e5 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp @@ -1463,8 +1463,7 @@ struct TRINITY_DLL_DECL boss_maievAI : public ScriptedAI m_creature->AttackStop(); m_creature->InterruptNonMeleeSpells(false); m_creature->GetMotionMaster()->Clear(false); - m_creature->Relocate(x, y, z); - m_creature->SendMonsterMove(x, y, z, 0, 0, 0); + DoTeleportTo(x, y, z); DoCast(m_creature, SPELL_TELEPORT_VISUAL, true); } @@ -1940,7 +1939,7 @@ void boss_illidan_stormrageAI::HandleTalkSequence() Akama->GetMotionMaster()->Clear(false); //Akama->GetMotionMaster()->MoveIdle(); Akama->Relocate(x, y, z); - Akama->SendMonsterMove(x, y, z, 0, 0, 0);//Illidan must not die until Akama arrives. + Akama->SendMonsterMove(x, y, z, 0);//Illidan must not die until Akama arrives. Akama->GetMotionMaster()->MoveChase(m_creature); } } diff --git a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_victor_nefarius.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_victor_nefarius.cpp index 51988bc42f..e969898884 100644 --- a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_victor_nefarius.cpp +++ b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_victor_nefarius.cpp @@ -306,8 +306,7 @@ struct TRINITY_DLL_DECL boss_victor_nefariusAI : public ScriptedAI DoCast(m_creature,8149); //Teleport self to a hiding spot (this causes errors in the Trinity log but no real issues) - m_creature->Relocate(HIDE_X,HIDE_Y,HIDE_Z,0); - m_creature->SendMonsterMove(HIDE_X,HIDE_Y,HIDE_Z,0,true,0); + DoTeleportTo(HIDE_X,HIDE_Y,HIDE_Z); m_creature->addUnitState(UNIT_STAT_FLEEING); //Spawn nef and have him attack a random target diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp index 2cc2e1e0a0..fa997c69af 100644 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp +++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp @@ -402,8 +402,7 @@ struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI Phase = 2; m_creature->GetMotionMaster()->Clear(); - m_creature->Relocate(MIDDLE_X, MIDDLE_Y, MIDDLE_Z); - m_creature->SendMonsterMove(MIDDLE_X, MIDDLE_Y, MIDDLE_Z, 0, 0, 0); + DoTeleportTo(MIDDLE_X, MIDDLE_Y, MIDDLE_Z); Creature *pCreature; for(uint8 i = 0; i < 4; i++) diff --git a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_priestess_delrissa.cpp b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_priestess_delrissa.cpp index 0ef50b8dbf..c027d3a4b9 100644 --- a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_priestess_delrissa.cpp +++ b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_priestess_delrissa.cpp @@ -815,8 +815,7 @@ struct TRINITY_DLL_DECL boss_yazzaiAI : public boss_priestess_guestAI m_creature->GetPosition(x,y,z); x = rand()%2 ? x+10+rand()%10 : x-10-rand()%10; y = rand()%2 ? y+10+rand()%10 : y-10-rand()%10; - m_creature->Relocate(x,y,z); - m_creature->SendMonsterMove(x, y, m_creature->GetPositionZ(), 0,0,0); + DoTeleportTo(x, y, z); } Blink_Timer = 8000; }else Blink_Timer -= diff; diff --git a/src/bindings/scripts/scripts/zone/molten_core/boss_shazzrah.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_shazzrah.cpp index e995a8adb0..e98fca723f 100644 --- a/src/bindings/scripts/scripts/zone/molten_core/boss_shazzrah.cpp +++ b/src/bindings/scripts/scripts/zone/molten_core/boss_shazzrah.cpp @@ -95,10 +95,12 @@ struct TRINITY_DLL_DECL boss_shazzrahAI : public ScriptedAI Unit* target = NULL; target = SelectUnit(SELECT_TARGET_RANDOM,0); - m_creature->Relocate(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0); - m_creature->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0,true,0); + if(target) + { + DoTeleportTo(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ()); DoCast(target,SPELL_ARCANEEXPLOSION); DoResetThreat(); + } Blink_Timer = 45000; }else Blink_Timer -= diff; diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp index 32f563abd5..ba51635280 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp @@ -870,8 +870,7 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI m_creature->StopMoving(); m_creature->GetMotionMaster()->Clear(); m_creature->GetMotionMaster()->MoveIdle(); - m_creature->Relocate(GRAVITY_X, GRAVITY_Y, GRAVITY_Z, 0); - m_creature->SendMonsterMove(GRAVITY_X, GRAVITY_Y,GRAVITY_Z, 0, 0, 0); + DoTeleportTo(GRAVITY_X, GRAVITY_Y, GRAVITY_Z); m_creature->InterruptNonMeleeSpells(false); DoCast(m_creature, SPELL_FULLPOWER); @@ -935,8 +934,7 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI m_creature->StopMoving(); m_creature->GetMotionMaster()->Clear(); m_creature->GetMotionMaster()->MoveIdle(); - m_creature->Relocate(GRAVITY_X, GRAVITY_Y, GRAVITY_Z, 0); - m_creature->SendMonsterMove(GRAVITY_X, GRAVITY_Y, GRAVITY_Z, 0, 0, 0); + DoTeleportTo(GRAVITY_X, GRAVITY_Y, GRAVITY_Z); // 1) Kael'thas will portal the whole raid right into his body for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end();++i) { diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_bug_trio.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_bug_trio.cpp index c6ba4d28cd..1b262fa2d0 100644 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_bug_trio.cpp +++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_bug_trio.cpp @@ -176,7 +176,7 @@ struct TRINITY_DLL_DECL boss_vemAI : public ScriptedAI if(target) { DoCast(target, SPELL_CHARGE); - m_creature->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, true,1); + //m_creature->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, true,1); AttackStart(target); } diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_ouro.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_ouro.cpp index b5debb4564..7c760fcd09 100644 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_ouro.cpp +++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_ouro.cpp @@ -103,8 +103,7 @@ struct TRINITY_DLL_DECL boss_ouroAI : public ScriptedAI Unit* target = NULL; target = SelectUnit(SELECT_TARGET_RANDOM,0); - m_creature->Relocate(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0); - m_creature->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, true,1); + DoTeleportTo(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ()); ChangeTarget_Timer = 10000 + rand()%10000; }else ChangeTarget_Timer -= diff; diff --git a/src/bindings/scripts/scripts/zone/undercity/undercity.cpp b/src/bindings/scripts/scripts/zone/undercity/undercity.cpp index 87c7614c3d..8b2de36e3e 100644 --- a/src/bindings/scripts/scripts/zone/undercity/undercity.cpp +++ b/src/bindings/scripts/scripts/zone/undercity/undercity.cpp @@ -86,7 +86,7 @@ struct TRINITY_DLL_DECL npc_lady_sylvanas_windrunnerAI : public ScriptedAI { if( Unit* target = Unit::GetUnit(*summoned,targetGUID) ) { - target->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), myZ+15.0,0,0,0); + target->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), myZ+15.0,0); target->Relocate(target->GetPositionX(), target->GetPositionY(), myZ+15.0); summoned->CastSpell(target, SPELL_RIBBON_OF_SOULS, false); } diff --git a/src/bindings/scripts/scripts/zone/zulaman/boss_akilzon.cpp b/src/bindings/scripts/scripts/zone/zulaman/boss_akilzon.cpp index 53c87a4a63..34001fc774 100644 --- a/src/bindings/scripts/scripts/zone/zulaman/boss_akilzon.cpp +++ b/src/bindings/scripts/scripts/zone/zulaman/boss_akilzon.cpp @@ -311,7 +311,7 @@ struct TRINITY_DLL_DECL boss_akilzonAI : public ScriptedAI if (target) { target->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); - target->SendMonsterMove(x,y,m_creature->GetPositionZ()+15,0,0,0); + target->SendMonsterMove(x,y,m_creature->GetPositionZ()+15,0); } Unit *Cloud = m_creature->SummonTrigger(x, y, m_creature->GetPositionZ()+16, 0, 15000); if(Cloud) diff --git a/src/bindings/scripts/scripts/zone/zulaman/boss_janalai.cpp b/src/bindings/scripts/scripts/zone/zulaman/boss_janalai.cpp index 1b19d9d92b..e23b6beada 100644 --- a/src/bindings/scripts/scripts/zone/zulaman/boss_janalai.cpp +++ b/src/bindings/scripts/scripts/zone/zulaman/boss_janalai.cpp @@ -365,8 +365,7 @@ struct TRINITY_DLL_DECL boss_janalaiAI : public ScriptedAI m_creature->AttackStop(); m_creature->GetMotionMaster()->Clear(); - m_creature->Relocate(JanalainPos[0][0],JanalainPos[0][1],JanalainPos[0][2],0); - m_creature->SendMonsterMove(JanalainPos[0][0], JanalainPos[0][1],JanalainPos[0][2],0,0,0); + DoTeleportTo(JanalainPos[0][0],JanalainPos[0][1],JanalainPos[0][2]); m_creature->StopMoving(); m_creature->CastSpell(m_creature, SPELL_FIRE_BOMB_CHANNEL, false); //DoTeleportPlayer(m_creature, JanalainPos[0][0], JanalainPos[0][1],JanalainPos[0][2], 0); @@ -399,8 +398,7 @@ struct TRINITY_DLL_DECL boss_janalaiAI : public ScriptedAI m_creature->AttackStop(); m_creature->GetMotionMaster()->Clear(); - m_creature->Relocate(JanalainPos[0][0],JanalainPos[0][1],JanalainPos[0][2],0); - m_creature->SendMonsterMove(JanalainPos[0][0], JanalainPos[0][1],JanalainPos[0][2],0,0,0); + DoTeleportTo(JanalainPos[0][0],JanalainPos[0][1],JanalainPos[0][2]); m_creature->StopMoving(); m_creature->CastSpell(m_creature, SPELL_HATCH_ALL, false); HatchAllEggs(2); diff --git a/src/bindings/scripts/scripts/zone/zulaman/boss_zuljin.cpp b/src/bindings/scripts/scripts/zone/zulaman/boss_zuljin.cpp index d0b247f208..d1a7fa9fd1 100644 --- a/src/bindings/scripts/scripts/zone/zulaman/boss_zuljin.cpp +++ b/src/bindings/scripts/scripts/zone/zulaman/boss_zuljin.cpp @@ -338,8 +338,7 @@ struct TRINITY_DLL_DECL boss_zuljinAI : public ScriptedAI case 2: case 3: case 4: - m_creature->Relocate(CENTER_X, CENTER_Y, CENTER_Z,0); - m_creature->SendMonsterMove(CENTER_X, CENTER_Y, CENTER_Z,0,0,100); + DoTeleportTo(CENTER_X, CENTER_Y, CENTER_Z, 100); DoResetThreat(); m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 0); m_creature->RemoveAurasDueToSpell(Transform[Phase].unaura); diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_jeklik.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_jeklik.cpp index 2932676b58..a6c2f63307 100644 --- a/src/bindings/scripts/scripts/zone/zulgurub/boss_jeklik.cpp +++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_jeklik.cpp @@ -106,9 +106,6 @@ struct TRINITY_DLL_DECL boss_jeklikAI : public ScriptedAI if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) { DoCast(target,SPELL_CHARGE); - - m_creature->Relocate(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0); - m_creature->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, true,1); AttackStart(target); } diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_mandokir.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_mandokir.cpp index 0d27cdb72f..14eb635a61 100644 --- a/src/bindings/scripts/scripts/zone/zulgurub/boss_mandokir.cpp +++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_mandokir.cpp @@ -165,7 +165,7 @@ struct TRINITY_DLL_DECL boss_mandokirAI : public ScriptedAI else { DoCast(pUnit,SPELL_CHARGE); - m_creature->SendMonsterMove(pUnit->GetPositionX(), pUnit->GetPositionY(), pUnit->GetPositionZ(), 0, true,1); + //m_creature->SendMonsterMove(pUnit->GetPositionX(), pUnit->GetPositionY(), pUnit->GetPositionZ(), 0, true,1); AttackStart(pUnit); } } diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_renataki.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_renataki.cpp index 865295f7c5..5b68dfb839 100644 --- a/src/bindings/scripts/scripts/zone/zulgurub/boss_renataki.cpp +++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_renataki.cpp @@ -83,8 +83,7 @@ struct TRINITY_DLL_DECL boss_renatakiAI : public ScriptedAI target = SelectUnit(SELECT_TARGET_RANDOM,0); if (target) { - m_creature->Relocate(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0); - m_creature->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, true,1); + DoTeleportTo(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ()); DoCast(target,SPELL_AMBUSH); } diff --git a/src/bindings/scripts/scripts/zone/zulgurub/boss_thekal.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_thekal.cpp index c426a6b252..e2aa7d3049 100644 --- a/src/bindings/scripts/scripts/zone/zulgurub/boss_thekal.cpp +++ b/src/bindings/scripts/scripts/zone/zulgurub/boss_thekal.cpp @@ -194,7 +194,6 @@ struct TRINITY_DLL_DECL boss_thekalAI : public ScriptedAI if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) { DoCast(target,SPELL_CHARGE); - m_creature->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, true,1); DoResetThreat(); AttackStart(target); } diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index 179143b150..0e649c66c0 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -1154,7 +1154,7 @@ void Creature::AI_SendMoveToPacket(float x, float y, float z, uint32 time, uint3 m_startMove = getMSTime(); m_moveTime = time;*/ - SendMonsterMove(x, y, z, type, MovementFlags, time); + SendMonsterMove(x, y, z, time); } Player *Creature::GetLootRecipient() const diff --git a/src/game/Traveller.h b/src/game/Traveller.h index 436f8b051c..b886528267 100644 --- a/src/game/Traveller.h +++ b/src/game/Traveller.h @@ -107,7 +107,7 @@ template<> inline void Traveller::MoveTo(float x, float y, float z, uint32 t) { //Only send MOVEMENTFLAG_WALK_MODE, client has strange issues with other move flags - i_traveller.SendMonsterMove(x, y, z, 0, MOVEMENTFLAG_WALK_MODE, t); + i_traveller.SendMonsterMove(x, y, z, t); } typedef Traveller CreatureTraveller; diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 8ba170a84f..a9b300cd94 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -362,10 +362,41 @@ void Unit::SendMonsterMoveWithSpeed(float x, float y, float z, uint32 MovementFl transitTime = static_cast(dist / speed + 0.5); } //float orientation = (float)atan2((double)dy, (double)dx); - SendMonsterMove(x, y, z, 0, MovementFlags, transitTime, player); + SendMonsterMove(x, y, z, transitTime, player); } -void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint8 type, uint32 MovementFlags, uint32 Time, Player* player) +void Unit::SendMonsterStop() +{ + WorldPacket data( SMSG_MONSTER_MOVE, (41 + GetPackGUID().size()) ); + data.append(GetPackGUID()); + data << GetPositionX() << GetPositionY() << GetPositionZ(); + data << getMSTime(); + data << uint8(1); + SendMessageToSet(&data, true); +} + +void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 Time, Player* player) +{ + WorldPacket data( SMSG_MONSTER_MOVE, (41 + GetPackGUID().size()) ); + data.append(GetPackGUID()); + + data << GetPositionX() << GetPositionY() << GetPositionZ(); + data << getMSTime(); + + data << uint8(0); + data << uint32((GetUnitMovementFlags() & MOVEMENTFLAG_LEVITATING) ? MOVEFLAG_FLY : MOVEFLAG_WALK); + + data << Time; // Time in between points + data << uint32(1); // 1 single waypoint + data << NewPosX << NewPosY << NewPosZ; // the single waypoint Point B + + if(player) + player->GetSession()->SendPacket(&data); + else + SendMessageToSet( &data, true ); +} + +/*void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint8 type, uint32 MovementFlags, uint32 Time, Player* player) { WorldPacket data( SMSG_MONSTER_MOVE, (41 + GetPackGUID().size()) ); data.append(GetPackGUID()); @@ -404,9 +435,9 @@ void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint8 ty player->GetSession()->SendPacket(&data); else SendMessageToSet( &data, true ); -} +}*/ -void Unit::SendMonsterMoveByPath(Path const& path, uint32 start, uint32 end, uint32 MovementFlags) +void Unit::SendMonsterMoveByPath(Path const& path, uint32 start, uint32 end) { uint32 traveltime = uint32(path.GetTotalLength(start, end) * 32); @@ -418,13 +449,10 @@ void Unit::SendMonsterMoveByPath(Path const& path, uint32 start, uint32 end, uin data << GetPositionY(); data << GetPositionZ(); - // unknown field - unrelated to orientation - // seems to increment about 1000 for every 1.7 seconds - // for now, we'll just use mstime data << getMSTime(); data << uint8( 0 ); - data << uint32( MovementFlags ); + data << uint32((GetUnitMovementFlags() & MOVEMENTFLAG_LEVITATING) ? MOVEFLAG_FLY : MOVEFLAG_WALK); data << uint32( traveltime ); data << uint32( pathSize ); data.append( (char*)path.GetNodes(start), pathSize * 4 * 3 ); @@ -11992,7 +12020,7 @@ void Unit::StopMoving() // Relocate(GetPositionX(), GetPositionY(), z); Relocate(GetPositionX(), GetPositionY(),GetPositionZ()); - SendMonsterMove(GetPositionX(), GetPositionY(), GetPositionZ(), 0, true, 0); + SendMonsterStop(); // update position and orientation; WorldPacket data; diff --git a/src/game/Unit.h b/src/game/Unit.h index 6fd7815c32..7d63b827e2 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1036,8 +1036,10 @@ class TRINITY_DLL_SPEC Unit : public WorldObject void SendSpellNonMeleeDamageLog(Unit *target,uint32 SpellID,uint32 Damage, SpellSchoolMask damageSchoolMask,uint32 AbsorbedDamage, uint32 Resist,bool PhysicalDamage, uint32 Blocked, bool CriticalHit = false); void SendSpellMiss(Unit *target, uint32 spellID, SpellMissInfo missInfo); - void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint8 type, uint32 MovementFlags, uint32 Time, Player* player = NULL); - void SendMonsterMoveByPath(Path const& path, uint32 start, uint32 end, uint32 MovementFlags); + void SendMonsterStop(); + void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 Time, Player* player = NULL); + //void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint8 type, uint32 MovementFlags, uint32 Time, Player* player = NULL); + void SendMonsterMoveByPath(Path const& path, uint32 start, uint32 end); void SendMonsterMoveWithSpeed(float x, float y, float z, uint32 MovementFlags, uint32 transitTime = 0, Player* player = NULL); void SendMonsterMoveWithSpeedToCurrentDestination(Player* player = NULL); diff --git a/src/game/WaypointMovementGenerator.cpp b/src/game/WaypointMovementGenerator.cpp index 01161f44f5..12b7282924 100644 --- a/src/game/WaypointMovementGenerator.cpp +++ b/src/game/WaypointMovementGenerator.cpp @@ -249,7 +249,7 @@ FlightPathMovementGenerator::Initialize(Player &player) // do not send movement, it was sent already i_destinationHolder.SetDestination(traveller, i_path[i_currentNode].x, i_path[i_currentNode].y, i_path[i_currentNode].z, false); - player.SendMonsterMoveByPath(GetPath(),GetCurrentNode(),GetPathAtMapEnd(),MOVEMENTFLAG_WALK_MODE|MOVEMENTFLAG_ONTRANSPORT); + player.SendMonsterMoveByPath(GetPath(),GetCurrentNode(),GetPathAtMapEnd()); } void FlightPathMovementGenerator::Finalize(Player & player) From a646eab03c4a129702d8a21359d6c52ee1708752 Mon Sep 17 00:00:00 2001 From: Blaymoira Date: Mon, 23 Feb 2009 21:35:31 +0100 Subject: [PATCH 6/8] *Cleanup in world.sql --HG-- branch : trunk --- sql/world.sql | 272 ++++++++++++++++++++++++++------------------------ 1 file changed, 144 insertions(+), 128 deletions(-) diff --git a/sql/world.sql b/sql/world.sql index 810f986124..cd6497cae9 100644 --- a/sql/world.sql +++ b/sql/world.sql @@ -268,6 +268,29 @@ LOCK TABLES `creature_equip_template` WRITE; /*!40000 ALTER TABLE `creature_equip_template` ENABLE KEYS */; UNLOCK TABLES; +-- +-- Table structure for table `creature_formations` +-- + +DROP TABLE IF EXISTS `creature_formations`; +CREATE TABLE `creature_formations` ( + `leader` int(11) unsigned NOT NULL, + `follower` int(11) unsigned NOT NULL, + `dist` float unsigned NOT NULL, + `angle` float unsigned NOT NULL, + `groupAI` int(11) unsigned NOT NULL, + PRIMARY KEY (`follower`)); + +-- +-- Dumping data for table `creature_formations` +-- + +LOCK TABLES `creature_formations` WRITE; +/*!40000 ALTER TABLE `creature_formations` DISABLE KEYS */; +/*!40000 ALTER TABLE `creature_formations` ENABLE KEYS */; +UNLOCK TABLES; + + -- -- Table structure for table `creature_involvedrelation` -- @@ -338,64 +361,6 @@ LOCK TABLES `creature_model_info` WRITE; /*!40000 ALTER TABLE `creature_model_info` ENABLE KEYS */; UNLOCK TABLES; - --- --- Table structure for table `waypoint_data` --- - -DROP TABLE IF EXISTS `waypoint_data`; -CREATE TABLE `waypoint_data` ( - `id` int(10) unsigned NOT NULL default '0' COMMENT 'Creature GUID', - `point` mediumint(8) unsigned NOT NULL default '0', - `position_x` float NOT NULL default '0', - `position_y` float NOT NULL default '0', - `position_z` float NOT NULL default '0', - `delay` int(10) unsigned NOT NULL default '0', - `move_flag` tinyint(1) NOT NULL default '0', - `action` int(11) NOT NULL default '0', - `action_chance` smallint(3) NOT NULL default '100', - `wpguid` int(11) NOT NULL default '0' -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `creature_movement` --- - -LOCK TABLES `waypoint_data` WRITE; -/*!40000 ALTER TABLE `waypoint_data` DISABLE KEYS */; -/*!40000 ALTER TABLE `waypoint_data` ENABLE KEYS */; -UNLOCK TABLES; - - --- --- Table structure for table `waypoint_scripts` --- - -DROP TABLE IF EXISTS `waypoint_scripts`; -CREATE TABLE `waypoint_scripts` ( - `id` int(11) unsigned NOT NULL default '0', - `delay` int(11) unsigned NOT NULL default '0', - `command` int(11) unsigned NOT NULL default '0', - `datalong` int(11) unsigned NOT NULL default '0', - `datalong2` int(11) unsigned NOT NULL default '0', - `dataint` int(11) unsigned NOT NULL default '0', - `x` float NOT NULL default '0', - `y` float NOT NULL default '0', - `z` float NOT NULL default '0', - `o` float NOT NULL default '0', - `guid` int(11) NOT NULL default '0', - PRIMARY KEY (`guid`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `creature_movement` --- - -LOCK TABLES `waypoint_scripts` WRITE; -/*!40000 ALTER TABLE `waypoint_scripts` DISABLE KEYS */; -/*!40000 ALTER TABLE `waypoint_scripts` ENABLE KEYS */; -UNLOCK TABLES; - -- -- Table structure for table `creature_onkill_reputation` -- @@ -596,6 +561,7 @@ CREATE TABLE `custom_texts` ( `sound` mediumint(8) unsigned NOT NULL default '0', `type` tinyint unsigned NOT NULL default '0', `language` tinyint unsigned NOT NULL default '0', + `emote` smallint(5) UNSIGNED NOT NULL default '0', `comment` text, PRIMARY KEY (`entry`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Custom Texts'; @@ -609,24 +575,6 @@ LOCK TABLES `custom_texts` WRITE; /*!40000 ALTER TABLE `custom_texts` ENABLE KEYS */; UNLOCK TABLES; --- --- Table structure for table `db_version` --- - -DROP TABLE IF EXISTS `db_version`; -CREATE TABLE `db_version` ( - `version` varchar(120) default NULL -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes'; - --- --- Dumping data for table `db_version` --- - -LOCK TABLES `db_version` WRITE; -/*!40000 ALTER TABLE `db_version` DISABLE KEYS */; -/*!40000 ALTER TABLE `db_version` ENABLE KEYS */; -UNLOCK TABLES; - -- -- Table structure for table `disenchant_loot_template` -- @@ -807,38 +755,6 @@ LOCK TABLES `eventai_texts` WRITE; /*!40000 ALTER TABLE `eventai_texts` ENABLE KEYS */; UNLOCK TABLES; --- --- Table structure for table `script_texts` --- - -DROP TABLE IF EXISTS `script_texts`; -CREATE TABLE `script_texts` ( - `entry` mediumint(8) NOT NULL, - `content_default` text NOT NULL, - `content_loc1` text, - `content_loc2` text, - `content_loc3` text, - `content_loc4` text, - `content_loc5` text, - `content_loc6` text, - `content_loc7` text, - `content_loc8` text, - `sound` mediumint(8) unsigned NOT NULL default '0', - `type` tinyint unsigned NOT NULL default '0', - `language` tinyint unsigned NOT NULL default '0', - `comment` text, - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Script Texts'; - --- --- Dumping data for table `script_texts` --- - -LOCK TABLES `script_texts` WRITE; -/*!40000 ALTER TABLE `script_texts` DISABLE KEYS */; -/*!40000 ALTER TABLE `script_texts` ENABLE KEYS */; -UNLOCK TABLES; - -- -- Table structure for table `exploration_basexp` -- @@ -911,6 +827,26 @@ LOCK TABLES `game_event` WRITE; /*!40000 ALTER TABLE `game_event` ENABLE KEYS */; UNLOCK TABLES; +-- +-- Table structure for table `game_event_battleground_holiday` +-- + +DROP TABLE IF EXISTS `game_event_battleground_holiday`; +CREATE TABLE `game_event_battleground_holiday` ( + `event` int(10) unsigned NOT NULL, + `bgflag` int(10) unsigned NOT NULL default '0', + PRIMARY KEY (`event`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `game_event_battleground_holiday` +-- + +LOCK TABLES `game_event_battleground_holiday` WRITE; +/*!40000 ALTER TABLE `game_event_battleground_holiday` DISABLE KEYS */; +/*!40000 ALTER TABLE `game_event_battleground_holiday` ENABLE KEYS */; +UNLOCK TABLES; + -- -- Table structure for table `game_event_condition` -- @@ -2831,24 +2767,6 @@ LOCK TABLES `reserved_name` WRITE; /*!40000 ALTER TABLE `reserved_name` ENABLE KEYS */; UNLOCK TABLES; --- --- Table structure for table `script_db_version` --- - -DROP TABLE IF EXISTS `script_db_version`; -CREATE TABLE `script_db_version` ( - `version` varchar(255) NOT NULL default '' COMMENT 'Database version string' -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `script_db_version` --- - -LOCK TABLES `script_db_version` WRITE; -/*!40000 ALTER TABLE `script_db_version` DISABLE KEYS */; -/*!40000 ALTER TABLE `script_db_version` ENABLE KEYS */; -UNLOCK TABLES; - -- -- Table structure for table `script_texts` -- @@ -2865,9 +2783,10 @@ CREATE TABLE `script_texts` ( `content_loc6` text, `content_loc7` text, `content_loc8` text, - `sound` tinyint(3) unsigned NOT NULL default '0', + `sound` mediumint(8) unsigned NOT NULL default '0', `type` tinyint(3) unsigned NOT NULL default '0', - `language` tinyint(3) unsigned NOT NULL default '0', + `language` smallint(5) unsigned NOT NULL default '0', + `emote` smallint(5) UNSIGNED NOT NULL default '0', `comment` text, PRIMARY KEY (`entry`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Script Texts'; @@ -3265,6 +3184,26 @@ LOCK TABLES `trinity_string` WRITE; /*!40000 ALTER TABLE `trinity_string` ENABLE KEYS */; UNLOCK TABLES; +-- +-- Table structure for table `transport_events` +-- + +DROP TABLE IF EXISTS `transport_events`; +CREATE TABLE `transport_events` ( + `entry` int(11) unsigned NOT NULL default '0', + `waypoint_id` int(11) unsigned NOT NULL default '0', + `event_id` int(11) unsigned NOT NULL default '0' +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `transport_events` +-- + +LOCK TABLES `trinity_string` WRITE; +/*!40000 ALTER TABLE `transport_events` DISABLE KEYS */; +/*!40000 ALTER TABLE `transport_events` ENABLE KEYS */; +UNLOCK TABLES; + -- -- Table structure for table `uptime` -- @@ -3286,6 +3225,83 @@ LOCK TABLES `uptime` WRITE; /*!40000 ALTER TABLE `uptime` DISABLE KEYS */; /*!40000 ALTER TABLE `uptime` ENABLE KEYS */; UNLOCK TABLES; + +-- +-- Table structure for table `version` +-- + +DROP TABLE IF EXISTS `version`; +CREATE TABLE `version` ( + `core_version` varchar(120) default NULL COMMENT 'Core revision dumped at startup.', + `db_version` varchar(120) default NULL COMMENT 'Version of world DB.', + `script_version` varchar(120) default NULL COMMENT 'Version of scripts DB.' +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Version Notes'; + +-- +-- Dumping data for table `version` +-- + +LOCK TABLES `version` WRITE; +/*!40000 ALTER TABLE `version` DISABLE KEYS */; +/*!40000 ALTER TABLE `version` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `waypoint_data` +-- + +DROP TABLE IF EXISTS `waypoint_data`; +CREATE TABLE `waypoint_data` ( + `id` int(10) unsigned NOT NULL default '0' COMMENT 'Creature GUID', + `point` mediumint(8) unsigned NOT NULL default '0', + `position_x` float NOT NULL default '0', + `position_y` float NOT NULL default '0', + `position_z` float NOT NULL default '0', + `delay` int(10) unsigned NOT NULL default '0', + `move_flag` tinyint(1) NOT NULL default '0', + `action` int(11) NOT NULL default '0', + `action_chance` smallint(3) NOT NULL default '100', + `wpguid` int(11) NOT NULL default '0' +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `waypoint_data` +-- + +LOCK TABLES `waypoint_scripts` WRITE; +/*!40000 ALTER TABLE `waypoint_scripts` DISABLE KEYS */; +/*!40000 ALTER TABLE `waypoint_scripts` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `waypoint_scripts` +-- + +DROP TABLE IF EXISTS `waypoint_scripts`; +CREATE TABLE `waypoint_scripts` ( + `id` int(11) unsigned NOT NULL default '0', + `delay` int(11) unsigned NOT NULL default '0', + `command` int(11) unsigned NOT NULL default '0', + `datalong` int(11) unsigned NOT NULL default '0', + `datalong2` int(11) unsigned NOT NULL default '0', + `dataint` int(11) unsigned NOT NULL default '0', + `x` float NOT NULL default '0', + `y` float NOT NULL default '0', + `z` float NOT NULL default '0', + `o` float NOT NULL default '0', + `guid` int(11) NOT NULL default '0', + PRIMARY KEY (`guid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `waypoint_scripts` +-- + +LOCK TABLES `waypoint_scripts` WRITE; +/*!40000 ALTER TABLE `waypoint_scripts` DISABLE KEYS */; +/*!40000 ALTER TABLE `waypoint_scripts` ENABLE KEYS */; +UNLOCK TABLES; + /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; From 86d7a838913d66e1548951f7e97ff7a75fb52411 Mon Sep 17 00:00:00 2001 From: Blaymoira Date: Mon, 23 Feb 2009 22:06:25 +0100 Subject: [PATCH 7/8] *Fix a typo --HG-- branch : trunk --- sql/world.sql | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/sql/world.sql b/sql/world.sql index cd6497cae9..af7d9785ca 100644 --- a/sql/world.sql +++ b/sql/world.sql @@ -274,8 +274,8 @@ UNLOCK TABLES; DROP TABLE IF EXISTS `creature_formations`; CREATE TABLE `creature_formations` ( - `leader` int(11) unsigned NOT NULL, - `follower` int(11) unsigned NOT NULL, + `leaderGUID` int(11) unsigned NOT NULL, + `memberGUID` int(11) unsigned NOT NULL, `dist` float unsigned NOT NULL, `angle` float unsigned NOT NULL, `groupAI` int(11) unsigned NOT NULL, @@ -2912,26 +2912,24 @@ LOCK TABLES `spell_affect` WRITE; UNLOCK TABLES; -- --- Table structure for table `spell_chain` +-- Table structure for table `spell_required` -- -DROP TABLE IF EXISTS `spell_chain`; -CREATE TABLE `spell_chain` ( +DROP TABLE IF EXISTS `spell_required`; +CREATE TABLE `spell_required` ( `spell_id` mediumint(9) NOT NULL default '0', `prev_spell` mediumint(9) NOT NULL default '0', - `first_spell` mediumint(9) NOT NULL default '0', - `rank` tinyint(4) NOT NULL default '0', `req_spell` mediumint(9) NOT NULL default '0', PRIMARY KEY (`spell_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Spell Additinal Data'; -- --- Dumping data for table `spell_chain` +-- Dumping data for table `spell_required` -- -LOCK TABLES `spell_chain` WRITE; -/*!40000 ALTER TABLE `spell_chain` DISABLE KEYS */; -/*!40000 ALTER TABLE `spell_chain` ENABLE KEYS */; +LOCK TABLES `spell_required` WRITE; +/*!40000 ALTER TABLE `spell_required` DISABLE KEYS */; +/*!40000 ALTER TABLE `spell_required` ENABLE KEYS */; UNLOCK TABLES; -- @@ -3233,6 +3231,7 @@ UNLOCK TABLES; DROP TABLE IF EXISTS `version`; CREATE TABLE `version` ( `core_version` varchar(120) default NULL COMMENT 'Core revision dumped at startup.', + `core_revision` BIGINT UNSIGNED default '0', `db_version` varchar(120) default NULL COMMENT 'Version of world DB.', `script_version` varchar(120) default NULL COMMENT 'Version of scripts DB.' ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Version Notes'; From 387b6af430bdf6be2a8a21caddedc43cba59f344 Mon Sep 17 00:00:00 2001 From: megamage Date: Mon, 23 Feb 2009 16:59:25 -0600 Subject: [PATCH 8/8] *Fix the bug of taxi movement. *Correct the size of move stop packet. --HG-- branch : trunk --- src/game/Unit.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index a9b300cd94..3d3c4874b2 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -367,7 +367,7 @@ void Unit::SendMonsterMoveWithSpeed(float x, float y, float z, uint32 MovementFl void Unit::SendMonsterStop() { - WorldPacket data( SMSG_MONSTER_MOVE, (41 + GetPackGUID().size()) ); + WorldPacket data( SMSG_MONSTER_MOVE, (17 + GetPackGUID().size()) ); data.append(GetPackGUID()); data << GetPositionX() << GetPositionY() << GetPositionZ(); data << getMSTime(); @@ -452,7 +452,7 @@ void Unit::SendMonsterMoveByPath(Path const& path, uint32 start, uint32 end) data << getMSTime(); data << uint8( 0 ); - data << uint32((GetUnitMovementFlags() & MOVEMENTFLAG_LEVITATING) ? MOVEFLAG_FLY : MOVEFLAG_WALK); + data << uint32(((GetUnitMovementFlags() & MOVEMENTFLAG_LEVITATING) || isInFlight())? MOVEFLAG_FLY : MOVEFLAG_WALK); data << uint32( traveltime ); data << uint32( pathSize ); data.append( (char*)path.GetNodes(start), pathSize * 4 * 3 );