From b5476118f28bbeb79abf0219b861773a024b28a5 Mon Sep 17 00:00:00 2001 From: megamage Date: Tue, 9 Dec 2008 09:42:45 -0600 Subject: *Add detailed log when teleport a player back when login. --HG-- branch : trunk --- src/game/Player.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/game/Player.cpp b/src/game/Player.cpp index d57f86a0d80..99c1e398f08 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -13919,11 +13919,13 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder ) { SetMapId(at->target_mapId); Relocate(at->target_X, at->target_Y, at->target_Z, GetOrientation()); + sLog.outError("Player (guidlow %d) is teleported to gobacktrigger (Map: %u X: %f Y: %f Z: %f O: %f).",guid,GetMapId(),GetPositionX(),GetPositionY(),GetPositionZ(),GetOrientation()); } else { SetMapId(m_homebindMapId); Relocate(m_homebindX, m_homebindY, m_homebindZ, GetOrientation()); + sLog.outError("Player (guidlow %d) is teleported to home (Map: %u X: %f Y: %f Z: %f O: %f).",guid,GetMapId(),GetPositionX(),GetPositionY(),GetPositionZ(),GetOrientation()); } map = GetMap(); -- cgit v1.2.3 From d3c2c31e2ed7d27e64a09d804d2222ad20715574 Mon Sep 17 00:00:00 2001 From: megamage Date: Tue, 9 Dec 2008 10:20:02 -0600 Subject: *Fix the bug that some creature spells are broken. --HG-- branch : trunk --- src/game/Unit.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 40ed45d027b..5c41ecaf9be 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -862,15 +862,15 @@ void Unit::CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, I SpellCastTargets targets; uint32 targetMask = spellInfo->Targets; - if(targetMask & (TARGET_FLAG_UNIT|TARGET_FLAG_UNK2)) + targets.setUnitTarget(Victim); + /*if(targetMask & (TARGET_FLAG_UNIT|TARGET_FLAG_UNK2)) { if(!Victim) { sLog.outError("CastSpell: spell id %i by caster: %s %u) does not have unit target", spellInfo->Id,(GetTypeId()==TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"),(GetTypeId()==TYPEID_PLAYER ? GetGUIDLow() : GetEntry())); return; } - targets.setUnitTarget(Victim); - } + }*/ if(targetMask & (TARGET_FLAG_SOURCE_LOCATION|TARGET_FLAG_DEST_LOCATION)) { if(!Victim) @@ -916,15 +916,15 @@ void Unit::CastCustomSpell(Unit* Victim,SpellEntry const *spellInfo, int32 const SpellCastTargets targets; uint32 targetMask = spellInfo->Targets; - if(targetMask & (TARGET_FLAG_UNIT|TARGET_FLAG_UNK2)) + targets.setUnitTarget(Victim); + /*if(targetMask & (TARGET_FLAG_UNIT|TARGET_FLAG_UNK2)) { if(!Victim) { sLog.outError("CastCustomSpell: spell id %i by caster: %s %u) does not have unit target", spellInfo->Id,(GetTypeId()==TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"),(GetTypeId()==TYPEID_PLAYER ? GetGUIDLow() : GetEntry())); return; } - targets.setUnitTarget(Victim); - } + }*/ if(targetMask & (TARGET_FLAG_SOURCE_LOCATION|TARGET_FLAG_DEST_LOCATION)) { if(!Victim) -- cgit v1.2.3 From a8a3d38cbb30b0e8f3974834947a4a8a43236859 Mon Sep 17 00:00:00 2001 From: megamage Date: Tue, 9 Dec 2008 12:15:49 -0600 Subject: *Fix the crash bug that trying to teleport player home when homebind is not loaded. --HG-- branch : trunk --- src/game/Player.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 99c1e398f08..e5c046034f4 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -13910,6 +13910,9 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder ) m_movementInfo.t_o = 0.0f; } + if(!_LoadHomeBind(holder->GetResult(PLAYER_LOGIN_QUERY_LOADHOMEBIND))) + return false; + // load the player's map here if it's not already loaded Map *map = GetMap(); if (!map) @@ -14170,8 +14173,8 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder ) m_social = sSocialMgr.LoadFromDB(holder->GetResult(PLAYER_LOGIN_QUERY_LOADSOCIALLIST), GetGUIDLow()); - if(!_LoadHomeBind(holder->GetResult(PLAYER_LOGIN_QUERY_LOADHOMEBIND))) - return false; + //if(!_LoadHomeBind(holder->GetResult(PLAYER_LOGIN_QUERY_LOADHOMEBIND))) + // return false; // check PLAYER_CHOSEN_TITLE compatibility with PLAYER__FIELD_KNOWN_TITLES // note: PLAYER__FIELD_KNOWN_TITLES updated at quest status loaded -- cgit v1.2.3 From 2f1b3f48c71b62bfbc8cf5b499be8b8456190789 Mon Sep 17 00:00:00 2001 From: megamage Date: Tue, 9 Dec 2008 12:24:53 -0600 Subject: *Allow user to choose cell size. If there are many players, or the hardware of server is not good enough, you should comment the line "#define LARGE_CELL" in GridDefines.h otherwise you may experience high CPU usage and high lag. --HG-- branch : trunk --- src/game/GridDefines.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/game/GridDefines.h b/src/game/GridDefines.h index 54dd2d02920..6001e366212 100644 --- a/src/game/GridDefines.h +++ b/src/game/GridDefines.h @@ -33,6 +33,17 @@ class GameObject; class Pet; class Player; +//comment the next line if CPU usage is too high +#define LARGE_CELL + +#ifdef LARGE_CELL +#define MAX_NUMBER_OF_CELLS 4 +#define CENTER_GRID_CELL_ID 128 +#else +#define MAX_NUMBER_OF_CELLS 8 +#define CENTER_GRID_CELL_ID 256 +#endif + #define MAX_NUMBER_OF_GRIDS 64 #define SIZE_OF_GRIDS 533.33333f @@ -43,10 +54,8 @@ class Player; #define MIN_GRID_DELAY MINUTE*1000 #define MIN_MAP_UPDATE_DELAY 50 -#define MAX_NUMBER_OF_CELLS 4 #define SIZE_OF_GRID_CELL (SIZE_OF_GRIDS/MAX_NUMBER_OF_CELLS) -#define CENTER_GRID_CELL_ID 128 #define CENTER_GRID_CELL_OFFSET (SIZE_OF_GRID_CELL/2) #define TOTAL_NUMBER_OF_CELLS_PER_MAP (MAX_NUMBER_OF_GRIDS*MAX_NUMBER_OF_CELLS) -- cgit v1.2.3 From 16b2db1ab293d4afd768b3c069ba2f0435adcdd7 Mon Sep 17 00:00:00 2001 From: megamage Date: Tue, 9 Dec 2008 16:59:02 -0600 Subject: *Update Uldaman script. --HG-- branch : trunk --- .../scripts/zone/uldaman/instance_uldaman.cpp | 229 +++++++++++---------- 1 file changed, 122 insertions(+), 107 deletions(-) (limited to 'src') diff --git a/src/bindings/scripts/scripts/zone/uldaman/instance_uldaman.cpp b/src/bindings/scripts/scripts/zone/uldaman/instance_uldaman.cpp index 60776ec9c65..6ae07954950 100644 --- a/src/bindings/scripts/scripts/zone/uldaman/instance_uldaman.cpp +++ b/src/bindings/scripts/scripts/zone/uldaman/instance_uldaman.cpp @@ -31,58 +31,54 @@ struct TRINITY_DLL_DECL instance_uldaman : public ScriptedInstance { - instance_uldaman(Map *Map) : ScriptedInstance(Map) { + instance_uldaman(Map *map) : ScriptedInstance(map) + { Initialize(); - stoneKeepersCounter = 0; - altarOfTheKeeperCounter = 0; - vaultWalkerCounter = 0; - earthenGuardianCounter = 0; - archaedasWallMinionsCounter = 0; - whoWokeArchaedasGUID = 0; }; + void Initialize() + { + archaedasGUID = 0; + altarOfTheKeeperTempleDoor = 0; + archaedasTempleDoor = 0; + ancientVaultDoor = 0; + whoWokeArchaedasGUID = 0; + } - Creature* archaedas; - uint64 stoneKeeper[4]; - uint32 stoneKeepersCounter; - - uint64 altarOfTheKeeperCount[5]; - uint32 altarOfTheKeeperCounter; - - uint64 vaultWalker[4]; - uint32 vaultWalkerCounter; - - uint64 earthenGuardian[6]; - uint32 earthenGuardianCounter; - - uint64 archaedasWallMinions[100]; // minions lined up around the wall - uint32 archaedasWallMinionsCounter; - - GameObject *altarOfTheKeeperTempleDoor; - GameObject *archaedasTempleDoor; - GameObject *ancientVaultDoor; - + uint64 archaedasGUID; + uint64 altarOfTheKeeperTempleDoor; + uint64 archaedasTempleDoor; + uint64 ancientVaultDoor; uint64 whoWokeArchaedasGUID; - void OnObjectCreate (GameObject* go) { - switch (go->GetEntry()) { + std::vector stoneKeeper; + std::vector altarOfTheKeeperCount; + std::vector vaultWalker; + std::vector earthenGuardian; + std::vector archaedasWallMinions; // minions lined up around the wall + + void OnObjectCreate (GameObject* go) + { + switch (go->GetEntry()) + { case ALTAR_OF_THE_KEEPER_TEMPLE_DOOR: // lock the door - altarOfTheKeeperTempleDoor = go; + altarOfTheKeeperTempleDoor = go->GetGUID(); break; case ARCHAEDAS_TEMPLE_DOOR: - archaedasTempleDoor = go; + archaedasTempleDoor = go->GetGUID(); break; case ANCIENT_VAULT_DOOR: go->SetUInt32Value(GAMEOBJECT_STATE,1); go->SetUInt32Value(GAMEOBJECT_FLAGS, 33); - ancientVaultDoor = go; + ancientVaultDoor = go->GetGUID(); break; } } - void SetFrozenState(Creature *creature) { + void SetFrozenState(Creature *creature) + { creature->setFaction(35); creature->RemoveAllAuras(); //creature->RemoveFlag (UNIT_FIELD_FLAGS,UNIT_FLAG_ANIMATION_FROZEN); @@ -90,121 +86,137 @@ struct TRINITY_DLL_DECL instance_uldaman : public ScriptedInstance creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); } - void OpenDoor (GameObject *go) { - if (!go) return; + void OpenDoor(uint64 guid) + { + GameObject *go = instance->GetGameObjectInMap(guid); + if(!go) + return; + go->SetUInt32Value(GAMEOBJECT_FLAGS, 33); go->SetUInt32Value(GAMEOBJECT_STATE, 0); } - - - void ActivateStoneKeepers() { - Creature *target; - uint32 counter = stoneKeepersCounter; - // error_log ("ActivateStoneKeepers"); - // error_log ("counter = %d", counter); - for (; counter>0; ) { - target = (Creature *) Unit::GetUnit(*archaedas,stoneKeeper[--counter]); - if (!target || !target->isAlive() || target->getFaction()==14) continue; - target->RemoveFlag (UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE); + void ActivateStoneKeepers() + { + for(std::vector::iterator i = stoneKeeper.begin(); i != stoneKeeper.end(); ++i) + { + Creature *target = instance->GetCreatureInMap(*i); + if (!target || !target->isAlive() || target->getFaction()==14) + continue; + target->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE); target->setFaction(14); target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); return; // only want the first one we find } - // error_log ("opening doors"); // if we get this far than all four are dead so open the door SetData (NULL, 0); } - void ActivateWallMinions() { - Creature *target; - uint32 counter = archaedasWallMinionsCounter; - for (; counter>0; ) { - target = (Creature *) Unit::GetUnit(*archaedas,archaedasWallMinions[--counter]); - if (!target || !target->isAlive() || target->getFaction()==14) continue; - archaedas->CastSpell (target, SPELL_AWAKEN_VAULT_WALKER, true); + void ActivateWallMinions() + { + Creature *archaedas = instance->GetCreatureInMap(archaedasGUID); + if(!archaedas) + return; + + for(std::vector::iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i) + { + Creature *target = instance->GetCreatureInMap(*i); + if (!target || !target->isAlive() || target->getFaction()==14) + continue; + archaedas->CastSpell(target, SPELL_AWAKEN_VAULT_WALKER, true); target->CastSpell(target, SPELL_ARCHAEDAS_AWAKEN,true); return; // only want the first one we find } } // used when Archaedas dies. All active minions must be despawned. - void DeActivateMinions() { - Creature *target; - uint32 counter = archaedasWallMinionsCounter; - + void DeActivateMinions() + { // first despawn any aggroed wall minions - for (; counter>0; ) { - target = (Creature *) Unit::GetUnit(*archaedas,archaedasWallMinions[--counter]); - if (!target || target->isDead() || target->getFaction()!=14) continue; - target->RemoveFromWorld(); - target->AI()->EnterEvadeMode(); // need this b/c it still attacks even when removed + for(std::vector::iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i) + { + Creature *target = instance->GetCreatureInMap(*i); + if (!target || target->isDead() || target->getFaction()!=14) + continue; + target->setDeathState(JUST_DIED); + target->RemoveCorpse(); } // Vault Walkers - for (counter=0; counter<4; counter++) { - target = (Creature *) Unit::GetUnit(*archaedas,vaultWalker[counter]); - if (!target || target->isDead() || target->getFaction() != 14) continue; - target->RemoveFromWorld(); - target->AI()->EnterEvadeMode(); // need this b/c it sill attacks even when removed + for(std::vector::iterator i = vaultWalker.begin(); i != vaultWalker.end(); ++i) + { + Creature *target = instance->GetCreatureInMap(*i); + if (!target || target->isDead() || target->getFaction()!=14) + continue; + target->setDeathState(JUST_DIED); + target->RemoveCorpse(); } // Earthen Guardians - for (counter=0; counter<6; counter++) { - target = (Creature *) Unit::GetUnit(*archaedas,earthenGuardian[counter]); - if (!target || target->isDead() || target->getFaction() != 14) continue; - target->RemoveFromWorld(); - target->AI()->EnterEvadeMode(); // need this b/c it sill attacks even when removed + for(std::vector::iterator i = earthenGuardian.begin(); i != earthenGuardian.end(); ++i) + { + Creature *target = instance->GetCreatureInMap(*i); + if (!target || target->isDead() || target->getFaction()!=14) + continue; + target->setDeathState(JUST_DIED); + target->RemoveCorpse(); } } - void ActivateArchaedas(uint64 target) { - - Unit *victim = Unit::GetUnit(*archaedas, target); - archaedas->CastSpell(archaedas, SPELL_ARCHAEDAS_AWAKEN,false); - whoWokeArchaedasGUID = target; + void ActivateArchaedas(uint64 target) + { + Creature *archaedas = instance->GetCreatureInMap(archaedasGUID); + if(!archaedas) + return; + + if(Unit *victim = Unit::GetUnit(*archaedas, target)) + { + archaedas->CastSpell(archaedas, SPELL_ARCHAEDAS_AWAKEN,false); + whoWokeArchaedasGUID = target; + } } - void RespawnMinions() { - Creature *target; - uint32 counter = archaedasWallMinionsCounter; - - // first respawn any wall minions - for (; counter>0; ) { - target = (Creature *) Unit::GetUnit(*archaedas,archaedasWallMinions[--counter]); - if (target && target->isDead()) { + void RespawnMinions() + { + // first respawn any aggroed wall minions + for(std::vector::iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i) + { + Creature *target = instance->GetCreatureInMap(*i); + if (target && target->isDead()) + { target->Respawn(); target->GetMotionMaster()->MoveTargetedHome(); - //target->AI()->EnterEvadeMode(); SetFrozenState(target); } } // Vault Walkers - for (counter=0; counter<4; counter++) { - target = (Creature *) Unit::GetUnit(*archaedas,vaultWalker[counter]); - if (target && target->isDead()) { + for(std::vector::iterator i = vaultWalker.begin(); i != vaultWalker.end(); ++i) + { + Creature *target = instance->GetCreatureInMap(*i); + if (target && target->isDead()) + { target->Respawn(); target->GetMotionMaster()->MoveTargetedHome(); - // target->AI()->EnterEvadeMode(); SetFrozenState(target); } } // Earthen Guardians - for (counter=0; counter<6; counter++) { - target = (Creature *) Unit::GetUnit(*archaedas,earthenGuardian[counter]); - if (target && target->isDead()) { + for(std::vector::iterator i = earthenGuardian.begin(); i != earthenGuardian.end(); ++i) + { + Creature *target = instance->GetCreatureInMap(*i); + if (target && target->isDead()) + { target->Respawn(); target->GetMotionMaster()->MoveTargetedHome(); - //target->AI()->EnterEvadeMode(); SetFrozenState(target); } } - } - void SetData (uint32 type, uint32 data) { + void SetData (uint32 type, uint32 data) + { //error_log ("SetData: data = %d", data); if (data==0) OpenDoor (altarOfTheKeeperTempleDoor); if (data==0) OpenDoor (archaedasTempleDoor); @@ -216,8 +228,11 @@ struct TRINITY_DLL_DECL instance_uldaman : public ScriptedInstance } - void SetData64 (uint32 type, uint64 data) { - if (type==0 ) { // Archaedas + void SetData64 (uint32 type, uint64 data) + { + // Archaedas + if (type==0 ) + { ActivateArchaedas (data); } } @@ -228,33 +243,34 @@ struct TRINITY_DLL_DECL instance_uldaman : public ScriptedInstance switch (creature_entry) { case 4857: // Stone Keeper SetFrozenState (creature); - stoneKeeper[stoneKeepersCounter++] = creature->GetGUID(); + stoneKeeper.push_back(creature->GetGUID()); break; case 7309: // Earthen Custodian - archaedasWallMinions[archaedasWallMinionsCounter++] = creature->GetGUID(); + archaedasWallMinions.push_back(creature->GetGUID()); break; case 7077: // Earthen Hallshaper - archaedasWallMinions[archaedasWallMinionsCounter++] = creature->GetGUID(); + archaedasWallMinions.push_back(creature->GetGUID()); break; case 7076: // Earthen Guardian - earthenGuardian[earthenGuardianCounter++] = creature->GetGUID(); + earthenGuardian.push_back(creature->GetGUID()); break; case 10120: // Vault Walker - vaultWalker[vaultWalkerCounter++] = creature->GetGUID(); + vaultWalker.push_back(creature->GetGUID()); break; case 2748: // Archaedas - archaedas = creature; + archaedasGUID = creature->GetGUID(); break; } // end switch } // end OnCreatureCreate - uint64 GetData64 (uint32 identifier) { + uint64 GetData64 (uint32 identifier) + { if (identifier == 0) return whoWokeArchaedasGUID; if (identifier == 1) return vaultWalker[0]; // VaultWalker1 if (identifier == 2) return vaultWalker[1]; // VaultWalker2 @@ -270,7 +286,6 @@ struct TRINITY_DLL_DECL instance_uldaman : public ScriptedInstance return 0; } // end GetData64 - }; -- cgit v1.2.3 From a1eaec791ea6757b99b0ceea07edf5cc09380a69 Mon Sep 17 00:00:00 2001 From: megamage Date: Tue, 9 Dec 2008 17:40:33 -0600 Subject: *Break stealth when applying all stun/root/confuse/fear/charm/possess auras. --HG-- branch : trunk --- src/game/Spell.cpp | 3 +-- src/game/SpellMgr.cpp | 29 +++++++++++++++++++---------- src/game/SpellMgr.h | 17 +++++++++++------ 3 files changed, 31 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 8a5585aad21..199e6386b32 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -1199,8 +1199,7 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask) } unit->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_HITBYSPELL); - //TODO: find a better way to judge CC auras - if(m_spellInfo->Attributes & SPELL_ATTR_BREAKABLE_BY_DAMAGE) + if(spellmgr.GetSpellCustomAttr(m_spellInfo->Id) & SPELL_ATTR_CU_AURA_CC) unit->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_CC); } else diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index 4091efd2003..b8cf06ea5e8 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -1824,15 +1824,16 @@ void SpellMgr::LoadSpellPetAuras() // set data in core for now void SpellMgr::LoadSpellCustomAttr() { + mSpellCustomAttr.resize(GetSpellStore()->GetNumRows()); + SpellEntry *tempSpell; for(uint32 i = 0; i < GetSpellStore()->GetNumRows(); ++i) { + mSpellCustomAttr[i] = 0; tempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(i); if(!tempSpell) continue; - mSpellCustomAttrMap[tempSpell->Id] = 0; - for(uint32 i = 0; i < 3; ++i) { switch(tempSpell->EffectApplyAuraName[i]) @@ -1840,11 +1841,19 @@ void SpellMgr::LoadSpellCustomAttr() case SPELL_AURA_PERIODIC_DAMAGE: case SPELL_AURA_PERIODIC_DAMAGE_PERCENT: case SPELL_AURA_PERIODIC_LEECH: - mSpellCustomAttrMap[tempSpell->Id] |= SPELL_ATTR_CU_EFFECT_DAMAGE; + mSpellCustomAttr[i] |= SPELL_ATTR_CU_AURA_DOT; break; case SPELL_AURA_PERIODIC_HEAL: case SPELL_AURA_OBS_MOD_HEALTH: - mSpellCustomAttrMap[tempSpell->Id] |= SPELL_ATTR_CU_EFFECT_HEAL; + mSpellCustomAttr[i] |= SPELL_ATTR_CU_AURA_HOT; + break; + case SPELL_AURA_MOD_POSSESS: + case SPELL_AURA_MOD_CONFUSE: + case SPELL_AURA_MOD_CHARM: + case SPELL_AURA_MOD_FEAR: + case SPELL_AURA_MOD_STUN: + case SPELL_AURA_MOD_ROOT: + mSpellCustomAttr[i] |= SPELL_ATTR_CU_AURA_CC; break; default: break; @@ -1852,14 +1861,14 @@ void SpellMgr::LoadSpellCustomAttr() } if(tempSpell->SpellVisual == 3879) - mSpellCustomAttrMap[tempSpell->Id] |= SPELL_ATTR_CU_CONE_BACK; + mSpellCustomAttr[i] |= SPELL_ATTR_CU_CONE_BACK; - switch(tempSpell->Id) + switch(i) { case 26029: // dark glare case 37433: // spout case 43140: case 43215: // flame breath - mSpellCustomAttrMap[tempSpell->Id] |= SPELL_ATTR_CU_CONE_LINE; + mSpellCustomAttr[i] |= SPELL_ATTR_CU_CONE_LINE; break; case 24340: case 26558: case 28884: // Meteor case 36837: case 38903: case 41276: // Meteor @@ -1869,7 +1878,7 @@ void SpellMgr::LoadSpellCustomAttr() case 40810: case 43267: case 43268: // Saber Lash case 42384: // Brutal Swipe case 45150: // Meteor Slash - mSpellCustomAttrMap[tempSpell->Id] |= SPELL_ATTR_CU_SHARE_DAMAGE; + mSpellCustomAttr[i] |= SPELL_ATTR_CU_SHARE_DAMAGE; break; case 44978: case 45001: case 45002: // Wild Magic case 45004: case 45006: case 45010: // Wild Magic @@ -1878,12 +1887,12 @@ void SpellMgr::LoadSpellCustomAttr() case 44869: // Spectral Blast case 45027: // Revitalize case 45976: // Muru Portal Channel - mSpellCustomAttrMap[tempSpell->Id] |= SPELL_ATTR_CU_PLAYERS_ONLY; + mSpellCustomAttr[i] |= SPELL_ATTR_CU_PLAYERS_ONLY; tempSpell->MaxAffectedTargets = 1; break; case 41376: // Spite case 39992: // Needle Spine - mSpellCustomAttrMap[tempSpell->Id] |= SPELL_ATTR_CU_PLAYERS_ONLY; + mSpellCustomAttr[i] |= SPELL_ATTR_CU_PLAYERS_ONLY; tempSpell->MaxAffectedTargets = 3; break; case 8122: case 8124: case 10888: case 10890: // Psychic Scream diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h index f89edb49635..c13d3a25989 100644 --- a/src/game/SpellMgr.h +++ b/src/game/SpellMgr.h @@ -681,10 +681,11 @@ inline bool IsProfessionSkill(uint32 skill) #define SPELL_ATTR_CU_CONE_BACK 0x00000002 #define SPELL_ATTR_CU_CONE_LINE 0x00000004 #define SPELL_ATTR_CU_SHARE_DAMAGE 0x00000008 -#define SPELL_ATTR_CU_EFFECT_HEAL 0x00000010 -#define SPELL_ATTR_CU_EFFECT_DAMAGE 0x00000020 +#define SPELL_ATTR_CU_AURA_HOT 0x00000010 +#define SPELL_ATTR_CU_AURA_DOT 0x00000020 +#define SPELL_ATTR_CU_AURA_CC 0x00000040 -typedef std::map SpellCustomAttrMap; +typedef std::vector SpellCustomAttribute; typedef std::map > SpellLinkedMap; @@ -888,11 +889,15 @@ class SpellMgr uint32 GetSpellCustomAttr(uint32 spell_id) const { - SpellCustomAttrMap::const_iterator itr = mSpellCustomAttrMap.find(spell_id); + if(spell_id >= mSpellCustomAttr.size()) + return 0; + else + return mSpellCustomAttr[spell_id]; + /*SpellCustomAttrMap::const_iterator itr = mSpellCustomAttrMap.find(spell_id); if(itr != mSpellCustomAttrMap.end()) return itr->second; else - return 0; + return 0;*/ } const std::vector *GetSpellLinked(int32 spell_id) const @@ -932,7 +937,7 @@ class SpellMgr SpellProcEventMap mSpellProcEventMap; SkillLineAbilityMap mSkillLineAbilityMap; SpellPetAuraMap mSpellPetAuraMap; - SpellCustomAttrMap mSpellCustomAttrMap; + SpellCustomAttribute mSpellCustomAttr; SpellLinkedMap mSpellLinkedMap; }; -- cgit v1.2.3 From 20947a4c730a68232d901d87cdb06035b6f2573d Mon Sep 17 00:00:00 2001 From: megamage Date: Tue, 9 Dec 2008 17:57:20 -0600 Subject: *Do not allow to kill a dead player. (may generate two corpses and cause crash) --HG-- branch : trunk --- src/game/Player.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/game/Player.cpp b/src/game/Player.cpp index e5c046034f4..5b5c859097f 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -1330,8 +1330,14 @@ void Player::setDeathState(DeathState s) bool cur = isAlive(); - if(s == JUST_DIED && cur) + if(s == JUST_DIED) { + if(!cur) + { + sLog.outError("setDeathState: attempt to kill a dead player %s(%d)", GetName(), GetGUIDLow()); + return; + } + // drunken state is cleared on death SetDrunkValue(0); // lost combo points at any target (targeted combo points clear in Unit::setDeathState) -- cgit v1.2.3 From b5d1418b0cdd38980ec1fec3af1ddf031c9cb9e5 Mon Sep 17 00:00:00 2001 From: megamage Date: Tue, 9 Dec 2008 20:28:59 -0600 Subject: *Allow unit has multiple controlling auras. (Fix the bug that unit cannot be feared if stunned. Hope this will not break all controlling spells) --HG-- branch : trunk --- src/game/SpellAuras.cpp | 102 +++--------------------- src/game/Unit.cpp | 202 ++++++++++++++++++++++++++++++++++++++++++++++-- src/game/Unit.h | 7 +- 3 files changed, 209 insertions(+), 102 deletions(-) (limited to 'src') diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 794a54f6788..cca1b80a53c 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -3040,7 +3040,8 @@ void Aura::HandleModConfuse(bool apply, bool Real) if(!Real) return; - m_target->SetConfused(apply, GetCasterGUID(), GetId()); + //m_target->SetConfused(apply, GetCasterGUID(), GetId()); + m_target->SetControlled(apply, UNIT_STAT_CONFUSED); } void Aura::HandleModFear(bool apply, bool Real) @@ -3048,7 +3049,8 @@ void Aura::HandleModFear(bool apply, bool Real) if (!Real) return; - m_target->SetFeared(apply, GetCasterGUID(), GetId()); + //m_target->SetFeared(apply, GetCasterGUID(), GetId()); + m_target->SetControlled(apply, UNIT_STAT_FLEEING); } void Aura::HandleFeignDeath(bool apply, bool Real) @@ -3146,46 +3148,7 @@ void Aura::HandleAuraModStun(bool apply, bool Real) if(!Real) return; - if (apply) - { - m_target->addUnitState(UNIT_STAT_STUNNED); - m_target->SetUInt64Value(UNIT_FIELD_TARGET, 0); - - m_target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_ROTATE); - m_target->CastStop(m_target->GetGUID() == GetCasterGUID() ? GetId() : 0); - - // Creature specific - if(m_target->GetTypeId() != TYPEID_PLAYER) - ((Creature*)m_target)->StopMoving(); - else - m_target->SetUnitMovementFlags(0); //Clear movement flags - - WorldPacket data(SMSG_FORCE_MOVE_ROOT, 8); - - data.append(m_target->GetPackGUID()); - data << uint32(0); - m_target->SendMessageToSet(&data,true); - } - else - { - // Real remove called after current aura remove from lists, check if other similar auras active - if(m_target->HasAuraType(SPELL_AURA_MOD_STUN)) - return; - - m_target->clearUnitState(UNIT_STAT_STUNNED); - m_target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_ROTATE); - - if(!m_target->hasUnitState(UNIT_STAT_ROOT)) // prevent allow move if have also root effect - { - if(m_target->getVictim() && m_target->isAlive()) - m_target->SetUInt64Value(UNIT_FIELD_TARGET,m_target->getVictim()->GetGUID() ); - - WorldPacket data(SMSG_FORCE_MOVE_UNROOT, 8+4); - data.append(m_target->GetPackGUID()); - data << uint32(0); - m_target->SendMessageToSet(&data,true); - } - } + m_target->SetControlled(apply, UNIT_STAT_STUNNED); } void Aura::HandleModStealth(bool apply, bool Real) @@ -3355,55 +3318,7 @@ void Aura::HandleAuraModRoot(bool apply, bool Real) if(!Real) return; - uint32 apply_stat = UNIT_STAT_ROOT; - if (apply) - { - m_target->addUnitState(UNIT_STAT_ROOT); - m_target->SetUInt64Value (UNIT_FIELD_TARGET, 0); - // probably wrong - m_target->SetFlag(UNIT_FIELD_FLAGS,(apply_stat<<16)); - - //Save last orientation - if( m_target->getVictim() ) - m_target->SetOrientation(m_target->GetAngle(m_target->getVictim())); - - if(m_target->GetTypeId() == TYPEID_PLAYER) - { - WorldPacket data(SMSG_FORCE_MOVE_ROOT, 10); - data.append(m_target->GetPackGUID()); - data << (uint32)2; - m_target->SendMessageToSet(&data,true); - - //Clear unit movement flags - m_target->SetUnitMovementFlags(0); - } - else - ((Creature *)m_target)->StopMoving(); - } - else - { - // Real remove called after current aura remove from lists, check if other similar auras active - if(m_target->HasAuraType(SPELL_AURA_MOD_ROOT)) - return; - - m_target->clearUnitState(UNIT_STAT_ROOT); - // probably wrong - m_target->RemoveFlag(UNIT_FIELD_FLAGS,(apply_stat<<16)); - - if(!m_target->hasUnitState(UNIT_STAT_STUNNED)) // prevent allow move if have also stun effect - { - if(m_target->getVictim() && m_target->isAlive()) - m_target->SetUInt64Value (UNIT_FIELD_TARGET,m_target->getVictim()->GetGUID() ); - - if(m_target->GetTypeId() == TYPEID_PLAYER) - { - WorldPacket data(SMSG_FORCE_MOVE_UNROOT, 10); - data.append(m_target->GetPackGUID()); - data << (uint32)2; - m_target->SendMessageToSet(&data,true); - } - } - } + m_target->SetControlled(apply, UNIT_STAT_ROOT); } void Aura::HandleAuraModSilence(bool apply, bool Real) @@ -6231,10 +6146,11 @@ void Aura::HandlePreventFleeing(bool apply, bool Real) Unit::AuraList const& fearAuras = m_target->GetAurasByType(SPELL_AURA_MOD_FEAR); if( !fearAuras.empty() ) { - if (apply) + m_target->SetControlled(!apply, UNIT_STAT_FLEEING); + /*if (apply) m_target->SetFeared(false, fearAuras.front()->GetCasterGUID()); else - m_target->SetFeared(true); + m_target->SetFeared(true);*/ } } diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 5c41ecaf9be..51fb5262855 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -9260,13 +9260,6 @@ bool Unit::IsImmunedToSpell(SpellEntry const* spellInfo, bool useCharges) if (!spellInfo) return false; - //FIX ME this hack: don't get feared if stunned - if (spellInfo->Mechanic == MECHANIC_FEAR ) - { - if ( hasUnitState(UNIT_STAT_STUNNED) ) - return true; - } - SpellImmuneList const& dispelList = m_spellImmune[IMMUNITY_DISPEL]; for(SpellImmuneList::const_iterator itr = dispelList.begin(); itr != dispelList.end(); ++itr) if(itr->type == spellInfo->Dispel) @@ -11844,6 +11837,7 @@ void Unit::StopMoving() SendMessageToSet(&data,false); } +/* void Unit::SetFeared(bool apply, uint64 casterGUID, uint32 spellID) { if( apply ) @@ -11912,6 +11906,7 @@ void Unit::SetConfused(bool apply, uint64 casterGUID, uint32 spellID) if(GetTypeId() == TYPEID_PLAYER) ((Player*)this)->SetClientControl(this, !apply); } +*/ bool Unit::IsSitState() const { @@ -12646,4 +12641,197 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss) bg->HandleKillUnit((Creature*)pVictim, player); } } +} + +void Unit::SetControlled(bool apply, UnitState state) +{ + if(apply) + { + if(hasUnitState(state)) + return; + + addUnitState(state); + + switch(state) + { + case UNIT_STAT_STUNNED: + SetStunned(true); + break; + case UNIT_STAT_ROOT: + if(!hasUnitState(UNIT_STAT_STUNNED)) + SetRooted(true); + break; + case UNIT_STAT_CONFUSED: + if(!hasUnitState(UNIT_STAT_STUNNED)) + SetConfused(true); + break; + case UNIT_STAT_FLEEING: + if(!hasUnitState(UNIT_STAT_STUNNED | UNIT_STAT_CONFUSED)) + SetFeared(true); + break; + default: + break; + } + } + else + { + switch(state) + { + case UNIT_STAT_STUNNED: if(HasAuraType(SPELL_AURA_MOD_STUN)) return; + else(SetStunned(false)); + case UNIT_STAT_ROOT: if(HasAuraType(SPELL_AURA_MOD_ROOT)) return; + else(SetRooted(false)); + case UNIT_STAT_CONFUSED:if(HasAuraType(SPELL_AURA_MOD_CONFUSE)) return; + else(SetConfused(false)); + case UNIT_STAT_FLEEING: if(HasAuraType(SPELL_AURA_MOD_FEAR)) return; + else(SetFeared(false)); + default: return; + } + + clearUnitState(state); + + if(hasUnitState(UNIT_STAT_STUNNED)) + SetStunned(true); + else + { + if(hasUnitState(UNIT_STAT_ROOT)) + SetRooted(true); + + if(hasUnitState(UNIT_STAT_CONFUSED)) + SetConfused(true); + else if(hasUnitState(UNIT_STAT_FLEEING)) + SetFeared(true); + } + } +} + +void Unit::SetStunned(bool apply) +{ + if(apply) + { + SetUInt64Value(UNIT_FIELD_TARGET, 0); + SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_ROTATE); + CastStop(); + + // Creature specific + if(GetTypeId() != TYPEID_PLAYER) + ((Creature*)this)->StopMoving(); + else + SetUnitMovementFlags(0); //Clear movement flags + + WorldPacket data(SMSG_FORCE_MOVE_ROOT, 8); + data.append(GetPackGUID()); + data << uint32(0); + SendMessageToSet(&data,true); + } + else + { + if(isAlive() && getVictim()) + SetUInt64Value(UNIT_FIELD_TARGET, getVictim()->GetGUID()); + RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_ROTATE); + + if(!hasUnitState(UNIT_STAT_ROOT)) // prevent allow move if have also root effect + { + WorldPacket data(SMSG_FORCE_MOVE_UNROOT, 8+4); + data.append(GetPackGUID()); + data << uint32(0); + SendMessageToSet(&data,true); + } + } +} + +void Unit::SetRooted(bool apply) +{ + uint32 apply_stat = UNIT_STAT_ROOT; + if(apply) + { + SetFlag(UNIT_FIELD_FLAGS,(apply_stat<<16)); // probably wrong + + if(GetTypeId() == TYPEID_PLAYER) + { + SetUnitMovementFlags(0); + + WorldPacket data(SMSG_FORCE_MOVE_ROOT, 10); + data.append(GetPackGUID()); + data << (uint32)2; + SendMessageToSet(&data,true); + } + else + ((Creature *)this)->StopMoving(); + } + else + { + RemoveFlag(UNIT_FIELD_FLAGS,(apply_stat<<16)); // probably wrong + + if(!hasUnitState(UNIT_STAT_STUNNED)) // prevent allow move if have also stun effect + { + if(GetTypeId() == TYPEID_PLAYER) + { + WorldPacket data(SMSG_FORCE_MOVE_UNROOT, 10); + data.append(GetPackGUID()); + data << (uint32)2; + SendMessageToSet(&data,true); + } + } + } +} + +void Unit::SetFeared(bool apply) +{ + if(apply) + { + if(HasAuraType(SPELL_AURA_PREVENTS_FLEEING)) + return; + + SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING); + CastStop(); + //GetMotionMaster()->MovementExpired(false); + Unit *caster = NULL; + Unit::AuraList const& fearAuras = GetAurasByType(SPELL_AURA_MOD_FEAR); + if(!fearAuras.empty()) + caster = ObjectAccessor::GetUnit(*this, fearAuras.front()->GetCasterGUID()); + GetMotionMaster()->MoveFleeing(caster); // caster==NULL processed in MoveFleeing + } + else + { + RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING); + GetMotionMaster()->MovementExpired(false); + if( GetTypeId() != TYPEID_PLAYER && isAlive() ) + { + // restore appropriate movement generator + if(getVictim()) + GetMotionMaster()->MoveChase(getVictim()); + else + GetMotionMaster()->Initialize(); + } + } + + if (GetTypeId() == TYPEID_PLAYER) + ((Player*)this)->SetClientControl(this, !apply); +} + +void Unit::SetConfused(bool apply) +{ + if(apply) + { + SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED); + CastStop(); + GetMotionMaster()->MoveConfused(); + } + else + { + RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED); + GetMotionMaster()->MovementExpired(false); + if( GetTypeId() != TYPEID_PLAYER && isAlive() ) + { + // restore appropriate movement generator + if(getVictim()) + GetMotionMaster()->MoveChase(getVictim()); + else + GetMotionMaster()->Initialize(); + } + } + + if(GetTypeId() == TYPEID_PLAYER) + ((Player*)this)->SetClientControl(this, !apply); } \ No newline at end of file diff --git a/src/game/Unit.h b/src/game/Unit.h index 121aea10091..9113ed7bae0 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1348,8 +1348,11 @@ class TRINITY_DLL_SPEC Unit : public WorldObject uint32 GetUnitMovementFlags() const { return m_unit_movement_flags; } void SetUnitMovementFlags(uint32 f) { m_unit_movement_flags = f; } - void SetFeared(bool apply, uint64 casterGUID = 0, uint32 spellID = 0); - void SetConfused(bool apply, uint64 casterGUID = 0, uint32 spellID = 0); + void SetControlled(bool apply, UnitState state); + void SetFeared(bool apply/*, uint64 casterGUID = 0, uint32 spellID = 0*/); + void SetConfused(bool apply/*, uint64 casterGUID = 0, uint32 spellID = 0*/); + void SetStunned(bool apply); + void SetRooted(bool apply); void AddComboPointHolder(uint32 lowguid) { m_ComboPointHolders.insert(lowguid); } void RemoveComboPointHolder(uint32 lowguid) { m_ComboPointHolders.erase(lowguid); } -- cgit v1.2.3 From cc0838459a86e45ccdbaa4977e20f4233f1ff1c1 Mon Sep 17 00:00:00 2001 From: "MeanMachine@MeanMachine-PC" Date: Wed, 10 Dec 2008 06:34:35 +0200 Subject: Featuring a rewritten waypoint movement with more options, optimised code and revamped ingame waypoint control. To convert entries from the old tables manually, please use the PHP script provided at http://www.trinitycore.org/forum/project.php?issueid=830 --HG-- branch : trunk --- sql/updates/444_world.sql | 36 + sql/world.sql | 6573 ++++++++++++++++---------------- src/game/Chat.cpp | 30 +- src/game/Chat.h | 18 +- src/game/Creature.cpp | 4 + src/game/Creature.h | 18 +- src/game/Level2.cpp | 2277 ++++++----- src/game/Level3.cpp | 27 +- src/game/MotionMaster.cpp | 25 + src/game/MotionMaster.h | 1 + src/game/MovementGeneratorImpl.h | 3 +- src/game/ObjectMgr.cpp | 16 +- src/game/ObjectMgr.h | 2 + src/game/RandomMovementGenerator.h | 2 +- src/game/WaypointManager.cpp | 494 +-- src/game/WaypointManager.h | 154 +- src/game/WaypointMovementGenerator.cpp | 1282 +++---- src/game/WaypointMovementGenerator.h | 258 +- src/game/World.cpp | 30 +- src/game/World.h | 1 + src/shared/Database/SQLStorage.cpp | 4 +- 21 files changed, 5566 insertions(+), 5689 deletions(-) create mode 100644 sql/updates/444_world.sql (limited to 'src') diff --git a/sql/updates/444_world.sql b/sql/updates/444_world.sql new file mode 100644 index 00000000000..ef9784e3666 --- /dev/null +++ b/sql/updates/444_world.sql @@ -0,0 +1,36 @@ +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; + +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; + +ALTER TABLE `creature_addon` + ADD `path_id` int(11) unsigned NOT NULL default '0' AFTER `guid`; +ALTER TABLE `creature_template_addon` + ADD `path_id` int(11) unsigned NOT NULL default '0' AFTER `entry`; diff --git a/sql/world.sql b/sql/world.sql index 01c94db3ce6..3e8963f4ae9 100644 --- a/sql/world.sql +++ b/sql/world.sql @@ -1,3274 +1,3299 @@ --- MySQL dump 10.11 --- --- Host: localhost Database: world --- ------------------------------------------------------ --- Server version 5.0.34-log - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; -/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; -/*!40103 SET TIME_ZONE='+00:00' */; -/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; - --- --- Table structure for table `areatrigger_involvedrelation` --- - -DROP TABLE IF EXISTS `areatrigger_involvedrelation`; -CREATE TABLE `areatrigger_involvedrelation` ( - `id` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Identifier', - `quest` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Quest Identifier', - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Trigger System'; - --- --- Dumping data for table `areatrigger_involvedrelation` --- - -LOCK TABLES `areatrigger_involvedrelation` WRITE; -/*!40000 ALTER TABLE `areatrigger_involvedrelation` DISABLE KEYS */; -/*!40000 ALTER TABLE `areatrigger_involvedrelation` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `areatrigger_scripts` --- - -DROP TABLE IF EXISTS `areatrigger_scripts`; -CREATE TABLE `areatrigger_scripts` ( - `entry` mediumint(8) NOT NULL, - `ScriptName` char(64) NOT NULL, - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `areatrigger_scripts` --- - -LOCK TABLES `areatrigger_scripts` WRITE; -/*!40000 ALTER TABLE `areatrigger_scripts` DISABLE KEYS */; -/*!40000 ALTER TABLE `areatrigger_scripts` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `areatrigger_tavern` --- - -DROP TABLE IF EXISTS `areatrigger_tavern`; -CREATE TABLE `areatrigger_tavern` ( - `id` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Identifier', - `name` text, - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Trigger System'; - --- --- Dumping data for table `areatrigger_tavern` --- - -LOCK TABLES `areatrigger_tavern` WRITE; -/*!40000 ALTER TABLE `areatrigger_tavern` DISABLE KEYS */; -/*!40000 ALTER TABLE `areatrigger_tavern` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `areatrigger_teleport` --- - -DROP TABLE IF EXISTS `areatrigger_teleport`; -CREATE TABLE `areatrigger_teleport` ( - `id` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Identifier', - `name` text, - `required_level` tinyint(3) unsigned NOT NULL default '0', - `required_item` mediumint(8) unsigned NOT NULL default '0', - `required_item2` mediumint(8) unsigned NOT NULL default '0', - `heroic_key` mediumint(8) unsigned NOT NULL default '0', - `heroic_key2` mediumint(8) unsigned NOT NULL default '0', - `required_quest_done` int(11) unsigned NOT NULL default '0', - `required_failed_text` text, - `target_map` smallint(5) unsigned NOT NULL default '0', - `target_position_x` float NOT NULL default '0', - `target_position_y` float NOT NULL default '0', - `target_position_z` float NOT NULL default '0', - `target_orientation` float NOT NULL default '0', - PRIMARY KEY (`id`), - FULLTEXT KEY `name` (`name`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Trigger System'; - --- --- Dumping data for table `areatrigger_teleport` --- - -LOCK TABLES `areatrigger_teleport` WRITE; -/*!40000 ALTER TABLE `areatrigger_teleport` DISABLE KEYS */; -/*!40000 ALTER TABLE `areatrigger_teleport` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `battleground_template` --- - -DROP TABLE IF EXISTS `battleground_template`; -CREATE TABLE `battleground_template` ( - `id` mediumint(8) unsigned NOT NULL, - `MinPlayersPerTeam` smallint(5) unsigned NOT NULL default '0', - `MaxPlayersPerTeam` smallint(5) unsigned NOT NULL default '0', - `MinLvl` tinyint(3) unsigned NOT NULL default '0', - `MaxLvl` tinyint(3) unsigned NOT NULL default '0', - `AllianceStartLoc` mediumint(8) unsigned NOT NULL, - `AllianceStartO` float NOT NULL, - `HordeStartLoc` mediumint(8) unsigned NOT NULL, - `HordeStartO` float NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `battleground_template` --- - -LOCK TABLES `battleground_template` WRITE; -/*!40000 ALTER TABLE `battleground_template` DISABLE KEYS */; -/*!40000 ALTER TABLE `battleground_template` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `battlemaster_entry` --- - -DROP TABLE IF EXISTS `battlemaster_entry`; -CREATE TABLE `battlemaster_entry` ( - `entry` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Entry of a creature', - `bg_template` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Battleground template id', - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `battlemaster_entry` --- - -LOCK TABLES `battlemaster_entry` WRITE; -/*!40000 ALTER TABLE `battlemaster_entry` DISABLE KEYS */; -/*!40000 ALTER TABLE `battlemaster_entry` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `command` --- - -DROP TABLE IF EXISTS `command`; -CREATE TABLE `command` ( - `name` varchar(50) NOT NULL default '', - `security` tinyint(3) unsigned NOT NULL default '0', - `help` longtext, - PRIMARY KEY (`name`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Chat System'; - --- --- Dumping data for table `command` --- - -LOCK TABLES `command` WRITE; -/*!40000 ALTER TABLE `command` DISABLE KEYS */; -/*!40000 ALTER TABLE `command` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `creature` --- - -DROP TABLE IF EXISTS `creature`; -CREATE TABLE `creature` ( - `guid` int(10) unsigned NOT NULL auto_increment COMMENT 'Global Unique Identifier', - `id` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Creature Identifier', - `map` smallint(5) unsigned NOT NULL default '0' COMMENT 'Map Identifier', - `spawnMask` tinyint(3) unsigned NOT NULL default '1', - `modelid` mediumint(8) unsigned NOT NULL default '0', - `equipment_id` mediumint(9) 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', - `orientation` float NOT NULL default '0', - `spawntimesecs` int(10) unsigned NOT NULL default '120', - `spawndist` float NOT NULL default '5', - `currentwaypoint` mediumint(8) unsigned NOT NULL default '0', - `curhealth` int(10) unsigned NOT NULL default '1', - `curmana` int(10) unsigned NOT NULL default '0', - `DeathState` tinyint(3) unsigned NOT NULL default '0', - `MovementType` tinyint(3) unsigned NOT NULL default '0', - PRIMARY KEY (`guid`), - KEY `idx_map` (`map`), - KEY `idx_id` (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Creature System'; - --- --- Dumping data for table `creature` --- - -LOCK TABLES `creature` WRITE; -/*!40000 ALTER TABLE `creature` DISABLE KEYS */; -/*!40000 ALTER TABLE `creature` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `creature_addon` --- - -DROP TABLE IF EXISTS `creature_addon`; -CREATE TABLE `creature_addon` ( - `guid` int(10) unsigned NOT NULL default '0', - `mount` mediumint(8) unsigned NOT NULL default '0', - `bytes0` int(10) unsigned NOT NULL default '0', - `bytes1` int(10) unsigned NOT NULL default '0', - `bytes2` int(10) unsigned NOT NULL default '0', - `emote` int(10) unsigned NOT NULL default '0', - `moveflags` int(10) unsigned NOT NULL default '0', - `auras` text, - PRIMARY KEY (`guid`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - --- --- Dumping data for table `creature_addon` --- - -LOCK TABLES `creature_addon` WRITE; -/*!40000 ALTER TABLE `creature_addon` DISABLE KEYS */; -/*!40000 ALTER TABLE `creature_addon` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `creature_equip_template` --- - -DROP TABLE IF EXISTS `creature_equip_template`; -CREATE TABLE `creature_equip_template` ( - `entry` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Unique entry', - `equipmodel1` mediumint(8) unsigned NOT NULL default '0', - `equipmodel2` mediumint(8) unsigned NOT NULL default '0', - `equipmodel3` mediumint(8) unsigned NOT NULL default '0', - `equipinfo1` int(10) unsigned NOT NULL default '0', - `equipinfo2` int(10) unsigned NOT NULL default '0', - `equipinfo3` int(10) unsigned NOT NULL default '0', - `equipslot1` int(11) NOT NULL default '0', - `equipslot2` int(11) NOT NULL default '0', - `equipslot3` int(11) NOT NULL default '0', - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Creature System (Equipment)'; - --- --- Dumping data for table `creature_equip_template` --- - -LOCK TABLES `creature_equip_template` WRITE; -/*!40000 ALTER TABLE `creature_equip_template` DISABLE KEYS */; -/*!40000 ALTER TABLE `creature_equip_template` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `creature_involvedrelation` --- - -DROP TABLE IF EXISTS `creature_involvedrelation`; -CREATE TABLE `creature_involvedrelation` ( - `id` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Identifier', - `quest` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Quest Identifier', - PRIMARY KEY (`id`,`quest`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Creature System'; - --- --- Dumping data for table `creature_involvedrelation` --- - -LOCK TABLES `creature_involvedrelation` WRITE; -/*!40000 ALTER TABLE `creature_involvedrelation` DISABLE KEYS */; -/*!40000 ALTER TABLE `creature_involvedrelation` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `creature_loot_template` --- - -DROP TABLE IF EXISTS `creature_loot_template`; -CREATE TABLE `creature_loot_template` ( - `entry` mediumint(8) unsigned NOT NULL default '0', - `item` mediumint(8) unsigned NOT NULL default '0', - `ChanceOrQuestChance` float NOT NULL default '100', - `groupid` tinyint(3) unsigned NOT NULL default '0', - `mincountOrRef` mediumint(9) NOT NULL default '1', - `maxcount` tinyint(3) unsigned NOT NULL default '1', - `lootcondition` tinyint(3) unsigned NOT NULL default '0', - `condition_value1` mediumint(8) unsigned NOT NULL default '0', - `condition_value2` mediumint(8) unsigned NOT NULL default '0', - PRIMARY KEY (`entry`,`item`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Loot System'; - --- --- Dumping data for table `creature_loot_template` --- - -LOCK TABLES `creature_loot_template` WRITE; -/*!40000 ALTER TABLE `creature_loot_template` DISABLE KEYS */; -/*!40000 ALTER TABLE `creature_loot_template` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `creature_model_info` --- - -DROP TABLE IF EXISTS `creature_model_info`; -CREATE TABLE `creature_model_info` ( - `modelid` mediumint(8) unsigned NOT NULL default '0', - `bounding_radius` float NOT NULL default '0', - `combat_reach` float NOT NULL default '0', - `gender` tinyint(3) unsigned NOT NULL default '2', - `modelid_other_gender` mediumint(8) unsigned NOT NULL default '0', - PRIMARY KEY (`modelid`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Creature System (Model related info)'; - --- --- Dumping data for table `creature_model_info` --- - -LOCK TABLES `creature_model_info` WRITE; -/*!40000 ALTER TABLE `creature_model_info` DISABLE KEYS */; -/*!40000 ALTER TABLE `creature_model_info` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `creature_movement` --- - -DROP TABLE IF EXISTS `creature_movement`; -CREATE TABLE `creature_movement` ( - `id` int(10) unsigned NOT NULL 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', - `waittime` int(10) unsigned NOT NULL default '0', - `text1` text, - `text2` text, - `text3` text, - `text4` text, - `text5` text, - `emote` mediumint(8) unsigned NOT NULL default '0', - `spell` mediumint(8) unsigned NOT NULL default '0', - `wpguid` int(11) NOT NULL default '0', - `orientation` float NOT NULL default '0', - `model1` mediumint(9) NOT NULL default '0', - `model2` mediumint(9) NOT NULL default '0', - PRIMARY KEY (`id`,`point`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Creature System'; - --- --- Dumping data for table `creature_movement` --- - -LOCK TABLES `creature_movement` WRITE; -/*!40000 ALTER TABLE `creature_movement` DISABLE KEYS */; -/*!40000 ALTER TABLE `creature_movement` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `creature_onkill_reputation` --- - -DROP TABLE IF EXISTS `creature_onkill_reputation`; -CREATE TABLE `creature_onkill_reputation` ( - `creature_id` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Creature Identifier', - `RewOnKillRepFaction1` smallint(6) NOT NULL default '0', - `RewOnKillRepFaction2` smallint(6) NOT NULL default '0', - `MaxStanding1` tinyint(4) NOT NULL default '0', - `IsTeamAward1` tinyint(4) NOT NULL default '0', - `RewOnKillRepValue1` mediumint(9) NOT NULL default '0', - `MaxStanding2` tinyint(4) NOT NULL default '0', - `IsTeamAward2` tinyint(4) NOT NULL default '0', - `RewOnKillRepValue2` mediumint(9) NOT NULL default '0', - `TeamDependent` tinyint(3) unsigned NOT NULL default '0', - PRIMARY KEY (`creature_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Creature OnKill Reputation gain'; - --- --- Dumping data for table `creature_onkill_reputation` --- - -LOCK TABLES `creature_onkill_reputation` WRITE; -/*!40000 ALTER TABLE `creature_onkill_reputation` DISABLE KEYS */; -/*!40000 ALTER TABLE `creature_onkill_reputation` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `creature_questrelation` --- - -DROP TABLE IF EXISTS `creature_questrelation`; -CREATE TABLE `creature_questrelation` ( - `id` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Identifier', - `quest` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Quest Identifier', - PRIMARY KEY (`id`,`quest`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Creature System'; - --- --- Dumping data for table `creature_questrelation` --- - -LOCK TABLES `creature_questrelation` WRITE; -/*!40000 ALTER TABLE `creature_questrelation` DISABLE KEYS */; -/*!40000 ALTER TABLE `creature_questrelation` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `creature_respawn` --- - -DROP TABLE IF EXISTS `creature_respawn`; -CREATE TABLE `creature_respawn` ( - `guid` int(10) unsigned NOT NULL default '0' COMMENT 'Global Unique Identifier', - `respawntime` bigint(20) NOT NULL default '0', - `instance` mediumint(8) unsigned NOT NULL default '0', - PRIMARY KEY (`guid`,`instance`), - KEY `instance` (`instance`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Grid Loading System'; - --- --- Dumping data for table `creature_respawn` --- - -LOCK TABLES `creature_respawn` WRITE; -/*!40000 ALTER TABLE `creature_respawn` DISABLE KEYS */; -/*!40000 ALTER TABLE `creature_respawn` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `creature_template` --- - -DROP TABLE IF EXISTS `creature_template`; -CREATE TABLE `creature_template` ( - `entry` mediumint(8) unsigned NOT NULL default '0', - `heroic_entry` mediumint(8) unsigned NOT NULL default '0', - `modelid_A` mediumint(8) unsigned NOT NULL default '0', - `modelid_A2` mediumint(8) unsigned NOT NULL default '0', - `modelid_H` mediumint(8) unsigned NOT NULL default '0', - `modelid_H2` mediumint(8) unsigned NOT NULL default '0', - `name` char(100) NOT NULL default '0', - `subname` char(100) default NULL, - `IconName` char(100) default NULL, - `minlevel` tinyint(3) unsigned NOT NULL default '1', - `maxlevel` tinyint(3) unsigned NOT NULL default '1', - `minhealth` int(10) unsigned NOT NULL default '0', - `maxhealth` int(10) unsigned NOT NULL default '0', - `minmana` int(10) unsigned NOT NULL default '0', - `maxmana` int(10) unsigned NOT NULL default '0', - `armor` mediumint(8) unsigned NOT NULL default '0', - `faction_A` smallint(5) unsigned NOT NULL default '0', - `faction_H` smallint(5) unsigned NOT NULL default '0', - `npcflag` int(10) unsigned NOT NULL default '0', - `speed` float default '1', - `scale` float NOT NULL default '1', - `rank` tinyint(3) unsigned NOT NULL default '0', - `mindmg` float NOT NULL default '0', - `maxdmg` float NOT NULL default '0', - `dmgschool` tinyint(4) NOT NULL default '0', - `attackpower` int(10) unsigned NOT NULL default '0', - `baseattacktime` int(10) unsigned NOT NULL default '0', - `rangeattacktime` int(10) unsigned NOT NULL default '0', - `flags` int(10) unsigned NOT NULL default '0', - `dynamicflags` int(10) unsigned NOT NULL default '0', - `family` tinyint(4) NOT NULL default '0', - `trainer_type` tinyint(4) NOT NULL default '0', - `trainer_spell` mediumint(8) unsigned NOT NULL default '0', - `class` tinyint(3) unsigned NOT NULL default '0', - `race` tinyint(3) unsigned NOT NULL default '0', - `minrangedmg` float NOT NULL default '0', - `maxrangedmg` float NOT NULL default '0', - `rangedattackpower` smallint(5) unsigned NOT NULL default '0', - `type` tinyint(3) unsigned NOT NULL default '0', - `flag1` int(10) unsigned NOT NULL default '0', - `lootid` mediumint(8) unsigned NOT NULL default '0', - `pickpocketloot` mediumint(8) unsigned NOT NULL default '0', - `skinloot` mediumint(8) unsigned NOT NULL default '0', - `resistance1` smallint(5) NOT NULL default '0', - `resistance2` smallint(5) NOT NULL default '0', - `resistance3` smallint(5) NOT NULL default '0', - `resistance4` smallint(5) NOT NULL default '0', - `resistance5` smallint(5) NOT NULL default '0', - `resistance6` smallint(5) NOT NULL default '0', - `spell1` mediumint(8) unsigned NOT NULL default '0', - `spell2` mediumint(8) unsigned NOT NULL default '0', - `spell3` mediumint(8) unsigned NOT NULL default '0', - `spell4` mediumint(8) unsigned NOT NULL default '0', - `PetSpellDataId` mediumint(8) unsigned NOT NULL default '0', - `mingold` mediumint(8) unsigned NOT NULL default '0', - `maxgold` mediumint(8) unsigned NOT NULL default '0', - `AIName` char(64) NOT NULL default '', - `MovementType` tinyint(3) unsigned NOT NULL default '0', - `InhabitType` tinyint(3) unsigned NOT NULL default '3', - `RacialLeader` tinyint(3) unsigned NOT NULL default '0', - `RegenHealth` tinyint(3) unsigned NOT NULL default '1', - `equipment_id` mediumint(8) unsigned NOT NULL default '0', - `mechanic_immune_mask` int(10) unsigned NOT NULL default '0', - `flags_extra` int(10) unsigned NOT NULL default '0', - `ScriptName` char(64) NOT NULL default '', - PRIMARY KEY (`entry`), - KEY `idx_name` (`name`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Creature System'; - --- --- Dumping data for table `creature_template` --- - -LOCK TABLES `creature_template` WRITE; -/*!40000 ALTER TABLE `creature_template` DISABLE KEYS */; -/*!40000 ALTER TABLE `creature_template` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `creature_template_addon` --- - -DROP TABLE IF EXISTS `creature_template_addon`; -CREATE TABLE `creature_template_addon` ( - `entry` mediumint(8) unsigned NOT NULL default '0', - `mount` mediumint(8) unsigned NOT NULL default '0', - `bytes0` int(10) unsigned NOT NULL default '0', - `bytes1` int(10) unsigned NOT NULL default '0', - `bytes2` int(10) unsigned NOT NULL default '0', - `emote` mediumint(8) unsigned NOT NULL default '0', - `moveflags` int(10) unsigned NOT NULL default '0', - `auras` text, - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `creature_template_addon` --- - -LOCK TABLES `creature_template_addon` WRITE; -/*!40000 ALTER TABLE `creature_template_addon` DISABLE KEYS */; -/*!40000 ALTER TABLE `creature_template_addon` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `custom_texts` --- - -DROP TABLE IF EXISTS `custom_texts`; -CREATE TABLE `custom_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='Custom Texts'; - --- --- Dumping data for table `custom_texts` --- - -LOCK TABLES `custom_texts` WRITE; -/*!40000 ALTER TABLE `custom_texts` DISABLE KEYS */; -/*!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` --- - -DROP TABLE IF EXISTS `disenchant_loot_template`; -CREATE TABLE `disenchant_loot_template` ( - `entry` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Recommended id selection: item_level*100 + item_quality', - `item` mediumint(8) unsigned NOT NULL default '0', - `ChanceOrQuestChance` float NOT NULL default '100', - `groupid` tinyint(3) unsigned NOT NULL default '0', - `mincountOrRef` mediumint(9) NOT NULL default '1', - `maxcount` tinyint(3) unsigned NOT NULL default '1', - `lootcondition` tinyint(3) unsigned NOT NULL default '0', - `condition_value1` mediumint(8) unsigned NOT NULL default '0', - `condition_value2` mediumint(8) unsigned NOT NULL default '0', - PRIMARY KEY (`entry`,`item`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System'; - --- --- Dumping data for table `disenchant_loot_template` --- - -LOCK TABLES `disenchant_loot_template` WRITE; -/*!40000 ALTER TABLE `disenchant_loot_template` DISABLE KEYS */; -/*!40000 ALTER TABLE `disenchant_loot_template` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `event_scripts` --- - -DROP TABLE IF EXISTS `event_scripts`; -CREATE TABLE `event_scripts` ( - `id` mediumint(8) unsigned NOT NULL default '0', - `delay` int(10) unsigned NOT NULL default '0', - `command` mediumint(8) unsigned NOT NULL default '0', - `datalong` mediumint(8) unsigned NOT NULL default '0', - `datalong2` int(10) unsigned NOT NULL default '0', - `datatext` text NOT NULL, - `x` float NOT NULL default '0', - `y` float NOT NULL default '0', - `z` float NOT NULL default '0', - `o` float NOT NULL default '0' -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `event_scripts` --- - -LOCK TABLES `event_scripts` WRITE; -/*!40000 ALTER TABLE `event_scripts` DISABLE KEYS */; -/*!40000 ALTER TABLE `event_scripts` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `eventai_localized_texts` --- - -DROP TABLE IF EXISTS `eventai_localized_texts`; -CREATE TABLE `eventai_localized_texts` ( - `id` int(11) unsigned NOT NULL auto_increment COMMENT 'Identifier', - `locale_1` varchar(255) NOT NULL default '', - `locale_2` varchar(255) NOT NULL default '', - `locale_3` varchar(255) NOT NULL default '', - `locale_4` varchar(255) NOT NULL default '', - `locale_5` varchar(255) NOT NULL default '', - `locale_6` varchar(255) NOT NULL default '', - `locale_7` varchar(255) NOT NULL default '', - `locale_8` varchar(255) NOT NULL default '', - `comment` varchar(255) NOT NULL default '' COMMENT 'Text Comment', - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='EventAI Localized Text'; - --- --- Dumping data for table `eventai_localized_texts` --- - -LOCK TABLES `eventai_localized_texts` WRITE; -/*!40000 ALTER TABLE `eventai_localized_texts` DISABLE KEYS */; -/*!40000 ALTER TABLE `eventai_localized_texts` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `eventai_scripts` --- - -DROP TABLE IF EXISTS `eventai_scripts`; -CREATE TABLE `eventai_scripts` ( - `id` int(11) unsigned NOT NULL COMMENT 'Identifier' AUTO_INCREMENT, - `creature_id` int(11) unsigned NOT NULL default '0' COMMENT 'Creature Template Identifier', - `event_type` tinyint(5) unsigned NOT NULL default '0' COMMENT 'Event Type', - `event_inverse_phase_mask` int(11) signed NOT NULL default '0' COMMENT 'Mask which phases this event will not trigger in', - `event_chance` int(3) unsigned NOT NULL default '100', - `event_flags` int(3) unsigned NOT NULL default '0', - `event_param1` int(11) signed NOT NULL default '0', - `event_param2` int(11) signed NOT NULL default '0', - `event_param3` int(11) signed NOT NULL default '0', - `event_param4` int(11) signed NOT NULL default '0', - `action1_type` tinyint(5) unsigned NOT NULL default '0' COMMENT 'Action Type', - `action1_param1` int(11) signed NOT NULL default '0', - `action1_param2` int(11) signed NOT NULL default '0', - `action1_param3` int(11) signed NOT NULL default '0', - `action2_type` tinyint(5) unsigned NOT NULL default '0' COMMENT 'Action Type', - `action2_param1` int(11) signed NOT NULL default '0', - `action2_param2` int(11) signed NOT NULL default '0', - `action2_param3` int(11) signed NOT NULL default '0', - `action3_type` tinyint(5) unsigned NOT NULL default '0' COMMENT 'Action Type', - `action3_param1` int(11) signed NOT NULL default '0', - `action3_param2` int(11) signed NOT NULL default '0', - `action3_param3` int(11) signed NOT NULL default '0', - `comment` varchar(255) NOT NULL default '' COMMENT 'Event Comment', - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='EventAI Scripts'; - --- --- Dumping data for table `eventai_scripts` --- - -LOCK TABLES `eventai_scripts` WRITE; -/*!40000 ALTER TABLE `eventai_scripts` DISABLE KEYS */; -/*!40000 ALTER TABLE `eventai_scripts` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `eventai_summons` --- - -DROP TABLE IF EXISTS `eventai_summons`; -CREATE TABLE `eventai_summons` ( - `id` int(11) unsigned NOT NULL COMMENT 'Location Identifier' AUTO_INCREMENT, - `position_x` float NOT NULL default '0', - `position_y` float NOT NULL default '0', - `position_z` float NOT NULL default '0', - `orientation` float NOT NULL default '0', - `spawntimesecs` int(11) unsigned NOT NULL default '120', - `comment` varchar(255) NOT NULL default '' COMMENT 'Summon Comment', - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='EventAI Summoning Locations'; - --- --- Dumping data for table `eventai_summons` --- - -LOCK TABLES `eventai_summons` WRITE; -/*!40000 ALTER TABLE `eventai_summons` DISABLE KEYS */; -/*!40000 ALTER TABLE `eventai_summons` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `eventai_texts` --- - -DROP TABLE IF EXISTS `eventai_texts`; -CREATE TABLE `eventai_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 `eventai_texts` --- - -LOCK TABLES `eventai_texts` WRITE; -/*!40000 ALTER TABLE `eventai_texts` DISABLE KEYS */; -/*!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` --- - -DROP TABLE IF EXISTS `exploration_basexp`; -CREATE TABLE `exploration_basexp` ( - `level` tinyint(4) NOT NULL default '0', - `basexp` mediumint(9) NOT NULL default '0', - PRIMARY KEY (`level`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Exploration System'; - --- --- Dumping data for table `exploration_basexp` --- - -LOCK TABLES `exploration_basexp` WRITE; -/*!40000 ALTER TABLE `exploration_basexp` DISABLE KEYS */; -/*!40000 ALTER TABLE `exploration_basexp` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `fishing_loot_template` --- - -DROP TABLE IF EXISTS `fishing_loot_template`; -CREATE TABLE `fishing_loot_template` ( - `entry` mediumint(8) unsigned NOT NULL default '0', - `item` mediumint(8) unsigned NOT NULL default '0', - `ChanceOrQuestChance` float NOT NULL default '100', - `groupid` tinyint(3) unsigned NOT NULL default '0', - `mincountOrRef` mediumint(9) NOT NULL default '1', - `maxcount` tinyint(3) unsigned NOT NULL default '1', - `lootcondition` tinyint(3) unsigned NOT NULL default '0', - `condition_value1` mediumint(8) unsigned NOT NULL default '0', - `condition_value2` mediumint(8) unsigned NOT NULL default '0', - PRIMARY KEY (`entry`,`item`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Loot System'; - --- --- Dumping data for table `fishing_loot_template` --- - -LOCK TABLES `fishing_loot_template` WRITE; -/*!40000 ALTER TABLE `fishing_loot_template` DISABLE KEYS */; -/*!40000 ALTER TABLE `fishing_loot_template` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `game_event` --- - -DROP TABLE IF EXISTS `game_event`; -CREATE TABLE `game_event` ( - `entry` mediumint(8) unsigned NOT NULL COMMENT 'Entry of the game event', - `start_time` timestamp NOT NULL default '0000-00-00 00:00:00' COMMENT 'Absolute start date, the event will never start before', - `end_time` timestamp NOT NULL default '0000-00-00 00:00:00' COMMENT 'Absolute end date, the event will never start afler', - `occurence` bigint(20) unsigned NOT NULL default '5184000' COMMENT 'Delay in minutes between occurences of the event', - `length` bigint(20) unsigned NOT NULL default '2592000' COMMENT 'Length in minutes of the event', - `description` varchar(255) default NULL COMMENT 'Description of the event displayed in console', - `world_event` tinyint(3) unsigned NOT NULL default '0' COMMENT '0 if normal event, 1 if world event', - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `game_event` --- - -LOCK TABLES `game_event` WRITE; -/*!40000 ALTER TABLE `game_event` DISABLE KEYS */; -/*!40000 ALTER TABLE `game_event` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `game_event_condition` --- - -DROP TABLE IF EXISTS `game_event_condition`; -CREATE TABLE `game_event_condition` ( - `event_id` mediumint(8) unsigned NOT NULL default '0', - `condition_id` mediumint(8) unsigned NOT NULL default '0', - `req_num` float default '0', - `max_world_state_field` smallint(5) unsigned NOT NULL default '0', - `done_world_state_field` smallint(5) unsigned NOT NULL default '0', - `description` varchar(25) NOT NULL default '', - PRIMARY KEY (`event_id`,`condition_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `game_event_condition` --- - -LOCK TABLES `game_event_condition` WRITE; -/*!40000 ALTER TABLE `game_event_condition` DISABLE KEYS */; -/*!40000 ALTER TABLE `game_event_condition` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `game_event_creature` --- - -DROP TABLE IF EXISTS `game_event_creature`; -CREATE TABLE `game_event_creature` ( - `guid` int(10) unsigned NOT NULL, - `event` smallint(6) NOT NULL default '0' COMMENT 'Put negatives values to remove during event', - PRIMARY KEY (`guid`,`event`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `game_event_creature` --- - -LOCK TABLES `game_event_creature` WRITE; -/*!40000 ALTER TABLE `game_event_creature` DISABLE KEYS */; -/*!40000 ALTER TABLE `game_event_creature` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `game_event_creature_quest` --- - -DROP TABLE IF EXISTS `game_event_creature_quest`; -CREATE TABLE `game_event_creature_quest` ( - `id` mediumint(8) unsigned NOT NULL default '0', - `quest` mediumint(8) unsigned NOT NULL default '0', - `event` smallint(5) unsigned NOT NULL default '0', - PRIMARY KEY (`quest`,`event`,`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `game_event_creature_quest` --- - -LOCK TABLES `game_event_creature_quest` WRITE; -/*!40000 ALTER TABLE `game_event_creature_quest` DISABLE KEYS */; -/*!40000 ALTER TABLE `game_event_creature_quest` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `game_event_gameobject` --- - -DROP TABLE IF EXISTS `game_event_gameobject`; -CREATE TABLE `game_event_gameobject` ( - `guid` int(10) unsigned NOT NULL, - `event` smallint(6) NOT NULL default '0' COMMENT 'Put negatives values to remove during event', - PRIMARY KEY (`guid`,`event`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `game_event_gameobject` --- - -LOCK TABLES `game_event_gameobject` WRITE; -/*!40000 ALTER TABLE `game_event_gameobject` DISABLE KEYS */; -/*!40000 ALTER TABLE `game_event_gameobject` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `game_event_gameobject_quest` --- - -DROP TABLE IF EXISTS `game_event_gameobject_quest`; -CREATE TABLE `game_event_gameobject_quest` ( - `id` mediumint(8) unsigned NOT NULL default '0', - `quest` mediumint(8) unsigned NOT NULL default '0', - `event` smallint(5) unsigned NOT NULL default '0', - PRIMARY KEY (`quest`,`event`,`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `game_event_gameobject_quest` --- - -LOCK TABLES `game_event_gameobject_quest` WRITE; -/*!40000 ALTER TABLE `game_event_gameobject_quest` DISABLE KEYS */; -/*!40000 ALTER TABLE `game_event_gameobject_quest` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `game_event_model_equip` --- - -DROP TABLE IF EXISTS `game_event_model_equip`; -CREATE TABLE `game_event_model_equip` ( - `guid` int(10) unsigned NOT NULL default '0', - `modelid` mediumint(8) unsigned NOT NULL default '0', - `equipment_id` mediumint(8) unsigned NOT NULL default '0', - `event` smallint(5) unsigned NOT NULL default '0', - PRIMARY KEY (`guid`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `game_event_model_equip` --- - -LOCK TABLES `game_event_model_equip` WRITE; -/*!40000 ALTER TABLE `game_event_model_equip` DISABLE KEYS */; -/*!40000 ALTER TABLE `game_event_model_equip` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `game_event_npc_gossip` --- - -DROP TABLE IF EXISTS `game_event_npc_gossip`; -CREATE TABLE `game_event_npc_gossip` ( - `guid` int(10) unsigned NOT NULL, - `event_id` mediumint(8) unsigned NOT NULL default '0', - `textid` mediumint(8) unsigned NOT NULL default '0', - PRIMARY KEY (`guid`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `game_event_npc_gossip` --- - -LOCK TABLES `game_event_npc_gossip` WRITE; -/*!40000 ALTER TABLE `game_event_npc_gossip` DISABLE KEYS */; -/*!40000 ALTER TABLE `game_event_npc_gossip` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `game_event_npc_vendor` --- - -DROP TABLE IF EXISTS `game_event_npc_vendor`; -CREATE TABLE `game_event_npc_vendor` ( - `event` mediumint(8) unsigned NOT NULL default '0', - `guid` mediumint(8) unsigned NOT NULL default '0', - `item` mediumint(8) unsigned NOT NULL default '0', - `maxcount` mediumint(8) unsigned NOT NULL default '0', - `incrtime` mediumint(8) unsigned NOT NULL default '0', - `ExtendedCost` mediumint(8) unsigned NOT NULL default '0', - PRIMARY KEY (`guid`,`item`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `game_event_npc_vendor` --- - -LOCK TABLES `game_event_npc_vendor` WRITE; -/*!40000 ALTER TABLE `game_event_npc_vendor` DISABLE KEYS */; -/*!40000 ALTER TABLE `game_event_npc_vendor` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `game_event_npcflag` --- - -DROP TABLE IF EXISTS `game_event_npcflag`; -CREATE TABLE `game_event_npcflag` ( - `guid` mediumint(8) unsigned NOT NULL default '0', - `event_id` mediumint(8) unsigned NOT NULL default '0', - `npcflag` int(10) unsigned NOT NULL default '0', - PRIMARY KEY (`guid`,`event_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `game_event_npcflag` --- - -LOCK TABLES `game_event_npcflag` WRITE; -/*!40000 ALTER TABLE `game_event_npcflag` DISABLE KEYS */; -/*!40000 ALTER TABLE `game_event_npcflag` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `game_event_prerequisite` --- - -DROP TABLE IF EXISTS `game_event_prerequisite`; -CREATE TABLE `game_event_prerequisite` ( - `event_id` mediumint(8) unsigned NOT NULL, - `prerequisite_event` mediumint(8) unsigned NOT NULL, - PRIMARY KEY (`event_id`,`prerequisite_event`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `game_event_prerequisite` --- - -LOCK TABLES `game_event_prerequisite` WRITE; -/*!40000 ALTER TABLE `game_event_prerequisite` DISABLE KEYS */; -/*!40000 ALTER TABLE `game_event_prerequisite` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `game_event_quest_condition` --- - -DROP TABLE IF EXISTS `game_event_quest_condition`; -CREATE TABLE `game_event_quest_condition` ( - `quest` mediumint(8) unsigned NOT NULL default '0', - `event_id` mediumint(8) unsigned NOT NULL default '0', - `condition_id` mediumint(8) unsigned NOT NULL default '0', - `num` float default '0', - PRIMARY KEY (`quest`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `game_event_quest_condition` --- - -LOCK TABLES `game_event_quest_condition` WRITE; -/*!40000 ALTER TABLE `game_event_quest_condition` DISABLE KEYS */; -/*!40000 ALTER TABLE `game_event_quest_condition` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `game_graveyard_zone` --- - -DROP TABLE IF EXISTS `game_graveyard_zone`; -CREATE TABLE `game_graveyard_zone` ( - `id` mediumint(8) unsigned NOT NULL default '0', - `ghost_zone` mediumint(8) unsigned NOT NULL default '0', - `faction` smallint(5) unsigned NOT NULL default '0', - PRIMARY KEY (`id`,`ghost_zone`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Trigger System'; - --- --- Dumping data for table `game_graveyard_zone` --- - -LOCK TABLES `game_graveyard_zone` WRITE; -/*!40000 ALTER TABLE `game_graveyard_zone` DISABLE KEYS */; -/*!40000 ALTER TABLE `game_graveyard_zone` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `game_tele` --- - -DROP TABLE IF EXISTS `game_tele`; -CREATE TABLE `game_tele` ( - `id` mediumint(8) unsigned NOT NULL auto_increment, - `position_x` float NOT NULL default '0', - `position_y` float NOT NULL default '0', - `position_z` float NOT NULL default '0', - `orientation` float NOT NULL default '0', - `map` smallint(5) unsigned NOT NULL default '0', - `name` varchar(100) NOT NULL default '', - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Tele Command'; - --- --- Dumping data for table `game_tele` --- - -LOCK TABLES `game_tele` WRITE; -/*!40000 ALTER TABLE `game_tele` DISABLE KEYS */; -/*!40000 ALTER TABLE `game_tele` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `game_weather` --- - -DROP TABLE IF EXISTS `game_weather`; -CREATE TABLE `game_weather` ( - `zone` mediumint(8) unsigned NOT NULL default '0', - `spring_rain_chance` tinyint(3) unsigned NOT NULL default '25', - `spring_snow_chance` tinyint(3) unsigned NOT NULL default '25', - `spring_storm_chance` tinyint(3) unsigned NOT NULL default '25', - `summer_rain_chance` tinyint(3) unsigned NOT NULL default '25', - `summer_snow_chance` tinyint(3) unsigned NOT NULL default '25', - `summer_storm_chance` tinyint(3) unsigned NOT NULL default '25', - `fall_rain_chance` tinyint(3) unsigned NOT NULL default '25', - `fall_snow_chance` tinyint(3) unsigned NOT NULL default '25', - `fall_storm_chance` tinyint(3) unsigned NOT NULL default '25', - `winter_rain_chance` tinyint(3) unsigned NOT NULL default '25', - `winter_snow_chance` tinyint(3) unsigned NOT NULL default '25', - `winter_storm_chance` tinyint(3) unsigned NOT NULL default '25', - PRIMARY KEY (`zone`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Weather System'; - --- --- Dumping data for table `game_weather` --- - -LOCK TABLES `game_weather` WRITE; -/*!40000 ALTER TABLE `game_weather` DISABLE KEYS */; -/*!40000 ALTER TABLE `game_weather` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `gameobject` --- - -DROP TABLE IF EXISTS `gameobject`; -CREATE TABLE `gameobject` ( - `guid` int(10) unsigned NOT NULL auto_increment COMMENT 'Global Unique Identifier', - `id` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Gameobject Identifier', - `map` smallint(5) unsigned NOT NULL default '0' COMMENT 'Map Identifier', - `spawnMask` tinyint(3) unsigned NOT NULL default '1', - `position_x` float NOT NULL default '0', - `position_y` float NOT NULL default '0', - `position_z` float NOT NULL default '0', - `orientation` float NOT NULL default '0', - `rotation0` float NOT NULL default '0', - `rotation1` float NOT NULL default '0', - `rotation2` float NOT NULL default '0', - `rotation3` float NOT NULL default '0', - `spawntimesecs` int(11) NOT NULL default '0', - `animprogress` tinyint(3) unsigned NOT NULL default '0', - `state` tinyint(3) unsigned NOT NULL default '0', - PRIMARY KEY (`guid`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Gameobject System'; - --- --- Dumping data for table `gameobject` --- - -LOCK TABLES `gameobject` WRITE; -/*!40000 ALTER TABLE `gameobject` DISABLE KEYS */; -/*!40000 ALTER TABLE `gameobject` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `gameobject_involvedrelation` --- - -DROP TABLE IF EXISTS `gameobject_involvedrelation`; -CREATE TABLE `gameobject_involvedrelation` ( - `id` mediumint(8) unsigned NOT NULL default '0', - `quest` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Quest Identifier', - PRIMARY KEY (`id`,`quest`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `gameobject_involvedrelation` --- - -LOCK TABLES `gameobject_involvedrelation` WRITE; -/*!40000 ALTER TABLE `gameobject_involvedrelation` DISABLE KEYS */; -/*!40000 ALTER TABLE `gameobject_involvedrelation` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `gameobject_loot_template` --- - -DROP TABLE IF EXISTS `gameobject_loot_template`; -CREATE TABLE `gameobject_loot_template` ( - `entry` mediumint(8) unsigned NOT NULL default '0', - `item` mediumint(8) unsigned NOT NULL default '0', - `ChanceOrQuestChance` float NOT NULL default '100', - `groupid` tinyint(3) unsigned NOT NULL default '0', - `mincountOrRef` mediumint(9) NOT NULL default '1', - `maxcount` tinyint(3) unsigned NOT NULL default '1', - `lootcondition` tinyint(3) unsigned NOT NULL default '0', - `condition_value1` mediumint(8) unsigned NOT NULL default '0', - `condition_value2` mediumint(8) unsigned NOT NULL default '0', - PRIMARY KEY (`entry`,`item`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Loot System'; - --- --- Dumping data for table `gameobject_loot_template` --- - -LOCK TABLES `gameobject_loot_template` WRITE; -/*!40000 ALTER TABLE `gameobject_loot_template` DISABLE KEYS */; -/*!40000 ALTER TABLE `gameobject_loot_template` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `gameobject_questrelation` --- - -DROP TABLE IF EXISTS `gameobject_questrelation`; -CREATE TABLE `gameobject_questrelation` ( - `id` mediumint(8) unsigned NOT NULL default '0', - `quest` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Quest Identifier', - PRIMARY KEY (`id`,`quest`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `gameobject_questrelation` --- - -LOCK TABLES `gameobject_questrelation` WRITE; -/*!40000 ALTER TABLE `gameobject_questrelation` DISABLE KEYS */; -/*!40000 ALTER TABLE `gameobject_questrelation` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `gameobject_respawn` --- - -DROP TABLE IF EXISTS `gameobject_respawn`; -CREATE TABLE `gameobject_respawn` ( - `guid` int(10) unsigned NOT NULL default '0' COMMENT 'Global Unique Identifier', - `respawntime` bigint(20) NOT NULL default '0', - `instance` mediumint(8) unsigned NOT NULL default '0', - PRIMARY KEY (`guid`,`instance`), - KEY `instance` (`instance`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Grid Loading System'; - --- --- Dumping data for table `gameobject_respawn` --- - -LOCK TABLES `gameobject_respawn` WRITE; -/*!40000 ALTER TABLE `gameobject_respawn` DISABLE KEYS */; -/*!40000 ALTER TABLE `gameobject_respawn` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `gameobject_scripts` --- - -DROP TABLE IF EXISTS `gameobject_scripts`; -CREATE TABLE `gameobject_scripts` ( - `id` mediumint(8) unsigned NOT NULL default '0', - `delay` int(10) unsigned NOT NULL default '0', - `command` mediumint(8) unsigned NOT NULL default '0', - `datalong` mediumint(8) unsigned NOT NULL default '0', - `datalong2` int(10) unsigned NOT NULL default '0', - `datatext` text NOT NULL, - `x` float NOT NULL default '0', - `y` float NOT NULL default '0', - `z` float NOT NULL default '0', - `o` float NOT NULL default '0' -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `gameobject_scripts` --- - -LOCK TABLES `gameobject_scripts` WRITE; -/*!40000 ALTER TABLE `gameobject_scripts` DISABLE KEYS */; -/*!40000 ALTER TABLE `gameobject_scripts` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `gameobject_template` --- - -DROP TABLE IF EXISTS `gameobject_template`; -CREATE TABLE `gameobject_template` ( - `entry` mediumint(8) unsigned NOT NULL default '0', - `type` tinyint(3) unsigned NOT NULL default '0', - `displayId` mediumint(8) unsigned NOT NULL default '0', - `name` varchar(100) NOT NULL default '', - `castBarCaption` varchar(100) NOT NULL default '', - `faction` smallint(5) unsigned NOT NULL default '0', - `flags` int(10) unsigned NOT NULL default '0', - `size` float NOT NULL default '1', - `data0` int(10) unsigned NOT NULL default '0', - `data1` int(10) unsigned NOT NULL default '0', - `data2` int(10) unsigned NOT NULL default '0', - `data3` int(10) unsigned NOT NULL default '0', - `data4` int(10) unsigned NOT NULL default '0', - `data5` int(10) unsigned NOT NULL default '0', - `data6` int(10) unsigned NOT NULL default '0', - `data7` int(10) unsigned NOT NULL default '0', - `data8` int(10) unsigned NOT NULL default '0', - `data9` int(10) unsigned NOT NULL default '0', - `data10` int(10) unsigned NOT NULL default '0', - `data11` int(10) unsigned NOT NULL default '0', - `data12` int(10) unsigned NOT NULL default '0', - `data13` int(10) unsigned NOT NULL default '0', - `data14` int(10) unsigned NOT NULL default '0', - `data15` int(10) unsigned NOT NULL default '0', - `data16` int(10) unsigned NOT NULL default '0', - `data17` int(10) unsigned NOT NULL default '0', - `data18` int(10) unsigned NOT NULL default '0', - `data19` int(10) unsigned NOT NULL default '0', - `data20` int(10) unsigned NOT NULL default '0', - `data21` int(10) unsigned NOT NULL default '0', - `data22` int(10) unsigned NOT NULL default '0', - `data23` int(10) unsigned NOT NULL default '0', - `ScriptName` varchar(64) NOT NULL default '', - PRIMARY KEY (`entry`), - KEY `idx_name` (`name`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Gameobject System'; - --- --- Dumping data for table `gameobject_template` --- - -LOCK TABLES `gameobject_template` WRITE; -/*!40000 ALTER TABLE `gameobject_template` DISABLE KEYS */; -/*!40000 ALTER TABLE `gameobject_template` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `instance_template` --- - -DROP TABLE IF EXISTS `instance_template`; -CREATE TABLE `instance_template` ( - `map` smallint(5) unsigned NOT NULL, - `parent` int(10) unsigned NOT NULL, - `levelMin` tinyint(3) unsigned NOT NULL default '0', - `levelMax` tinyint(3) unsigned NOT NULL default '0', - `maxPlayers` tinyint(3) unsigned NOT NULL default '0', - `reset_delay` int(10) unsigned NOT NULL default '0', - `startLocX` float default NULL, - `startLocY` float default NULL, - `startLocZ` float default NULL, - `startLocO` float default NULL, - `script` varchar(128) NOT NULL default '', - PRIMARY KEY (`map`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `instance_template` --- - -LOCK TABLES `instance_template` WRITE; -/*!40000 ALTER TABLE `instance_template` DISABLE KEYS */; -/*!40000 ALTER TABLE `instance_template` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `item_enchantment_template` --- - -DROP TABLE IF EXISTS `item_enchantment_template`; -CREATE TABLE `item_enchantment_template` ( - `entry` mediumint(8) unsigned NOT NULL default '0', - `ench` mediumint(8) unsigned NOT NULL default '0', - `chance` float unsigned NOT NULL default '0', - PRIMARY KEY (`entry`,`ench`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Item Random Enchantment System'; - --- --- Dumping data for table `item_enchantment_template` --- - -LOCK TABLES `item_enchantment_template` WRITE; -/*!40000 ALTER TABLE `item_enchantment_template` DISABLE KEYS */; -/*!40000 ALTER TABLE `item_enchantment_template` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `item_loot_template` --- - -DROP TABLE IF EXISTS `item_loot_template`; -CREATE TABLE `item_loot_template` ( - `entry` mediumint(8) unsigned NOT NULL default '0', - `item` mediumint(8) unsigned NOT NULL default '0', - `ChanceOrQuestChance` float NOT NULL default '100', - `groupid` tinyint(3) unsigned NOT NULL default '0', - `mincountOrRef` mediumint(9) NOT NULL default '1', - `maxcount` smallint(5) unsigned NOT NULL default '1', - `lootcondition` tinyint(3) unsigned NOT NULL default '0', - `condition_value1` mediumint(8) unsigned NOT NULL default '0', - `condition_value2` mediumint(8) unsigned NOT NULL default '0', - PRIMARY KEY (`entry`,`item`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System'; - --- --- Dumping data for table `item_loot_template` --- - -LOCK TABLES `item_loot_template` WRITE; -/*!40000 ALTER TABLE `item_loot_template` DISABLE KEYS */; -/*!40000 ALTER TABLE `item_loot_template` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `item_template` --- - -DROP TABLE IF EXISTS `item_template`; -CREATE TABLE `item_template` ( - `entry` mediumint(8) unsigned NOT NULL default '0', - `class` tinyint(3) unsigned NOT NULL default '0', - `subclass` tinyint(3) unsigned NOT NULL default '0', - `unk0` int(11) NOT NULL default '-1', - `name` varchar(255) NOT NULL default '', - `displayid` mediumint(8) unsigned NOT NULL default '0', - `Quality` tinyint(3) unsigned NOT NULL default '0', - `Flags` int(10) unsigned NOT NULL default '0', - `BuyCount` tinyint(3) unsigned NOT NULL default '1', - `BuyPrice` int(10) unsigned NOT NULL default '0', - `SellPrice` int(10) unsigned NOT NULL default '0', - `InventoryType` tinyint(3) unsigned NOT NULL default '0', - `AllowableClass` mediumint(9) NOT NULL default '-1', - `AllowableRace` mediumint(9) NOT NULL default '-1', - `ItemLevel` tinyint(3) unsigned NOT NULL default '0', - `RequiredLevel` tinyint(3) unsigned NOT NULL default '0', - `RequiredSkill` smallint(5) unsigned NOT NULL default '0', - `RequiredSkillRank` smallint(5) unsigned NOT NULL default '0', - `requiredspell` mediumint(8) unsigned NOT NULL default '0', - `requiredhonorrank` mediumint(8) unsigned NOT NULL default '0', - `RequiredCityRank` mediumint(8) unsigned NOT NULL default '0', - `RequiredReputationFaction` smallint(5) unsigned NOT NULL default '0', - `RequiredReputationRank` smallint(5) unsigned NOT NULL default '0', - `maxcount` smallint(5) unsigned NOT NULL default '0', - `stackable` smallint(5) unsigned NOT NULL default '1', - `ContainerSlots` tinyint(3) unsigned NOT NULL default '0', - `stat_type1` tinyint(3) unsigned NOT NULL default '0', - `stat_value1` smallint(6) NOT NULL default '0', - `stat_type2` tinyint(3) unsigned NOT NULL default '0', - `stat_value2` smallint(6) NOT NULL default '0', - `stat_type3` tinyint(3) unsigned NOT NULL default '0', - `stat_value3` smallint(6) NOT NULL default '0', - `stat_type4` tinyint(3) unsigned NOT NULL default '0', - `stat_value4` smallint(6) NOT NULL default '0', - `stat_type5` tinyint(3) unsigned NOT NULL default '0', - `stat_value5` smallint(6) NOT NULL default '0', - `stat_type6` tinyint(3) unsigned NOT NULL default '0', - `stat_value6` smallint(6) NOT NULL default '0', - `stat_type7` tinyint(3) unsigned NOT NULL default '0', - `stat_value7` smallint(6) NOT NULL default '0', - `stat_type8` tinyint(3) unsigned NOT NULL default '0', - `stat_value8` smallint(6) NOT NULL default '0', - `stat_type9` tinyint(3) unsigned NOT NULL default '0', - `stat_value9` smallint(6) NOT NULL default '0', - `stat_type10` tinyint(3) unsigned NOT NULL default '0', - `stat_value10` smallint(6) NOT NULL default '0', - `dmg_min1` float NOT NULL default '0', - `dmg_max1` float NOT NULL default '0', - `dmg_type1` tinyint(3) unsigned NOT NULL default '0', - `dmg_min2` float NOT NULL default '0', - `dmg_max2` float NOT NULL default '0', - `dmg_type2` tinyint(3) unsigned NOT NULL default '0', - `dmg_min3` float NOT NULL default '0', - `dmg_max3` float NOT NULL default '0', - `dmg_type3` tinyint(3) unsigned NOT NULL default '0', - `dmg_min4` float NOT NULL default '0', - `dmg_max4` float NOT NULL default '0', - `dmg_type4` tinyint(3) unsigned NOT NULL default '0', - `dmg_min5` float NOT NULL default '0', - `dmg_max5` float NOT NULL default '0', - `dmg_type5` tinyint(3) unsigned NOT NULL default '0', - `armor` smallint(5) unsigned NOT NULL default '0', - `holy_res` tinyint(3) unsigned NOT NULL default '0', - `fire_res` tinyint(3) unsigned NOT NULL default '0', - `nature_res` tinyint(3) unsigned NOT NULL default '0', - `frost_res` tinyint(3) unsigned NOT NULL default '0', - `shadow_res` tinyint(3) unsigned NOT NULL default '0', - `arcane_res` tinyint(3) unsigned NOT NULL default '0', - `delay` smallint(5) unsigned NOT NULL default '1000', - `ammo_type` tinyint(3) unsigned NOT NULL default '0', - `RangedModRange` float NOT NULL default '0', - `spellid_1` mediumint(8) unsigned NOT NULL default '0', - `spelltrigger_1` tinyint(3) unsigned NOT NULL default '0', - `spellcharges_1` tinyint(4) NOT NULL default '0', - `spellppmRate_1` float NOT NULL default '0', - `spellcooldown_1` int(11) NOT NULL default '-1', - `spellcategory_1` smallint(5) unsigned NOT NULL default '0', - `spellcategorycooldown_1` int(11) NOT NULL default '-1', - `spellid_2` mediumint(8) unsigned NOT NULL default '0', - `spelltrigger_2` tinyint(3) unsigned NOT NULL default '0', - `spellcharges_2` tinyint(4) NOT NULL default '0', - `spellppmRate_2` float NOT NULL default '0', - `spellcooldown_2` int(11) NOT NULL default '-1', - `spellcategory_2` smallint(5) unsigned NOT NULL default '0', - `spellcategorycooldown_2` int(11) NOT NULL default '-1', - `spellid_3` mediumint(8) unsigned NOT NULL default '0', - `spelltrigger_3` tinyint(3) unsigned NOT NULL default '0', - `spellcharges_3` tinyint(4) NOT NULL default '0', - `spellppmRate_3` float NOT NULL default '0', - `spellcooldown_3` int(11) NOT NULL default '-1', - `spellcategory_3` smallint(5) unsigned NOT NULL default '0', - `spellcategorycooldown_3` int(11) NOT NULL default '-1', - `spellid_4` mediumint(8) unsigned NOT NULL default '0', - `spelltrigger_4` tinyint(3) unsigned NOT NULL default '0', - `spellcharges_4` tinyint(4) NOT NULL default '0', - `spellppmRate_4` float NOT NULL default '0', - `spellcooldown_4` int(11) NOT NULL default '-1', - `spellcategory_4` smallint(5) unsigned NOT NULL default '0', - `spellcategorycooldown_4` int(11) NOT NULL default '-1', - `spellid_5` mediumint(8) unsigned NOT NULL default '0', - `spelltrigger_5` tinyint(3) unsigned NOT NULL default '0', - `spellcharges_5` tinyint(4) NOT NULL default '0', - `spellppmRate_5` float NOT NULL default '0', - `spellcooldown_5` int(11) NOT NULL default '-1', - `spellcategory_5` smallint(5) unsigned NOT NULL default '0', - `spellcategorycooldown_5` int(11) NOT NULL default '-1', - `bonding` tinyint(3) unsigned NOT NULL default '0', - `description` varchar(255) NOT NULL default '', - `PageText` mediumint(8) unsigned NOT NULL default '0', - `LanguageID` tinyint(3) unsigned NOT NULL default '0', - `PageMaterial` tinyint(3) unsigned NOT NULL default '0', - `startquest` mediumint(8) unsigned NOT NULL default '0', - `lockid` mediumint(8) unsigned NOT NULL default '0', - `Material` tinyint(4) NOT NULL default '0', - `sheath` tinyint(3) unsigned NOT NULL default '0', - `RandomProperty` mediumint(8) unsigned NOT NULL default '0', - `RandomSuffix` mediumint(8) unsigned NOT NULL default '0', - `block` mediumint(8) unsigned NOT NULL default '0', - `itemset` mediumint(8) unsigned NOT NULL default '0', - `MaxDurability` smallint(5) unsigned NOT NULL default '0', - `area` mediumint(8) unsigned NOT NULL default '0', - `Map` smallint(6) NOT NULL default '0', - `BagFamily` mediumint(9) NOT NULL default '0', - `TotemCategory` tinyint(4) NOT NULL default '0', - `socketColor_1` tinyint(4) NOT NULL default '0', - `socketContent_1` mediumint(9) NOT NULL default '0', - `socketColor_2` tinyint(4) NOT NULL default '0', - `socketContent_2` mediumint(9) NOT NULL default '0', - `socketColor_3` tinyint(4) NOT NULL default '0', - `socketContent_3` mediumint(9) NOT NULL default '0', - `socketBonus` mediumint(9) NOT NULL default '0', - `GemProperties` mediumint(9) NOT NULL default '0', - `RequiredDisenchantSkill` smallint(6) NOT NULL default '-1', - `ArmorDamageModifier` float NOT NULL default '0', - `ScriptName` varchar(64) NOT NULL default '', - `DisenchantID` mediumint(8) unsigned NOT NULL default '0', - `FoodType` tinyint(3) unsigned NOT NULL default '0', - `minMoneyLoot` int(10) unsigned NOT NULL default '0', - `maxMoneyLoot` int(10) unsigned NOT NULL default '0', - `Duration` int(11) NOT NULL default '0' COMMENT 'Duration in seconds. Negative value means realtime, postive value ingame time', - PRIMARY KEY (`entry`), - KEY `idx_name` (`name`), - KEY `items_index` (`class`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Item System'; - --- --- Dumping data for table `item_template` --- - -LOCK TABLES `item_template` WRITE; -/*!40000 ALTER TABLE `item_template` DISABLE KEYS */; -/*!40000 ALTER TABLE `item_template` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `locales_creature` --- - -DROP TABLE IF EXISTS `locales_creature`; -CREATE TABLE `locales_creature` ( - `entry` mediumint(8) unsigned NOT NULL default '0', - `name_loc1` varchar(100) NOT NULL default '', - `name_loc2` varchar(100) NOT NULL default '', - `name_loc3` varchar(100) NOT NULL default '', - `name_loc4` varchar(100) NOT NULL default '', - `name_loc5` varchar(100) NOT NULL default '', - `name_loc6` varchar(100) NOT NULL default '', - `name_loc7` varchar(100) NOT NULL default '', - `name_loc8` varchar(100) NOT NULL default '', - `subname_loc1` varchar(100) default NULL, - `subname_loc2` varchar(100) default NULL, - `subname_loc3` varchar(100) default NULL, - `subname_loc4` varchar(100) default NULL, - `subname_loc5` varchar(100) default NULL, - `subname_loc6` varchar(100) default NULL, - `subname_loc7` varchar(100) default NULL, - `subname_loc8` varchar(100) default NULL, - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `locales_creature` --- - -LOCK TABLES `locales_creature` WRITE; -/*!40000 ALTER TABLE `locales_creature` DISABLE KEYS */; -/*!40000 ALTER TABLE `locales_creature` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `locales_gameobject` --- - -DROP TABLE IF EXISTS `locales_gameobject`; -CREATE TABLE `locales_gameobject` ( - `entry` mediumint(8) unsigned NOT NULL default '0', - `name_loc1` varchar(100) NOT NULL default '', - `name_loc2` varchar(100) NOT NULL default '', - `name_loc3` varchar(100) NOT NULL default '', - `name_loc4` varchar(100) NOT NULL default '', - `name_loc5` varchar(100) NOT NULL default '', - `name_loc6` varchar(100) NOT NULL default '', - `name_loc7` varchar(100) NOT NULL default '', - `name_loc8` varchar(100) NOT NULL default '', - `castbarcaption_loc1` varchar(100) NOT NULL default '', - `castbarcaption_loc2` varchar(100) NOT NULL default '', - `castbarcaption_loc3` varchar(100) NOT NULL default '', - `castbarcaption_loc4` varchar(100) NOT NULL default '', - `castbarcaption_loc5` varchar(100) NOT NULL default '', - `castbarcaption_loc6` varchar(100) NOT NULL default '', - `castbarcaption_loc7` varchar(100) NOT NULL default '', - `castbarcaption_loc8` varchar(100) NOT NULL default '', - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `locales_gameobject` --- - -LOCK TABLES `locales_gameobject` WRITE; -/*!40000 ALTER TABLE `locales_gameobject` DISABLE KEYS */; -/*!40000 ALTER TABLE `locales_gameobject` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `locales_item` --- - -DROP TABLE IF EXISTS `locales_item`; -CREATE TABLE `locales_item` ( - `entry` mediumint(8) unsigned NOT NULL default '0', - `name_loc1` varchar(100) NOT NULL default '', - `name_loc2` varchar(100) NOT NULL default '', - `name_loc3` varchar(100) NOT NULL default '', - `name_loc4` varchar(100) NOT NULL default '', - `name_loc5` varchar(100) NOT NULL default '', - `name_loc6` varchar(100) NOT NULL default '', - `name_loc7` varchar(100) NOT NULL default '', - `name_loc8` varchar(100) NOT NULL default '', - `description_loc1` varchar(255) default NULL, - `description_loc2` varchar(255) default NULL, - `description_loc3` varchar(255) default NULL, - `description_loc4` varchar(255) default NULL, - `description_loc5` varchar(255) default NULL, - `description_loc6` varchar(255) default NULL, - `description_loc7` varchar(255) default NULL, - `description_loc8` varchar(255) default NULL, - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `locales_item` --- - -LOCK TABLES `locales_item` WRITE; -/*!40000 ALTER TABLE `locales_item` DISABLE KEYS */; -/*!40000 ALTER TABLE `locales_item` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `locales_npc_text` --- - -DROP TABLE IF EXISTS `locales_npc_text`; -CREATE TABLE `locales_npc_text` ( - `entry` mediumint(8) unsigned NOT NULL default '0', - `Text0_0_loc1` longtext, - `Text0_0_loc2` longtext, - `Text0_0_loc3` longtext, - `Text0_0_loc4` longtext, - `Text0_0_loc5` longtext, - `Text0_0_loc6` longtext, - `Text0_0_loc7` longtext, - `Text0_0_loc8` longtext, - `Text0_1_loc1` longtext, - `Text0_1_loc2` longtext, - `Text0_1_loc3` longtext, - `Text0_1_loc4` longtext, - `Text0_1_loc5` longtext, - `Text0_1_loc6` longtext, - `Text0_1_loc7` longtext, - `Text0_1_loc8` longtext, - `Text1_0_loc1` longtext, - `Text1_0_loc2` longtext, - `Text1_0_loc3` longtext, - `Text1_0_loc4` longtext, - `Text1_0_loc5` longtext, - `Text1_0_loc6` longtext, - `Text1_0_loc7` longtext, - `Text1_0_loc8` longtext, - `Text1_1_loc1` longtext, - `Text1_1_loc2` longtext, - `Text1_1_loc3` longtext, - `Text1_1_loc4` longtext, - `Text1_1_loc5` longtext, - `Text1_1_loc6` longtext, - `Text1_1_loc7` longtext, - `Text1_1_loc8` longtext, - `Text2_0_loc1` longtext, - `Text2_0_loc2` longtext, - `Text2_0_loc3` longtext, - `Text2_0_loc4` longtext, - `Text2_0_loc5` longtext, - `Text2_0_loc6` longtext, - `Text2_0_loc7` longtext, - `Text2_0_loc8` longtext, - `Text2_1_loc1` longtext, - `Text2_1_loc2` longtext, - `Text2_1_loc3` longtext, - `Text2_1_loc4` longtext, - `Text2_1_loc5` longtext, - `Text2_1_loc6` longtext, - `Text2_1_loc7` longtext, - `Text2_1_loc8` longtext, - `Text3_0_loc1` longtext, - `Text3_0_loc2` longtext, - `Text3_0_loc3` longtext, - `Text3_0_loc4` longtext, - `Text3_0_loc5` longtext, - `Text3_0_loc6` longtext, - `Text3_0_loc7` longtext, - `Text3_0_loc8` longtext, - `Text3_1_loc1` longtext, - `Text3_1_loc2` longtext, - `Text3_1_loc3` longtext, - `Text3_1_loc4` longtext, - `Text3_1_loc5` longtext, - `Text3_1_loc6` longtext, - `Text3_1_loc7` longtext, - `Text3_1_loc8` longtext, - `Text4_0_loc1` longtext, - `Text4_0_loc2` longtext, - `Text4_0_loc3` longtext, - `Text4_0_loc4` longtext, - `Text4_0_loc5` longtext, - `Text4_0_loc6` longtext, - `Text4_0_loc7` longtext, - `Text4_0_loc8` longtext, - `Text4_1_loc1` longtext, - `Text4_1_loc2` longtext, - `Text4_1_loc3` longtext, - `Text4_1_loc4` longtext, - `Text4_1_loc5` longtext, - `Text4_1_loc6` longtext, - `Text4_1_loc7` longtext, - `Text4_1_loc8` longtext, - `Text5_0_loc1` longtext, - `Text5_0_loc2` longtext, - `Text5_0_loc3` longtext, - `Text5_0_loc4` longtext, - `Text5_0_loc5` longtext, - `Text5_0_loc6` longtext, - `Text5_0_loc7` longtext, - `Text5_0_loc8` longtext, - `Text5_1_loc1` longtext, - `Text5_1_loc2` longtext, - `Text5_1_loc3` longtext, - `Text5_1_loc4` longtext, - `Text5_1_loc5` longtext, - `Text5_1_loc6` longtext, - `Text5_1_loc7` longtext, - `Text5_1_loc8` longtext, - `Text6_0_loc1` longtext, - `Text6_0_loc2` longtext, - `Text6_0_loc3` longtext, - `Text6_0_loc4` longtext, - `Text6_0_loc5` longtext, - `Text6_0_loc6` longtext, - `Text6_0_loc7` longtext, - `Text6_0_loc8` longtext, - `Text6_1_loc1` longtext, - `Text6_1_loc2` longtext, - `Text6_1_loc3` longtext, - `Text6_1_loc4` longtext, - `Text6_1_loc5` longtext, - `Text6_1_loc6` longtext, - `Text6_1_loc7` longtext, - `Text6_1_loc8` longtext, - `Text7_0_loc1` longtext, - `Text7_0_loc2` longtext, - `Text7_0_loc3` longtext, - `Text7_0_loc4` longtext, - `Text7_0_loc5` longtext, - `Text7_0_loc6` longtext, - `Text7_0_loc7` longtext, - `Text7_0_loc8` longtext, - `Text7_1_loc1` longtext, - `Text7_1_loc2` longtext, - `Text7_1_loc3` longtext, - `Text7_1_loc4` longtext, - `Text7_1_loc5` longtext, - `Text7_1_loc6` longtext, - `Text7_1_loc7` longtext, - `Text7_1_loc8` longtext, - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `locales_npc_text` --- - -LOCK TABLES `locales_npc_text` WRITE; -/*!40000 ALTER TABLE `locales_npc_text` DISABLE KEYS */; -/*!40000 ALTER TABLE `locales_npc_text` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `locales_page_text` --- - -DROP TABLE IF EXISTS `locales_page_text`; -CREATE TABLE `locales_page_text` ( - `entry` mediumint(8) unsigned NOT NULL default '0', - `Text_loc1` longtext, - `Text_loc2` longtext, - `Text_loc3` longtext, - `Text_loc4` longtext, - `Text_loc5` longtext, - `Text_loc6` longtext, - `Text_loc7` longtext, - `Text_loc8` longtext, - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `locales_page_text` --- - -LOCK TABLES `locales_page_text` WRITE; -/*!40000 ALTER TABLE `locales_page_text` DISABLE KEYS */; -/*!40000 ALTER TABLE `locales_page_text` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `locales_quest` --- - -DROP TABLE IF EXISTS `locales_quest`; -CREATE TABLE `locales_quest` ( - `entry` mediumint(8) unsigned NOT NULL default '0', - `Title_loc1` text, - `Title_loc2` text, - `Title_loc3` text, - `Title_loc4` text, - `Title_loc5` text, - `Title_loc6` text, - `Title_loc7` text, - `Title_loc8` text, - `Details_loc1` text, - `Details_loc2` text, - `Details_loc3` text, - `Details_loc4` text, - `Details_loc5` text, - `Details_loc6` text, - `Details_loc7` text, - `Details_loc8` text, - `Objectives_loc1` text, - `Objectives_loc2` text, - `Objectives_loc3` text, - `Objectives_loc4` text, - `Objectives_loc5` text, - `Objectives_loc6` text, - `Objectives_loc7` text, - `Objectives_loc8` text, - `OfferRewardText_loc1` text, - `OfferRewardText_loc2` text, - `OfferRewardText_loc3` text, - `OfferRewardText_loc4` text, - `OfferRewardText_loc5` text, - `OfferRewardText_loc6` text, - `OfferRewardText_loc7` text, - `OfferRewardText_loc8` text, - `RequestItemsText_loc1` text, - `RequestItemsText_loc2` text, - `RequestItemsText_loc3` text, - `RequestItemsText_loc4` text, - `RequestItemsText_loc5` text, - `RequestItemsText_loc6` text, - `RequestItemsText_loc7` text, - `RequestItemsText_loc8` text, - `EndText_loc1` text, - `EndText_loc2` text, - `EndText_loc3` text, - `EndText_loc4` text, - `EndText_loc5` text, - `EndText_loc6` text, - `EndText_loc7` text, - `EndText_loc8` text, - `ObjectiveText1_loc1` text, - `ObjectiveText1_loc2` text, - `ObjectiveText1_loc3` text, - `ObjectiveText1_loc4` text, - `ObjectiveText1_loc5` text, - `ObjectiveText1_loc6` text, - `ObjectiveText1_loc7` text, - `ObjectiveText1_loc8` text, - `ObjectiveText2_loc1` text, - `ObjectiveText2_loc2` text, - `ObjectiveText2_loc3` text, - `ObjectiveText2_loc4` text, - `ObjectiveText2_loc5` text, - `ObjectiveText2_loc6` text, - `ObjectiveText2_loc7` text, - `ObjectiveText2_loc8` text, - `ObjectiveText3_loc1` text, - `ObjectiveText3_loc2` text, - `ObjectiveText3_loc3` text, - `ObjectiveText3_loc4` text, - `ObjectiveText3_loc5` text, - `ObjectiveText3_loc6` text, - `ObjectiveText3_loc7` text, - `ObjectiveText3_loc8` text, - `ObjectiveText4_loc1` text, - `ObjectiveText4_loc2` text, - `ObjectiveText4_loc3` text, - `ObjectiveText4_loc4` text, - `ObjectiveText4_loc5` text, - `ObjectiveText4_loc6` text, - `ObjectiveText4_loc7` text, - `ObjectiveText4_loc8` text, - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `locales_quest` --- - -LOCK TABLES `locales_quest` WRITE; -/*!40000 ALTER TABLE `locales_quest` DISABLE KEYS */; -/*!40000 ALTER TABLE `locales_quest` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `npc_gossip` --- - -DROP TABLE IF EXISTS `npc_gossip`; -CREATE TABLE `npc_gossip` ( - `npc_guid` int(10) unsigned NOT NULL default '0', - `textid` mediumint(8) unsigned NOT NULL default '0', - PRIMARY KEY (`npc_guid`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `npc_gossip` --- - -LOCK TABLES `npc_gossip` WRITE; -/*!40000 ALTER TABLE `npc_gossip` DISABLE KEYS */; -/*!40000 ALTER TABLE `npc_gossip` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `npc_gossip_textid` --- - -DROP TABLE IF EXISTS `npc_gossip_textid`; -CREATE TABLE `npc_gossip_textid` ( - `zoneid` smallint(5) unsigned NOT NULL default '0', - `action` smallint(5) unsigned NOT NULL default '0', - `textid` mediumint(8) unsigned NOT NULL default '0', - KEY `zoneid` (`zoneid`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `npc_gossip_textid` --- - -LOCK TABLES `npc_gossip_textid` WRITE; -/*!40000 ALTER TABLE `npc_gossip_textid` DISABLE KEYS */; -/*!40000 ALTER TABLE `npc_gossip_textid` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `npc_option` --- - -DROP TABLE IF EXISTS `npc_option`; -CREATE TABLE `npc_option` ( - `id` tinyint(3) unsigned NOT NULL default '0', - `gossip_id` tinyint(3) unsigned NOT NULL default '0', - `npcflag` int(10) unsigned NOT NULL default '0', - `icon` tinyint(3) unsigned NOT NULL default '0', - `action` tinyint(3) unsigned NOT NULL default '0', - `option_text` text, - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `npc_option` --- - -LOCK TABLES `npc_option` WRITE; -/*!40000 ALTER TABLE `npc_option` DISABLE KEYS */; -/*!40000 ALTER TABLE `npc_option` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `npc_text` --- - -DROP TABLE IF EXISTS `npc_text`; -CREATE TABLE `npc_text` ( - `ID` mediumint(8) unsigned NOT NULL default '0', - `text0_0` longtext, - `text0_1` longtext, - `lang0` tinyint(3) unsigned NOT NULL default '0', - `prob0` float NOT NULL default '0', - `em0_0` smallint(5) unsigned NOT NULL default '0', - `em0_1` smallint(5) unsigned NOT NULL default '0', - `em0_2` smallint(5) unsigned NOT NULL default '0', - `em0_3` smallint(5) unsigned NOT NULL default '0', - `em0_4` smallint(5) unsigned NOT NULL default '0', - `em0_5` smallint(5) unsigned NOT NULL default '0', - `text1_0` longtext, - `text1_1` longtext, - `lang1` tinyint(3) unsigned NOT NULL default '0', - `prob1` float NOT NULL default '0', - `em1_0` smallint(5) unsigned NOT NULL default '0', - `em1_1` smallint(5) unsigned NOT NULL default '0', - `em1_2` smallint(5) unsigned NOT NULL default '0', - `em1_3` smallint(5) unsigned NOT NULL default '0', - `em1_4` smallint(5) unsigned NOT NULL default '0', - `em1_5` smallint(5) unsigned NOT NULL default '0', - `text2_0` longtext, - `text2_1` longtext, - `lang2` tinyint(3) unsigned NOT NULL default '0', - `prob2` float NOT NULL default '0', - `em2_0` smallint(5) unsigned NOT NULL default '0', - `em2_1` smallint(5) unsigned NOT NULL default '0', - `em2_2` smallint(5) unsigned NOT NULL default '0', - `em2_3` smallint(5) unsigned NOT NULL default '0', - `em2_4` smallint(5) unsigned NOT NULL default '0', - `em2_5` smallint(5) unsigned NOT NULL default '0', - `text3_0` longtext, - `text3_1` longtext, - `lang3` tinyint(3) unsigned NOT NULL default '0', - `prob3` float NOT NULL default '0', - `em3_0` smallint(5) unsigned NOT NULL default '0', - `em3_1` smallint(5) unsigned NOT NULL default '0', - `em3_2` smallint(5) unsigned NOT NULL default '0', - `em3_3` smallint(5) unsigned NOT NULL default '0', - `em3_4` smallint(5) unsigned NOT NULL default '0', - `em3_5` smallint(5) unsigned NOT NULL default '0', - `text4_0` longtext, - `text4_1` longtext, - `lang4` tinyint(3) unsigned NOT NULL default '0', - `prob4` float NOT NULL default '0', - `em4_0` smallint(5) unsigned NOT NULL default '0', - `em4_1` smallint(5) unsigned NOT NULL default '0', - `em4_2` smallint(5) unsigned NOT NULL default '0', - `em4_3` smallint(5) unsigned NOT NULL default '0', - `em4_4` smallint(5) unsigned NOT NULL default '0', - `em4_5` smallint(5) unsigned NOT NULL default '0', - `text5_0` longtext, - `text5_1` longtext, - `lang5` tinyint(3) unsigned NOT NULL default '0', - `prob5` float NOT NULL default '0', - `em5_0` smallint(5) unsigned NOT NULL default '0', - `em5_1` smallint(5) unsigned NOT NULL default '0', - `em5_2` smallint(5) unsigned NOT NULL default '0', - `em5_3` smallint(5) unsigned NOT NULL default '0', - `em5_4` smallint(5) unsigned NOT NULL default '0', - `em5_5` smallint(5) unsigned NOT NULL default '0', - `text6_0` longtext, - `text6_1` longtext, - `lang6` tinyint(3) unsigned NOT NULL default '0', - `prob6` float NOT NULL default '0', - `em6_0` smallint(5) unsigned NOT NULL default '0', - `em6_1` smallint(5) unsigned NOT NULL default '0', - `em6_2` smallint(5) unsigned NOT NULL default '0', - `em6_3` smallint(5) unsigned NOT NULL default '0', - `em6_4` smallint(5) unsigned NOT NULL default '0', - `em6_5` smallint(5) unsigned NOT NULL default '0', - `text7_0` longtext, - `text7_1` longtext, - `lang7` tinyint(3) unsigned NOT NULL default '0', - `prob7` float NOT NULL default '0', - `em7_0` smallint(5) unsigned NOT NULL default '0', - `em7_1` smallint(5) unsigned NOT NULL default '0', - `em7_2` smallint(5) unsigned NOT NULL default '0', - `em7_3` smallint(5) unsigned NOT NULL default '0', - `em7_4` smallint(5) unsigned NOT NULL default '0', - `em7_5` smallint(5) unsigned NOT NULL default '0', - PRIMARY KEY (`ID`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `npc_text` --- - -LOCK TABLES `npc_text` WRITE; -/*!40000 ALTER TABLE `npc_text` DISABLE KEYS */; -/*!40000 ALTER TABLE `npc_text` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `npc_trainer` --- - -DROP TABLE IF EXISTS `npc_trainer`; -CREATE TABLE `npc_trainer` ( - `entry` mediumint(8) unsigned NOT NULL default '0', - `spell` mediumint(8) unsigned NOT NULL default '0', - `spellcost` int(10) unsigned NOT NULL default '0', - `reqskill` smallint(5) unsigned NOT NULL default '0', - `reqskillvalue` smallint(5) unsigned NOT NULL default '0', - `reqlevel` tinyint(3) unsigned NOT NULL default '0', - PRIMARY KEY (`entry`,`spell`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `npc_trainer` --- - -LOCK TABLES `npc_trainer` WRITE; -/*!40000 ALTER TABLE `npc_trainer` DISABLE KEYS */; -/*!40000 ALTER TABLE `npc_trainer` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `npc_vendor` --- - -DROP TABLE IF EXISTS `npc_vendor`; -CREATE TABLE `npc_vendor` ( - `entry` mediumint(8) unsigned NOT NULL default '0', - `item` mediumint(8) unsigned NOT NULL default '0', - `maxcount` tinyint(3) unsigned NOT NULL default '0', - `incrtime` int(10) unsigned NOT NULL default '0', - `ExtendedCost` mediumint(8) unsigned NOT NULL default '0', - PRIMARY KEY (`entry`,`item`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Npc System'; - --- --- Dumping data for table `npc_vendor` --- - -LOCK TABLES `npc_vendor` WRITE; -/*!40000 ALTER TABLE `npc_vendor` DISABLE KEYS */; -/*!40000 ALTER TABLE `npc_vendor` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `page_text` --- - -DROP TABLE IF EXISTS `page_text`; -CREATE TABLE `page_text` ( - `entry` mediumint(8) unsigned NOT NULL default '0', - `text` longtext NOT NULL, - `next_page` mediumint(8) unsigned NOT NULL default '0', - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Item System'; - --- --- Dumping data for table `page_text` --- - -LOCK TABLES `page_text` WRITE; -/*!40000 ALTER TABLE `page_text` DISABLE KEYS */; -/*!40000 ALTER TABLE `page_text` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `pet_levelstats` --- - -DROP TABLE IF EXISTS `pet_levelstats`; -CREATE TABLE `pet_levelstats` ( - `creature_entry` mediumint(8) unsigned NOT NULL, - `level` tinyint(3) unsigned NOT NULL, - `hp` smallint(5) unsigned NOT NULL, - `mana` smallint(5) unsigned NOT NULL, - `armor` int(10) unsigned NOT NULL default '0', - `str` smallint(5) unsigned NOT NULL, - `agi` smallint(5) unsigned NOT NULL, - `sta` smallint(5) unsigned NOT NULL, - `inte` smallint(5) unsigned NOT NULL, - `spi` smallint(5) unsigned NOT NULL, - PRIMARY KEY (`creature_entry`,`level`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=0 COMMENT='Stores pet levels stats.'; - --- --- Dumping data for table `pet_levelstats` --- - -LOCK TABLES `pet_levelstats` WRITE; -/*!40000 ALTER TABLE `pet_levelstats` DISABLE KEYS */; -/*!40000 ALTER TABLE `pet_levelstats` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `pet_name_generation` --- - -DROP TABLE IF EXISTS `pet_name_generation`; -CREATE TABLE `pet_name_generation` ( - `id` mediumint(8) unsigned NOT NULL auto_increment, - `word` tinytext NOT NULL, - `entry` mediumint(8) unsigned NOT NULL default '0', - `half` tinyint(4) NOT NULL default '0', - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `pet_name_generation` --- - -LOCK TABLES `pet_name_generation` WRITE; -/*!40000 ALTER TABLE `pet_name_generation` DISABLE KEYS */; -/*!40000 ALTER TABLE `pet_name_generation` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `petcreateinfo_spell` --- - -DROP TABLE IF EXISTS `petcreateinfo_spell`; -CREATE TABLE `petcreateinfo_spell` ( - `entry` mediumint(8) unsigned NOT NULL default '0', - `Spell1` mediumint(8) unsigned NOT NULL default '0', - `Spell2` mediumint(8) unsigned NOT NULL default '0', - `Spell3` mediumint(8) unsigned NOT NULL default '0', - `Spell4` mediumint(8) unsigned NOT NULL default '0', - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Pet Create Spells'; - --- --- Dumping data for table `petcreateinfo_spell` --- - -LOCK TABLES `petcreateinfo_spell` WRITE; -/*!40000 ALTER TABLE `petcreateinfo_spell` DISABLE KEYS */; -/*!40000 ALTER TABLE `petcreateinfo_spell` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `pickpocketing_loot_template` --- - -DROP TABLE IF EXISTS `pickpocketing_loot_template`; -CREATE TABLE `pickpocketing_loot_template` ( - `entry` mediumint(8) unsigned NOT NULL default '0', - `item` mediumint(8) unsigned NOT NULL default '0', - `ChanceOrQuestChance` float NOT NULL default '100', - `groupid` tinyint(3) unsigned NOT NULL default '0', - `mincountOrRef` mediumint(9) NOT NULL default '1', - `maxcount` tinyint(3) unsigned NOT NULL default '1', - `lootcondition` tinyint(3) unsigned NOT NULL default '0', - `condition_value1` mediumint(8) unsigned NOT NULL default '0', - `condition_value2` mediumint(8) unsigned NOT NULL default '0', - PRIMARY KEY (`entry`,`item`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System'; - --- --- Dumping data for table `pickpocketing_loot_template` --- - -LOCK TABLES `pickpocketing_loot_template` WRITE; -/*!40000 ALTER TABLE `pickpocketing_loot_template` DISABLE KEYS */; -/*!40000 ALTER TABLE `pickpocketing_loot_template` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `player_classlevelstats` --- - -DROP TABLE IF EXISTS `player_classlevelstats`; -CREATE TABLE `player_classlevelstats` ( - `class` tinyint(3) unsigned NOT NULL, - `level` tinyint(3) unsigned NOT NULL, - `basehp` smallint(5) unsigned NOT NULL, - `basemana` smallint(5) unsigned NOT NULL, - PRIMARY KEY (`class`,`level`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=0 COMMENT='Stores levels stats.'; - --- --- Dumping data for table `player_classlevelstats` --- - -LOCK TABLES `player_classlevelstats` WRITE; -/*!40000 ALTER TABLE `player_classlevelstats` DISABLE KEYS */; -/*!40000 ALTER TABLE `player_classlevelstats` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `player_levelstats` --- - -DROP TABLE IF EXISTS `player_levelstats`; -CREATE TABLE `player_levelstats` ( - `race` tinyint(3) unsigned NOT NULL, - `class` tinyint(3) unsigned NOT NULL, - `level` tinyint(3) unsigned NOT NULL, - `str` tinyint(3) unsigned NOT NULL, - `agi` tinyint(3) unsigned NOT NULL, - `sta` tinyint(3) unsigned NOT NULL, - `inte` tinyint(3) unsigned NOT NULL, - `spi` tinyint(3) unsigned NOT NULL, - PRIMARY KEY (`race`,`class`,`level`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=0 COMMENT='Stores levels stats.'; - --- --- Dumping data for table `player_levelstats` --- - -LOCK TABLES `player_levelstats` WRITE; -/*!40000 ALTER TABLE `player_levelstats` DISABLE KEYS */; -/*!40000 ALTER TABLE `player_levelstats` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `playercreateinfo` --- - -DROP TABLE IF EXISTS `playercreateinfo`; -CREATE TABLE `playercreateinfo` ( - `race` tinyint(3) unsigned NOT NULL default '0', - `class` tinyint(3) unsigned NOT NULL default '0', - `map` smallint(5) unsigned NOT NULL default '0', - `zone` 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', - PRIMARY KEY (`race`,`class`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `playercreateinfo` --- - -LOCK TABLES `playercreateinfo` WRITE; -/*!40000 ALTER TABLE `playercreateinfo` DISABLE KEYS */; -/*!40000 ALTER TABLE `playercreateinfo` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `playercreateinfo_action` --- - -DROP TABLE IF EXISTS `playercreateinfo_action`; -CREATE TABLE `playercreateinfo_action` ( - `race` tinyint(3) unsigned NOT NULL default '0', - `class` tinyint(3) unsigned NOT NULL default '0', - `button` smallint(5) unsigned NOT NULL default '0', - `action` smallint(5) unsigned NOT NULL default '0', - `type` smallint(5) unsigned NOT NULL default '0', - `misc` smallint(5) unsigned NOT NULL default '0', - KEY `playercreateinfo_race_class_index` (`race`,`class`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `playercreateinfo_action` --- - -LOCK TABLES `playercreateinfo_action` WRITE; -/*!40000 ALTER TABLE `playercreateinfo_action` DISABLE KEYS */; -/*!40000 ALTER TABLE `playercreateinfo_action` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `playercreateinfo_item` --- - -DROP TABLE IF EXISTS `playercreateinfo_item`; -CREATE TABLE `playercreateinfo_item` ( - `race` tinyint(3) unsigned NOT NULL default '0', - `class` tinyint(3) unsigned NOT NULL default '0', - `itemid` mediumint(8) unsigned NOT NULL default '0', - `amount` tinyint(3) unsigned NOT NULL default '1', - KEY `playercreateinfo_race_class_index` (`race`,`class`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `playercreateinfo_item` --- - -LOCK TABLES `playercreateinfo_item` WRITE; -/*!40000 ALTER TABLE `playercreateinfo_item` DISABLE KEYS */; -/*!40000 ALTER TABLE `playercreateinfo_item` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `playercreateinfo_spell` --- - -DROP TABLE IF EXISTS `playercreateinfo_spell`; -CREATE TABLE `playercreateinfo_spell` ( - `race` tinyint(3) unsigned NOT NULL default '0', - `class` tinyint(3) unsigned NOT NULL default '0', - `Spell` mediumint(8) unsigned NOT NULL default '0', - `Note` varchar(255) default NULL, - `Active` tinyint(3) unsigned NOT NULL default '1', - PRIMARY KEY (`race`,`class`,`Spell`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `playercreateinfo_spell` --- - -LOCK TABLES `playercreateinfo_spell` WRITE; -/*!40000 ALTER TABLE `playercreateinfo_spell` DISABLE KEYS */; -/*!40000 ALTER TABLE `playercreateinfo_spell` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `playercreateinfo_spell_custom` --- - -DROP TABLE IF EXISTS `playercreateinfo_spell_custom`; -CREATE TABLE `playercreateinfo_spell_custom` ( - `race` tinyint(3) unsigned NOT NULL default '0', - `class` tinyint(3) unsigned NOT NULL default '0', - `Spell` mediumint(8) unsigned NOT NULL default '0', - `Note` varchar(255) default NULL, - `Active` tinyint(3) unsigned NOT NULL default '1', - PRIMARY KEY (`race`,`class`,`Spell`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `playercreateinfo_spell_custom` --- - -LOCK TABLES `playercreateinfo_spell_custom` WRITE; -/*!40000 ALTER TABLE `playercreateinfo_spell_custom` DISABLE KEYS */; -/*!40000 ALTER TABLE `playercreateinfo_spell_custom` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `prospecting_loot_template` --- - -DROP TABLE IF EXISTS `prospecting_loot_template`; -CREATE TABLE `prospecting_loot_template` ( - `entry` mediumint(8) unsigned NOT NULL default '0', - `item` mediumint(8) unsigned NOT NULL default '0', - `ChanceOrQuestChance` float NOT NULL default '100', - `groupid` tinyint(3) unsigned NOT NULL default '0', - `mincountOrRef` mediumint(9) NOT NULL default '1', - `maxcount` tinyint(3) unsigned NOT NULL default '1', - `lootcondition` tinyint(3) unsigned NOT NULL default '0', - `condition_value1` mediumint(8) unsigned NOT NULL default '0', - `condition_value2` mediumint(8) unsigned NOT NULL default '0', - PRIMARY KEY (`entry`,`item`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System'; - --- --- Dumping data for table `prospecting_loot_template` --- - -LOCK TABLES `prospecting_loot_template` WRITE; -/*!40000 ALTER TABLE `prospecting_loot_template` DISABLE KEYS */; -/*!40000 ALTER TABLE `prospecting_loot_template` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `quest_end_scripts` --- - -DROP TABLE IF EXISTS `quest_end_scripts`; -CREATE TABLE `quest_end_scripts` ( - `id` mediumint(8) unsigned NOT NULL default '0', - `delay` int(10) unsigned NOT NULL default '0', - `command` mediumint(8) unsigned NOT NULL default '0', - `datalong` mediumint(8) unsigned NOT NULL default '0', - `datalong2` int(10) unsigned NOT NULL default '0', - `datatext` text NOT NULL, - `x` float NOT NULL default '0', - `y` float NOT NULL default '0', - `z` float NOT NULL default '0', - `o` float NOT NULL default '0' -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `quest_end_scripts` --- - -LOCK TABLES `quest_end_scripts` WRITE; -/*!40000 ALTER TABLE `quest_end_scripts` DISABLE KEYS */; -/*!40000 ALTER TABLE `quest_end_scripts` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `quest_mail_loot_template` --- - -DROP TABLE IF EXISTS `quest_mail_loot_template`; -CREATE TABLE `quest_mail_loot_template` ( - `entry` mediumint(8) unsigned NOT NULL default '0', - `item` mediumint(8) unsigned NOT NULL default '0', - `ChanceOrQuestChance` float NOT NULL default '100', - `groupid` tinyint(3) unsigned NOT NULL default '0', - `mincountOrRef` mediumint(9) NOT NULL default '1', - `maxcount` tinyint(3) unsigned NOT NULL default '1', - `lootcondition` tinyint(3) unsigned NOT NULL default '0', - `condition_value1` mediumint(8) unsigned NOT NULL default '0', - `condition_value2` mediumint(8) unsigned NOT NULL default '0', - PRIMARY KEY (`entry`,`item`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System'; - --- --- Dumping data for table `quest_mail_loot_template` --- - -LOCK TABLES `quest_mail_loot_template` WRITE; -/*!40000 ALTER TABLE `quest_mail_loot_template` DISABLE KEYS */; -/*!40000 ALTER TABLE `quest_mail_loot_template` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `quest_start_scripts` --- - -DROP TABLE IF EXISTS `quest_start_scripts`; -CREATE TABLE `quest_start_scripts` ( - `id` mediumint(8) unsigned NOT NULL default '0', - `delay` int(10) unsigned NOT NULL default '0', - `command` mediumint(8) unsigned NOT NULL default '0', - `datalong` mediumint(8) unsigned NOT NULL default '0', - `datalong2` int(10) unsigned NOT NULL default '0', - `datatext` text NOT NULL, - `x` float NOT NULL default '0', - `y` float NOT NULL default '0', - `z` float NOT NULL default '0', - `o` float NOT NULL default '0' -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `quest_start_scripts` --- - -LOCK TABLES `quest_start_scripts` WRITE; -/*!40000 ALTER TABLE `quest_start_scripts` DISABLE KEYS */; -/*!40000 ALTER TABLE `quest_start_scripts` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `quest_template` --- - -DROP TABLE IF EXISTS `quest_template`; -CREATE TABLE `quest_template` ( - `entry` mediumint(8) unsigned NOT NULL default '0', - `Method` tinyint(3) unsigned NOT NULL default '2', - `ZoneOrSort` smallint(6) NOT NULL default '0', - `SkillOrClass` smallint(6) NOT NULL default '0', - `MinLevel` tinyint(3) unsigned NOT NULL default '0', - `QuestLevel` tinyint(3) unsigned NOT NULL default '0', - `Type` smallint(5) unsigned NOT NULL default '0', - `RequiredRaces` smallint(5) unsigned NOT NULL default '0', - `RequiredSkillValue` smallint(5) unsigned NOT NULL default '0', - `RepObjectiveFaction` smallint(5) unsigned NOT NULL default '0', - `RepObjectiveValue` mediumint(9) NOT NULL default '0', - `RequiredMinRepFaction` smallint(5) unsigned NOT NULL default '0', - `RequiredMinRepValue` mediumint(9) NOT NULL default '0', - `RequiredMaxRepFaction` smallint(5) unsigned NOT NULL default '0', - `RequiredMaxRepValue` mediumint(9) NOT NULL default '0', - `SuggestedPlayers` tinyint(3) unsigned NOT NULL default '0', - `LimitTime` int(10) unsigned NOT NULL default '0', - `QuestFlags` smallint(5) unsigned NOT NULL default '0', - `SpecialFlags` tinyint(3) unsigned NOT NULL default '0', - `CharTitleId` tinyint(3) unsigned NOT NULL default '0', - `PrevQuestId` mediumint(9) NOT NULL default '0', - `NextQuestId` mediumint(9) NOT NULL default '0', - `ExclusiveGroup` mediumint(9) NOT NULL default '0', - `NextQuestInChain` mediumint(8) unsigned NOT NULL default '0', - `SrcItemId` mediumint(8) unsigned NOT NULL default '0', - `SrcItemCount` tinyint(3) unsigned NOT NULL default '0', - `SrcSpell` mediumint(8) unsigned NOT NULL default '0', - `Title` text, - `Details` text, - `Objectives` text, - `OfferRewardText` text, - `RequestItemsText` text, - `EndText` text, - `ObjectiveText1` text, - `ObjectiveText2` text, - `ObjectiveText3` text, - `ObjectiveText4` text, - `ReqItemId1` mediumint(8) unsigned NOT NULL default '0', - `ReqItemId2` mediumint(8) unsigned NOT NULL default '0', - `ReqItemId3` mediumint(8) unsigned NOT NULL default '0', - `ReqItemId4` mediumint(8) unsigned NOT NULL default '0', - `ReqItemCount1` smallint(5) unsigned NOT NULL default '0', - `ReqItemCount2` smallint(5) unsigned NOT NULL default '0', - `ReqItemCount3` smallint(5) unsigned NOT NULL default '0', - `ReqItemCount4` smallint(5) unsigned NOT NULL default '0', - `ReqSourceId1` mediumint(8) unsigned NOT NULL default '0', - `ReqSourceId2` mediumint(8) unsigned NOT NULL default '0', - `ReqSourceId3` mediumint(8) unsigned NOT NULL default '0', - `ReqSourceId4` mediumint(8) unsigned NOT NULL default '0', - `ReqSourceCount1` smallint(5) unsigned NOT NULL default '0', - `ReqSourceCount2` smallint(5) unsigned NOT NULL default '0', - `ReqSourceCount3` smallint(5) unsigned NOT NULL default '0', - `ReqSourceCount4` smallint(5) unsigned NOT NULL default '0', - `ReqSourceRef1` tinyint(3) unsigned NOT NULL default '0', - `ReqSourceRef2` tinyint(3) unsigned NOT NULL default '0', - `ReqSourceRef3` tinyint(3) unsigned NOT NULL default '0', - `ReqSourceRef4` tinyint(3) unsigned NOT NULL default '0', - `ReqCreatureOrGOId1` mediumint(9) NOT NULL default '0', - `ReqCreatureOrGOId2` mediumint(9) NOT NULL default '0', - `ReqCreatureOrGOId3` mediumint(9) NOT NULL default '0', - `ReqCreatureOrGOId4` mediumint(9) NOT NULL default '0', - `ReqCreatureOrGOCount1` smallint(5) unsigned NOT NULL default '0', - `ReqCreatureOrGOCount2` smallint(5) unsigned NOT NULL default '0', - `ReqCreatureOrGOCount3` smallint(5) unsigned NOT NULL default '0', - `ReqCreatureOrGOCount4` smallint(5) unsigned NOT NULL default '0', - `ReqSpellCast1` mediumint(8) unsigned NOT NULL default '0', - `ReqSpellCast2` mediumint(8) unsigned NOT NULL default '0', - `ReqSpellCast3` mediumint(8) unsigned NOT NULL default '0', - `ReqSpellCast4` mediumint(8) unsigned NOT NULL default '0', - `RewChoiceItemId1` mediumint(8) unsigned NOT NULL default '0', - `RewChoiceItemId2` mediumint(8) unsigned NOT NULL default '0', - `RewChoiceItemId3` mediumint(8) unsigned NOT NULL default '0', - `RewChoiceItemId4` mediumint(8) unsigned NOT NULL default '0', - `RewChoiceItemId5` mediumint(8) unsigned NOT NULL default '0', - `RewChoiceItemId6` mediumint(8) unsigned NOT NULL default '0', - `RewChoiceItemCount1` smallint(5) unsigned NOT NULL default '0', - `RewChoiceItemCount2` smallint(5) unsigned NOT NULL default '0', - `RewChoiceItemCount3` smallint(5) unsigned NOT NULL default '0', - `RewChoiceItemCount4` smallint(5) unsigned NOT NULL default '0', - `RewChoiceItemCount5` smallint(5) unsigned NOT NULL default '0', - `RewChoiceItemCount6` smallint(5) unsigned NOT NULL default '0', - `RewItemId1` mediumint(8) unsigned NOT NULL default '0', - `RewItemId2` mediumint(8) unsigned NOT NULL default '0', - `RewItemId3` mediumint(8) unsigned NOT NULL default '0', - `RewItemId4` mediumint(8) unsigned NOT NULL default '0', - `RewItemCount1` smallint(5) unsigned NOT NULL default '0', - `RewItemCount2` smallint(5) unsigned NOT NULL default '0', - `RewItemCount3` smallint(5) unsigned NOT NULL default '0', - `RewItemCount4` smallint(5) unsigned NOT NULL default '0', - `RewRepFaction1` smallint(5) unsigned NOT NULL default '0' COMMENT 'faction id from Faction.dbc in this case', - `RewRepFaction2` smallint(5) unsigned NOT NULL default '0' COMMENT 'faction id from Faction.dbc in this case', - `RewRepFaction3` smallint(5) unsigned NOT NULL default '0' COMMENT 'faction id from Faction.dbc in this case', - `RewRepFaction4` smallint(5) unsigned NOT NULL default '0' COMMENT 'faction id from Faction.dbc in this case', - `RewRepFaction5` smallint(5) unsigned NOT NULL default '0' COMMENT 'faction id from Faction.dbc in this case', - `RewRepValue1` mediumint(9) NOT NULL default '0', - `RewRepValue2` mediumint(9) NOT NULL default '0', - `RewRepValue3` mediumint(9) NOT NULL default '0', - `RewRepValue4` mediumint(9) NOT NULL default '0', - `RewRepValue5` mediumint(9) NOT NULL default '0', - `RewHonorableKills` mediumint(9) unsigned NOT NULL default '0', - `RewOrReqMoney` int(11) NOT NULL default '0', - `RewMoneyMaxLevel` int(10) unsigned NOT NULL default '0', - `RewSpell` mediumint(8) unsigned NOT NULL default '0', - `RewSpellCast` mediumint(8) unsigned NOT NULL default '0', - `RewMailTemplateId` mediumint(8) unsigned NOT NULL default '0', - `RewMailDelaySecs` int(11) unsigned NOT NULL default '0', - `PointMapId` smallint(5) unsigned NOT NULL default '0', - `PointX` float NOT NULL default '0', - `PointY` float NOT NULL default '0', - `PointOpt` mediumint(8) unsigned NOT NULL default '0', - `DetailsEmote1` smallint(5) unsigned NOT NULL default '0', - `DetailsEmote2` smallint(5) unsigned NOT NULL default '0', - `DetailsEmote3` smallint(5) unsigned NOT NULL default '0', - `DetailsEmote4` smallint(5) unsigned NOT NULL default '0', - `IncompleteEmote` smallint(5) unsigned NOT NULL default '0', - `CompleteEmote` smallint(5) unsigned NOT NULL default '0', - `OfferRewardEmote1` smallint(5) unsigned NOT NULL default '0', - `OfferRewardEmote2` smallint(5) unsigned NOT NULL default '0', - `OfferRewardEmote3` smallint(5) unsigned NOT NULL default '0', - `OfferRewardEmote4` smallint(5) unsigned NOT NULL default '0', - `StartScript` mediumint(8) unsigned NOT NULL default '0', - `CompleteScript` mediumint(8) unsigned NOT NULL default '0', - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Quest System'; - --- --- Dumping data for table `quest_template` --- - -LOCK TABLES `quest_template` WRITE; -/*!40000 ALTER TABLE `quest_template` DISABLE KEYS */; -/*!40000 ALTER TABLE `quest_template` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `reference_loot_template` --- - -DROP TABLE IF EXISTS `reference_loot_template`; -CREATE TABLE `reference_loot_template` ( - `entry` mediumint(8) unsigned NOT NULL default '0', - `item` mediumint(8) unsigned NOT NULL default '0', - `ChanceOrQuestChance` float NOT NULL default '100', - `groupid` tinyint(3) unsigned NOT NULL default '0', - `mincountOrRef` mediumint(9) NOT NULL default '1', - `maxcount` tinyint(3) unsigned NOT NULL default '1', - `lootcondition` tinyint(3) unsigned NOT NULL default '0', - `condition_value1` mediumint(8) unsigned NOT NULL default '0', - `condition_value2` mediumint(8) unsigned NOT NULL default '0', - PRIMARY KEY (`entry`,`item`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System'; - --- --- Dumping data for table `reference_loot_template` --- - -LOCK TABLES `reference_loot_template` WRITE; -/*!40000 ALTER TABLE `reference_loot_template` DISABLE KEYS */; -/*!40000 ALTER TABLE `reference_loot_template` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `reserved_name` --- - -DROP TABLE IF EXISTS `reserved_name`; -CREATE TABLE `reserved_name` ( - `name` varchar(12) NOT NULL default '', - PRIMARY KEY (`name`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Player Reserved Names'; - --- --- Dumping data for table `reserved_name` --- - -LOCK TABLES `reserved_name` WRITE; -/*!40000 ALTER TABLE `reserved_name` DISABLE KEYS */; -/*!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` --- - -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` tinyint(3) unsigned NOT NULL default '0', - `type` tinyint(3) unsigned NOT NULL default '0', - `language` tinyint(3) 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 `skill_discovery_template` --- - -DROP TABLE IF EXISTS `skill_discovery_template`; -CREATE TABLE `skill_discovery_template` ( - `spellId` mediumint(8) unsigned NOT NULL default '0' COMMENT 'SpellId of the discoverable spell', - `reqSpell` mediumint(8) unsigned NOT NULL default '0' COMMENT 'spell requirement', - `chance` float NOT NULL default '0' COMMENT 'chance to discover', - PRIMARY KEY (`spellId`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Skill Discovery System'; - --- --- Dumping data for table `skill_discovery_template` --- - -LOCK TABLES `skill_discovery_template` WRITE; -/*!40000 ALTER TABLE `skill_discovery_template` DISABLE KEYS */; -/*!40000 ALTER TABLE `skill_discovery_template` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `skill_extra_item_template` --- - -DROP TABLE IF EXISTS `skill_extra_item_template`; -CREATE TABLE `skill_extra_item_template` ( - `spellId` mediumint(8) unsigned NOT NULL default '0' COMMENT 'SpellId of the item creation spell', - `requiredSpecialization` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Specialization spell id', - `additionalCreateChance` float NOT NULL default '0' COMMENT 'chance to create add', - `additionalMaxNum` tinyint(3) unsigned NOT NULL default '0' COMMENT 'max num of adds', - PRIMARY KEY (`spellId`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Skill Specialization System'; - --- --- Dumping data for table `skill_extra_item_template` --- - -LOCK TABLES `skill_extra_item_template` WRITE; -/*!40000 ALTER TABLE `skill_extra_item_template` DISABLE KEYS */; -/*!40000 ALTER TABLE `skill_extra_item_template` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `skill_fishing_base_level` --- - -DROP TABLE IF EXISTS `skill_fishing_base_level`; -CREATE TABLE `skill_fishing_base_level` ( - `entry` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Area identifier', - `skill` smallint(6) NOT NULL default '0' COMMENT 'Base skill level requirement', - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Fishing system'; - --- --- Dumping data for table `skill_fishing_base_level` --- - -LOCK TABLES `skill_fishing_base_level` WRITE; -/*!40000 ALTER TABLE `skill_fishing_base_level` DISABLE KEYS */; -/*!40000 ALTER TABLE `skill_fishing_base_level` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `skinning_loot_template` --- - -DROP TABLE IF EXISTS `skinning_loot_template`; -CREATE TABLE `skinning_loot_template` ( - `entry` mediumint(8) unsigned NOT NULL default '0', - `item` mediumint(8) unsigned NOT NULL default '0', - `ChanceOrQuestChance` float NOT NULL default '100', - `groupid` tinyint(3) unsigned NOT NULL default '0', - `mincountOrRef` mediumint(9) NOT NULL default '1', - `maxcount` tinyint(3) unsigned NOT NULL default '1', - `lootcondition` tinyint(3) unsigned NOT NULL default '0', - `condition_value1` mediumint(8) unsigned NOT NULL default '0', - `condition_value2` mediumint(8) unsigned NOT NULL default '0', - PRIMARY KEY (`entry`,`item`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System'; - --- --- Dumping data for table `skinning_loot_template` --- - -LOCK TABLES `skinning_loot_template` WRITE; -/*!40000 ALTER TABLE `skinning_loot_template` DISABLE KEYS */; -/*!40000 ALTER TABLE `skinning_loot_template` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `spell_affect` --- - -DROP TABLE IF EXISTS `spell_affect`; -CREATE TABLE `spell_affect` ( - `entry` smallint(5) unsigned NOT NULL default '0', - `effectId` tinyint(3) unsigned NOT NULL default '0', - `SpellFamilyMask` bigint(20) unsigned NOT NULL default '0', - PRIMARY KEY (`entry`,`effectId`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `spell_affect` --- - -LOCK TABLES `spell_affect` WRITE; -/*!40000 ALTER TABLE `spell_affect` DISABLE KEYS */; -/*!40000 ALTER TABLE `spell_affect` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `spell_chain` --- - -DROP TABLE IF EXISTS `spell_chain`; -CREATE TABLE `spell_chain` ( - `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` --- - -LOCK TABLES `spell_chain` WRITE; -/*!40000 ALTER TABLE `spell_chain` DISABLE KEYS */; -/*!40000 ALTER TABLE `spell_chain` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `spell_disabled` --- - -DROP TABLE IF EXISTS `spell_disabled`; -CREATE TABLE `spell_disabled` ( - `entry` int(11) unsigned NOT NULL default '0' COMMENT 'Spell entry', - `disable_mask` int(8) unsigned NOT NULL default '0', - `comment` varchar(64) NOT NULL default '', - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Disabled Spell System'; - --- --- Dumping data for table `spell_disabled` --- - -LOCK TABLES `spell_disabled` WRITE; -/*!40000 ALTER TABLE `spell_disabled` DISABLE KEYS */; -/*!40000 ALTER TABLE `spell_disabled` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `spell_elixir` --- - -DROP TABLE IF EXISTS `spell_elixir`; -CREATE TABLE `spell_elixir` ( - `entry` int(11) unsigned NOT NULL default '0' COMMENT 'SpellId of potion', - `mask` tinyint(1) unsigned NOT NULL default '0' COMMENT 'Mask 0x1 battle 0x2 guardian 0x3 flask 0x7 unstable flasks 0xB shattrath flasks', - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Spell System'; - --- --- Dumping data for table `spell_elixir` --- - -LOCK TABLES `spell_elixir` WRITE; -/*!40000 ALTER TABLE `spell_elixir` DISABLE KEYS */; -/*!40000 ALTER TABLE `spell_elixir` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `spell_learn_spell` --- - -DROP TABLE IF EXISTS `spell_learn_spell`; -CREATE TABLE `spell_learn_spell` ( - `entry` smallint(5) unsigned NOT NULL default '0', - `SpellID` smallint(5) unsigned NOT NULL default '0', - PRIMARY KEY (`entry`,`SpellID`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Item System'; - --- --- Dumping data for table `spell_learn_spell` --- - -LOCK TABLES `spell_learn_spell` WRITE; -/*!40000 ALTER TABLE `spell_learn_spell` DISABLE KEYS */; -/*!40000 ALTER TABLE `spell_learn_spell` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `spell_pet_auras` --- - -DROP TABLE IF EXISTS `spell_pet_auras`; -CREATE TABLE `spell_pet_auras` ( - `spell` mediumint(8) unsigned NOT NULL COMMENT 'dummy spell id', - `pet` mediumint(8) unsigned NOT NULL default '0' COMMENT 'pet id; 0 = all', - `aura` mediumint(8) unsigned NOT NULL COMMENT 'pet aura id', - PRIMARY KEY (`spell`,`pet`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - --- --- Dumping data for table `spell_pet_auras` --- - -LOCK TABLES `spell_pet_auras` WRITE; -/*!40000 ALTER TABLE `spell_pet_auras` DISABLE KEYS */; -/*!40000 ALTER TABLE `spell_pet_auras` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `spell_proc_event` --- - -DROP TABLE IF EXISTS `spell_proc_event`; -CREATE TABLE `spell_proc_event` ( - `entry` smallint(5) unsigned NOT NULL default '0', - `SchoolMask` tinyint(4) NOT NULL default '0', - `Category` smallint(6) NOT NULL default '0', - `SkillID` smallint(6) NOT NULL default '0', - `SpellFamilyName` smallint(5) unsigned NOT NULL default '0', - `SpellFamilyMask` bigint(20) unsigned NOT NULL default '0', - `procFlags` int(10) unsigned NOT NULL default '0', - `ppmRate` float NOT NULL default '0', - `cooldown` int(10) unsigned NOT NULL default '0', - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `spell_proc_event` --- - -LOCK TABLES `spell_proc_event` WRITE; -/*!40000 ALTER TABLE `spell_proc_event` DISABLE KEYS */; -/*!40000 ALTER TABLE `spell_proc_event` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `spell_script_target` --- - -DROP TABLE IF EXISTS `spell_script_target`; -CREATE TABLE `spell_script_target` ( - `entry` mediumint(8) unsigned NOT NULL, - `type` tinyint(3) unsigned NOT NULL default '0', - `targetEntry` mediumint(8) unsigned NOT NULL default '0', - UNIQUE KEY `entry_type_target` (`entry`,`type`,`targetEntry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Spell System'; - --- --- Dumping data for table `spell_script_target` --- - -LOCK TABLES `spell_script_target` WRITE; -/*!40000 ALTER TABLE `spell_script_target` DISABLE KEYS */; -/*!40000 ALTER TABLE `spell_script_target` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `spell_scripts` --- - -DROP TABLE IF EXISTS `spell_scripts`; -CREATE TABLE `spell_scripts` ( - `id` mediumint(8) unsigned NOT NULL default '0', - `delay` int(10) unsigned NOT NULL default '0', - `command` mediumint(8) unsigned NOT NULL default '0', - `datalong` mediumint(8) unsigned NOT NULL default '0', - `datalong2` int(10) unsigned NOT NULL default '0', - `datatext` text character set latin1 NOT NULL, - `x` float NOT NULL default '0', - `y` float NOT NULL default '0', - `z` float NOT NULL default '0', - `o` float NOT NULL default '0' -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `spell_scripts` --- - -LOCK TABLES `spell_scripts` WRITE; -/*!40000 ALTER TABLE `spell_scripts` DISABLE KEYS */; -/*!40000 ALTER TABLE `spell_scripts` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `spell_target_position` --- - -DROP TABLE IF EXISTS `spell_target_position`; -CREATE TABLE `spell_target_position` ( - `id` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Identifier', - `target_map` smallint(5) unsigned NOT NULL default '0', - `target_position_x` float NOT NULL default '0', - `target_position_y` float NOT NULL default '0', - `target_position_z` float NOT NULL default '0', - `target_orientation` float NOT NULL default '0', - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Spell System'; - --- --- Dumping data for table `spell_target_position` --- - -LOCK TABLES `spell_target_position` WRITE; -/*!40000 ALTER TABLE `spell_target_position` DISABLE KEYS */; -/*!40000 ALTER TABLE `spell_target_position` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `spell_threat` --- - -DROP TABLE IF EXISTS `spell_threat`; -CREATE TABLE `spell_threat` ( - `entry` mediumint(8) unsigned NOT NULL, - `Threat` smallint(6) NOT NULL, - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED; - --- --- Dumping data for table `spell_threat` --- - -LOCK TABLES `spell_threat` WRITE; -/*!40000 ALTER TABLE `spell_threat` DISABLE KEYS */; -/*!40000 ALTER TABLE `spell_threat` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `transports` --- - -DROP TABLE IF EXISTS `transports`; -CREATE TABLE `transports` ( - `entry` mediumint(8) unsigned NOT NULL default '0', - `name` text, - `period` mediumint(8) unsigned NOT NULL default '0', - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Transports'; - --- --- Dumping data for table `transports` --- - -LOCK TABLES `transports` WRITE; -/*!40000 ALTER TABLE `transports` DISABLE KEYS */; -/*!40000 ALTER TABLE `transports` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `trinity_string` --- - -DROP TABLE IF EXISTS `trinity_string`; -CREATE TABLE `trinity_string` ( - `entry` mediumint(8) unsigned NOT NULL default '0', - `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, - PRIMARY KEY (`entry`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- --- Dumping data for table `trinity_string` --- - -LOCK TABLES `trinity_string` WRITE; -/*!40000 ALTER TABLE `trinity_string` DISABLE KEYS */; -/*!40000 ALTER TABLE `trinity_string` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `uptime` --- - -DROP TABLE IF EXISTS `uptime`; -CREATE TABLE `uptime` ( - `starttime` bigint(20) unsigned NOT NULL default '0', - `startstring` varchar(64) NOT NULL default '', - `uptime` bigint(20) unsigned NOT NULL default '0', - `maxplayers` smallint(5) unsigned NOT NULL default '0', - PRIMARY KEY (`starttime`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Uptime system'; - --- --- Dumping data for table `uptime` --- - -LOCK TABLES `uptime` WRITE; -/*!40000 ALTER TABLE `uptime` DISABLE KEYS */; -/*!40000 ALTER TABLE `uptime` ENABLE KEYS */; -UNLOCK TABLES; -/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; - -/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; -/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; -/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; -/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; - --- Dump completed on 2008-10-14 13:23:35 +-- MySQL dump 10.11 +-- +-- Host: localhost Database: world +-- ------------------------------------------------------ +-- Server version 5.0.34-log + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `areatrigger_involvedrelation` +-- + +DROP TABLE IF EXISTS `areatrigger_involvedrelation`; +CREATE TABLE `areatrigger_involvedrelation` ( + `id` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Identifier', + `quest` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Quest Identifier', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Trigger System'; + +-- +-- Dumping data for table `areatrigger_involvedrelation` +-- + +LOCK TABLES `areatrigger_involvedrelation` WRITE; +/*!40000 ALTER TABLE `areatrigger_involvedrelation` DISABLE KEYS */; +/*!40000 ALTER TABLE `areatrigger_involvedrelation` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `areatrigger_scripts` +-- + +DROP TABLE IF EXISTS `areatrigger_scripts`; +CREATE TABLE `areatrigger_scripts` ( + `entry` mediumint(8) NOT NULL, + `ScriptName` char(64) NOT NULL, + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `areatrigger_scripts` +-- + +LOCK TABLES `areatrigger_scripts` WRITE; +/*!40000 ALTER TABLE `areatrigger_scripts` DISABLE KEYS */; +/*!40000 ALTER TABLE `areatrigger_scripts` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `areatrigger_tavern` +-- + +DROP TABLE IF EXISTS `areatrigger_tavern`; +CREATE TABLE `areatrigger_tavern` ( + `id` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Identifier', + `name` text, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Trigger System'; + +-- +-- Dumping data for table `areatrigger_tavern` +-- + +LOCK TABLES `areatrigger_tavern` WRITE; +/*!40000 ALTER TABLE `areatrigger_tavern` DISABLE KEYS */; +/*!40000 ALTER TABLE `areatrigger_tavern` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `areatrigger_teleport` +-- + +DROP TABLE IF EXISTS `areatrigger_teleport`; +CREATE TABLE `areatrigger_teleport` ( + `id` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Identifier', + `name` text, + `required_level` tinyint(3) unsigned NOT NULL default '0', + `required_item` mediumint(8) unsigned NOT NULL default '0', + `required_item2` mediumint(8) unsigned NOT NULL default '0', + `heroic_key` mediumint(8) unsigned NOT NULL default '0', + `heroic_key2` mediumint(8) unsigned NOT NULL default '0', + `required_quest_done` int(11) unsigned NOT NULL default '0', + `required_failed_text` text, + `target_map` smallint(5) unsigned NOT NULL default '0', + `target_position_x` float NOT NULL default '0', + `target_position_y` float NOT NULL default '0', + `target_position_z` float NOT NULL default '0', + `target_orientation` float NOT NULL default '0', + PRIMARY KEY (`id`), + FULLTEXT KEY `name` (`name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Trigger System'; + +-- +-- Dumping data for table `areatrigger_teleport` +-- + +LOCK TABLES `areatrigger_teleport` WRITE; +/*!40000 ALTER TABLE `areatrigger_teleport` DISABLE KEYS */; +/*!40000 ALTER TABLE `areatrigger_teleport` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `battleground_template` +-- + +DROP TABLE IF EXISTS `battleground_template`; +CREATE TABLE `battleground_template` ( + `id` mediumint(8) unsigned NOT NULL, + `MinPlayersPerTeam` smallint(5) unsigned NOT NULL default '0', + `MaxPlayersPerTeam` smallint(5) unsigned NOT NULL default '0', + `MinLvl` tinyint(3) unsigned NOT NULL default '0', + `MaxLvl` tinyint(3) unsigned NOT NULL default '0', + `AllianceStartLoc` mediumint(8) unsigned NOT NULL, + `AllianceStartO` float NOT NULL, + `HordeStartLoc` mediumint(8) unsigned NOT NULL, + `HordeStartO` float NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `battleground_template` +-- + +LOCK TABLES `battleground_template` WRITE; +/*!40000 ALTER TABLE `battleground_template` DISABLE KEYS */; +/*!40000 ALTER TABLE `battleground_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `battlemaster_entry` +-- + +DROP TABLE IF EXISTS `battlemaster_entry`; +CREATE TABLE `battlemaster_entry` ( + `entry` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Entry of a creature', + `bg_template` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Battleground template id', + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `battlemaster_entry` +-- + +LOCK TABLES `battlemaster_entry` WRITE; +/*!40000 ALTER TABLE `battlemaster_entry` DISABLE KEYS */; +/*!40000 ALTER TABLE `battlemaster_entry` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `command` +-- + +DROP TABLE IF EXISTS `command`; +CREATE TABLE `command` ( + `name` varchar(50) NOT NULL default '', + `security` tinyint(3) unsigned NOT NULL default '0', + `help` longtext, + PRIMARY KEY (`name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Chat System'; + +-- +-- Dumping data for table `command` +-- + +LOCK TABLES `command` WRITE; +/*!40000 ALTER TABLE `command` DISABLE KEYS */; +/*!40000 ALTER TABLE `command` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `creature` +-- + +DROP TABLE IF EXISTS `creature`; +CREATE TABLE `creature` ( + `guid` int(10) unsigned NOT NULL auto_increment COMMENT 'Global Unique Identifier', + `id` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Creature Identifier', + `map` smallint(5) unsigned NOT NULL default '0' COMMENT 'Map Identifier', + `spawnMask` tinyint(3) unsigned NOT NULL default '1', + `modelid` mediumint(8) unsigned NOT NULL default '0', + `equipment_id` mediumint(9) 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', + `orientation` float NOT NULL default '0', + `spawntimesecs` int(10) unsigned NOT NULL default '120', + `spawndist` float NOT NULL default '5', + `currentwaypoint` mediumint(8) unsigned NOT NULL default '0', + `curhealth` int(10) unsigned NOT NULL default '1', + `curmana` int(10) unsigned NOT NULL default '0', + `DeathState` tinyint(3) unsigned NOT NULL default '0', + `MovementType` tinyint(3) unsigned NOT NULL default '0', + PRIMARY KEY (`guid`), + KEY `idx_map` (`map`), + KEY `idx_id` (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Creature System'; + +-- +-- Dumping data for table `creature` +-- + +LOCK TABLES `creature` WRITE; +/*!40000 ALTER TABLE `creature` DISABLE KEYS */; +/*!40000 ALTER TABLE `creature` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `creature_addon` +-- + +DROP TABLE IF EXISTS `creature_addon`; +CREATE TABLE `creature_addon` ( + `guid` int(10) unsigned NOT NULL default '0', + `path_id` int(11) unsigned NOT NULL default '0', + `mount` mediumint(8) unsigned NOT NULL default '0', + `bytes0` int(10) unsigned NOT NULL default '0', + `bytes1` int(10) unsigned NOT NULL default '0', + `bytes2` int(10) unsigned NOT NULL default '0', + `emote` int(10) unsigned NOT NULL default '0', + `moveflags` int(10) unsigned NOT NULL default '0', + `auras` text, + PRIMARY KEY (`guid`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `creature_addon` +-- + +LOCK TABLES `creature_addon` WRITE; +/*!40000 ALTER TABLE `creature_addon` DISABLE KEYS */; +/*!40000 ALTER TABLE `creature_addon` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `creature_equip_template` +-- + +DROP TABLE IF EXISTS `creature_equip_template`; +CREATE TABLE `creature_equip_template` ( + `entry` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Unique entry', + `equipmodel1` mediumint(8) unsigned NOT NULL default '0', + `equipmodel2` mediumint(8) unsigned NOT NULL default '0', + `equipmodel3` mediumint(8) unsigned NOT NULL default '0', + `equipinfo1` int(10) unsigned NOT NULL default '0', + `equipinfo2` int(10) unsigned NOT NULL default '0', + `equipinfo3` int(10) unsigned NOT NULL default '0', + `equipslot1` int(11) NOT NULL default '0', + `equipslot2` int(11) NOT NULL default '0', + `equipslot3` int(11) NOT NULL default '0', + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Creature System (Equipment)'; + +-- +-- Dumping data for table `creature_equip_template` +-- + +LOCK TABLES `creature_equip_template` WRITE; +/*!40000 ALTER TABLE `creature_equip_template` DISABLE KEYS */; +/*!40000 ALTER TABLE `creature_equip_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `creature_involvedrelation` +-- + +DROP TABLE IF EXISTS `creature_involvedrelation`; +CREATE TABLE `creature_involvedrelation` ( + `id` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Identifier', + `quest` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Quest Identifier', + PRIMARY KEY (`id`,`quest`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Creature System'; + +-- +-- Dumping data for table `creature_involvedrelation` +-- + +LOCK TABLES `creature_involvedrelation` WRITE; +/*!40000 ALTER TABLE `creature_involvedrelation` DISABLE KEYS */; +/*!40000 ALTER TABLE `creature_involvedrelation` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `creature_loot_template` +-- + +DROP TABLE IF EXISTS `creature_loot_template`; +CREATE TABLE `creature_loot_template` ( + `entry` mediumint(8) unsigned NOT NULL default '0', + `item` mediumint(8) unsigned NOT NULL default '0', + `ChanceOrQuestChance` float NOT NULL default '100', + `groupid` tinyint(3) unsigned NOT NULL default '0', + `mincountOrRef` mediumint(9) NOT NULL default '1', + `maxcount` tinyint(3) unsigned NOT NULL default '1', + `lootcondition` tinyint(3) unsigned NOT NULL default '0', + `condition_value1` mediumint(8) unsigned NOT NULL default '0', + `condition_value2` mediumint(8) unsigned NOT NULL default '0', + PRIMARY KEY (`entry`,`item`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Loot System'; + +-- +-- Dumping data for table `creature_loot_template` +-- + +LOCK TABLES `creature_loot_template` WRITE; +/*!40000 ALTER TABLE `creature_loot_template` DISABLE KEYS */; +/*!40000 ALTER TABLE `creature_loot_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `creature_model_info` +-- + +DROP TABLE IF EXISTS `creature_model_info`; +CREATE TABLE `creature_model_info` ( + `modelid` mediumint(8) unsigned NOT NULL default '0', + `bounding_radius` float NOT NULL default '0', + `combat_reach` float NOT NULL default '0', + `gender` tinyint(3) unsigned NOT NULL default '2', + `modelid_other_gender` mediumint(8) unsigned NOT NULL default '0', + PRIMARY KEY (`modelid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Creature System (Model related info)'; + +-- +-- Dumping data for table `creature_model_info` +-- + +LOCK TABLES `creature_model_info` WRITE; +/*!40000 ALTER TABLE `creature_model_info` DISABLE KEYS */; +/*!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` +-- + +DROP TABLE IF EXISTS `creature_onkill_reputation`; +CREATE TABLE `creature_onkill_reputation` ( + `creature_id` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Creature Identifier', + `RewOnKillRepFaction1` smallint(6) NOT NULL default '0', + `RewOnKillRepFaction2` smallint(6) NOT NULL default '0', + `MaxStanding1` tinyint(4) NOT NULL default '0', + `IsTeamAward1` tinyint(4) NOT NULL default '0', + `RewOnKillRepValue1` mediumint(9) NOT NULL default '0', + `MaxStanding2` tinyint(4) NOT NULL default '0', + `IsTeamAward2` tinyint(4) NOT NULL default '0', + `RewOnKillRepValue2` mediumint(9) NOT NULL default '0', + `TeamDependent` tinyint(3) unsigned NOT NULL default '0', + PRIMARY KEY (`creature_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Creature OnKill Reputation gain'; + +-- +-- Dumping data for table `creature_onkill_reputation` +-- + +LOCK TABLES `creature_onkill_reputation` WRITE; +/*!40000 ALTER TABLE `creature_onkill_reputation` DISABLE KEYS */; +/*!40000 ALTER TABLE `creature_onkill_reputation` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `creature_questrelation` +-- + +DROP TABLE IF EXISTS `creature_questrelation`; +CREATE TABLE `creature_questrelation` ( + `id` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Identifier', + `quest` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Quest Identifier', + PRIMARY KEY (`id`,`quest`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Creature System'; + +-- +-- Dumping data for table `creature_questrelation` +-- + +LOCK TABLES `creature_questrelation` WRITE; +/*!40000 ALTER TABLE `creature_questrelation` DISABLE KEYS */; +/*!40000 ALTER TABLE `creature_questrelation` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `creature_respawn` +-- + +DROP TABLE IF EXISTS `creature_respawn`; +CREATE TABLE `creature_respawn` ( + `guid` int(10) unsigned NOT NULL default '0' COMMENT 'Global Unique Identifier', + `respawntime` bigint(20) NOT NULL default '0', + `instance` mediumint(8) unsigned NOT NULL default '0', + PRIMARY KEY (`guid`,`instance`), + KEY `instance` (`instance`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Grid Loading System'; + +-- +-- Dumping data for table `creature_respawn` +-- + +LOCK TABLES `creature_respawn` WRITE; +/*!40000 ALTER TABLE `creature_respawn` DISABLE KEYS */; +/*!40000 ALTER TABLE `creature_respawn` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `creature_template` +-- + +DROP TABLE IF EXISTS `creature_template`; +CREATE TABLE `creature_template` ( + `entry` mediumint(8) unsigned NOT NULL default '0', + `heroic_entry` mediumint(8) unsigned NOT NULL default '0', + `modelid_A` mediumint(8) unsigned NOT NULL default '0', + `modelid_A2` mediumint(8) unsigned NOT NULL default '0', + `modelid_H` mediumint(8) unsigned NOT NULL default '0', + `modelid_H2` mediumint(8) unsigned NOT NULL default '0', + `name` char(100) NOT NULL default '0', + `subname` char(100) default NULL, + `IconName` char(100) default NULL, + `minlevel` tinyint(3) unsigned NOT NULL default '1', + `maxlevel` tinyint(3) unsigned NOT NULL default '1', + `minhealth` int(10) unsigned NOT NULL default '0', + `maxhealth` int(10) unsigned NOT NULL default '0', + `minmana` int(10) unsigned NOT NULL default '0', + `maxmana` int(10) unsigned NOT NULL default '0', + `armor` mediumint(8) unsigned NOT NULL default '0', + `faction_A` smallint(5) unsigned NOT NULL default '0', + `faction_H` smallint(5) unsigned NOT NULL default '0', + `npcflag` int(10) unsigned NOT NULL default '0', + `speed` float default '1', + `scale` float NOT NULL default '1', + `rank` tinyint(3) unsigned NOT NULL default '0', + `mindmg` float NOT NULL default '0', + `maxdmg` float NOT NULL default '0', + `dmgschool` tinyint(4) NOT NULL default '0', + `attackpower` int(10) unsigned NOT NULL default '0', + `baseattacktime` int(10) unsigned NOT NULL default '0', + `rangeattacktime` int(10) unsigned NOT NULL default '0', + `flags` int(10) unsigned NOT NULL default '0', + `dynamicflags` int(10) unsigned NOT NULL default '0', + `family` tinyint(4) NOT NULL default '0', + `trainer_type` tinyint(4) NOT NULL default '0', + `trainer_spell` mediumint(8) unsigned NOT NULL default '0', + `class` tinyint(3) unsigned NOT NULL default '0', + `race` tinyint(3) unsigned NOT NULL default '0', + `minrangedmg` float NOT NULL default '0', + `maxrangedmg` float NOT NULL default '0', + `rangedattackpower` smallint(5) unsigned NOT NULL default '0', + `type` tinyint(3) unsigned NOT NULL default '0', + `flag1` int(10) unsigned NOT NULL default '0', + `lootid` mediumint(8) unsigned NOT NULL default '0', + `pickpocketloot` mediumint(8) unsigned NOT NULL default '0', + `skinloot` mediumint(8) unsigned NOT NULL default '0', + `resistance1` smallint(5) NOT NULL default '0', + `resistance2` smallint(5) NOT NULL default '0', + `resistance3` smallint(5) NOT NULL default '0', + `resistance4` smallint(5) NOT NULL default '0', + `resistance5` smallint(5) NOT NULL default '0', + `resistance6` smallint(5) NOT NULL default '0', + `spell1` mediumint(8) unsigned NOT NULL default '0', + `spell2` mediumint(8) unsigned NOT NULL default '0', + `spell3` mediumint(8) unsigned NOT NULL default '0', + `spell4` mediumint(8) unsigned NOT NULL default '0', + `PetSpellDataId` mediumint(8) unsigned NOT NULL default '0', + `mingold` mediumint(8) unsigned NOT NULL default '0', + `maxgold` mediumint(8) unsigned NOT NULL default '0', + `AIName` char(64) NOT NULL default '', + `MovementType` tinyint(3) unsigned NOT NULL default '0', + `InhabitType` tinyint(3) unsigned NOT NULL default '3', + `RacialLeader` tinyint(3) unsigned NOT NULL default '0', + `RegenHealth` tinyint(3) unsigned NOT NULL default '1', + `equipment_id` mediumint(8) unsigned NOT NULL default '0', + `mechanic_immune_mask` int(10) unsigned NOT NULL default '0', + `flags_extra` int(10) unsigned NOT NULL default '0', + `ScriptName` char(64) NOT NULL default '', + PRIMARY KEY (`entry`), + KEY `idx_name` (`name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Creature System'; + +-- +-- Dumping data for table `creature_template` +-- + +LOCK TABLES `creature_template` WRITE; +/*!40000 ALTER TABLE `creature_template` DISABLE KEYS */; +/*!40000 ALTER TABLE `creature_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `creature_template_addon` +-- + +DROP TABLE IF EXISTS `creature_template_addon`; +CREATE TABLE `creature_template_addon` ( + `entry` mediumint(8) unsigned NOT NULL default '0', + `path_id' int(11) unsigned NOT NULL default '0', + `mount` mediumint(8) unsigned NOT NULL default '0', + `bytes0` int(10) unsigned NOT NULL default '0', + `bytes1` int(10) unsigned NOT NULL default '0', + `bytes2` int(10) unsigned NOT NULL default '0', + `emote` mediumint(8) unsigned NOT NULL default '0', + `moveflags` int(10) unsigned NOT NULL default '0', + `auras` text, + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `creature_template_addon` +-- + +LOCK TABLES `creature_template_addon` WRITE; +/*!40000 ALTER TABLE `creature_template_addon` DISABLE KEYS */; +/*!40000 ALTER TABLE `creature_template_addon` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `custom_texts` +-- + +DROP TABLE IF EXISTS `custom_texts`; +CREATE TABLE `custom_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='Custom Texts'; + +-- +-- Dumping data for table `custom_texts` +-- + +LOCK TABLES `custom_texts` WRITE; +/*!40000 ALTER TABLE `custom_texts` DISABLE KEYS */; +/*!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` +-- + +DROP TABLE IF EXISTS `disenchant_loot_template`; +CREATE TABLE `disenchant_loot_template` ( + `entry` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Recommended id selection: item_level*100 + item_quality', + `item` mediumint(8) unsigned NOT NULL default '0', + `ChanceOrQuestChance` float NOT NULL default '100', + `groupid` tinyint(3) unsigned NOT NULL default '0', + `mincountOrRef` mediumint(9) NOT NULL default '1', + `maxcount` tinyint(3) unsigned NOT NULL default '1', + `lootcondition` tinyint(3) unsigned NOT NULL default '0', + `condition_value1` mediumint(8) unsigned NOT NULL default '0', + `condition_value2` mediumint(8) unsigned NOT NULL default '0', + PRIMARY KEY (`entry`,`item`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System'; + +-- +-- Dumping data for table `disenchant_loot_template` +-- + +LOCK TABLES `disenchant_loot_template` WRITE; +/*!40000 ALTER TABLE `disenchant_loot_template` DISABLE KEYS */; +/*!40000 ALTER TABLE `disenchant_loot_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `event_scripts` +-- + +DROP TABLE IF EXISTS `event_scripts`; +CREATE TABLE `event_scripts` ( + `id` mediumint(8) unsigned NOT NULL default '0', + `delay` int(10) unsigned NOT NULL default '0', + `command` mediumint(8) unsigned NOT NULL default '0', + `datalong` mediumint(8) unsigned NOT NULL default '0', + `datalong2` int(10) unsigned NOT NULL default '0', + `datatext` text NOT NULL, + `x` float NOT NULL default '0', + `y` float NOT NULL default '0', + `z` float NOT NULL default '0', + `o` float NOT NULL default '0' +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `event_scripts` +-- + +LOCK TABLES `event_scripts` WRITE; +/*!40000 ALTER TABLE `event_scripts` DISABLE KEYS */; +/*!40000 ALTER TABLE `event_scripts` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `eventai_localized_texts` +-- + +DROP TABLE IF EXISTS `eventai_localized_texts`; +CREATE TABLE `eventai_localized_texts` ( + `id` int(11) unsigned NOT NULL auto_increment COMMENT 'Identifier', + `locale_1` varchar(255) NOT NULL default '', + `locale_2` varchar(255) NOT NULL default '', + `locale_3` varchar(255) NOT NULL default '', + `locale_4` varchar(255) NOT NULL default '', + `locale_5` varchar(255) NOT NULL default '', + `locale_6` varchar(255) NOT NULL default '', + `locale_7` varchar(255) NOT NULL default '', + `locale_8` varchar(255) NOT NULL default '', + `comment` varchar(255) NOT NULL default '' COMMENT 'Text Comment', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='EventAI Localized Text'; + +-- +-- Dumping data for table `eventai_localized_texts` +-- + +LOCK TABLES `eventai_localized_texts` WRITE; +/*!40000 ALTER TABLE `eventai_localized_texts` DISABLE KEYS */; +/*!40000 ALTER TABLE `eventai_localized_texts` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `eventai_scripts` +-- + +DROP TABLE IF EXISTS `eventai_scripts`; +CREATE TABLE `eventai_scripts` ( + `id` int(11) unsigned NOT NULL COMMENT 'Identifier' AUTO_INCREMENT, + `creature_id` int(11) unsigned NOT NULL default '0' COMMENT 'Creature Template Identifier', + `event_type` tinyint(5) unsigned NOT NULL default '0' COMMENT 'Event Type', + `event_inverse_phase_mask` int(11) signed NOT NULL default '0' COMMENT 'Mask which phases this event will not trigger in', + `event_chance` int(3) unsigned NOT NULL default '100', + `event_flags` int(3) unsigned NOT NULL default '0', + `event_param1` int(11) signed NOT NULL default '0', + `event_param2` int(11) signed NOT NULL default '0', + `event_param3` int(11) signed NOT NULL default '0', + `event_param4` int(11) signed NOT NULL default '0', + `action1_type` tinyint(5) unsigned NOT NULL default '0' COMMENT 'Action Type', + `action1_param1` int(11) signed NOT NULL default '0', + `action1_param2` int(11) signed NOT NULL default '0', + `action1_param3` int(11) signed NOT NULL default '0', + `action2_type` tinyint(5) unsigned NOT NULL default '0' COMMENT 'Action Type', + `action2_param1` int(11) signed NOT NULL default '0', + `action2_param2` int(11) signed NOT NULL default '0', + `action2_param3` int(11) signed NOT NULL default '0', + `action3_type` tinyint(5) unsigned NOT NULL default '0' COMMENT 'Action Type', + `action3_param1` int(11) signed NOT NULL default '0', + `action3_param2` int(11) signed NOT NULL default '0', + `action3_param3` int(11) signed NOT NULL default '0', + `comment` varchar(255) NOT NULL default '' COMMENT 'Event Comment', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='EventAI Scripts'; + +-- +-- Dumping data for table `eventai_scripts` +-- + +LOCK TABLES `eventai_scripts` WRITE; +/*!40000 ALTER TABLE `eventai_scripts` DISABLE KEYS */; +/*!40000 ALTER TABLE `eventai_scripts` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `eventai_summons` +-- + +DROP TABLE IF EXISTS `eventai_summons`; +CREATE TABLE `eventai_summons` ( + `id` int(11) unsigned NOT NULL COMMENT 'Location Identifier' AUTO_INCREMENT, + `position_x` float NOT NULL default '0', + `position_y` float NOT NULL default '0', + `position_z` float NOT NULL default '0', + `orientation` float NOT NULL default '0', + `spawntimesecs` int(11) unsigned NOT NULL default '120', + `comment` varchar(255) NOT NULL default '' COMMENT 'Summon Comment', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='EventAI Summoning Locations'; + +-- +-- Dumping data for table `eventai_summons` +-- + +LOCK TABLES `eventai_summons` WRITE; +/*!40000 ALTER TABLE `eventai_summons` DISABLE KEYS */; +/*!40000 ALTER TABLE `eventai_summons` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `eventai_texts` +-- + +DROP TABLE IF EXISTS `eventai_texts`; +CREATE TABLE `eventai_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 `eventai_texts` +-- + +LOCK TABLES `eventai_texts` WRITE; +/*!40000 ALTER TABLE `eventai_texts` DISABLE KEYS */; +/*!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` +-- + +DROP TABLE IF EXISTS `exploration_basexp`; +CREATE TABLE `exploration_basexp` ( + `level` tinyint(4) NOT NULL default '0', + `basexp` mediumint(9) NOT NULL default '0', + PRIMARY KEY (`level`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Exploration System'; + +-- +-- Dumping data for table `exploration_basexp` +-- + +LOCK TABLES `exploration_basexp` WRITE; +/*!40000 ALTER TABLE `exploration_basexp` DISABLE KEYS */; +/*!40000 ALTER TABLE `exploration_basexp` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `fishing_loot_template` +-- + +DROP TABLE IF EXISTS `fishing_loot_template`; +CREATE TABLE `fishing_loot_template` ( + `entry` mediumint(8) unsigned NOT NULL default '0', + `item` mediumint(8) unsigned NOT NULL default '0', + `ChanceOrQuestChance` float NOT NULL default '100', + `groupid` tinyint(3) unsigned NOT NULL default '0', + `mincountOrRef` mediumint(9) NOT NULL default '1', + `maxcount` tinyint(3) unsigned NOT NULL default '1', + `lootcondition` tinyint(3) unsigned NOT NULL default '0', + `condition_value1` mediumint(8) unsigned NOT NULL default '0', + `condition_value2` mediumint(8) unsigned NOT NULL default '0', + PRIMARY KEY (`entry`,`item`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Loot System'; + +-- +-- Dumping data for table `fishing_loot_template` +-- + +LOCK TABLES `fishing_loot_template` WRITE; +/*!40000 ALTER TABLE `fishing_loot_template` DISABLE KEYS */; +/*!40000 ALTER TABLE `fishing_loot_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `game_event` +-- + +DROP TABLE IF EXISTS `game_event`; +CREATE TABLE `game_event` ( + `entry` mediumint(8) unsigned NOT NULL COMMENT 'Entry of the game event', + `start_time` timestamp NOT NULL default '0000-00-00 00:00:00' COMMENT 'Absolute start date, the event will never start before', + `end_time` timestamp NOT NULL default '0000-00-00 00:00:00' COMMENT 'Absolute end date, the event will never start afler', + `occurence` bigint(20) unsigned NOT NULL default '5184000' COMMENT 'Delay in minutes between occurences of the event', + `length` bigint(20) unsigned NOT NULL default '2592000' COMMENT 'Length in minutes of the event', + `description` varchar(255) default NULL COMMENT 'Description of the event displayed in console', + `world_event` tinyint(3) unsigned NOT NULL default '0' COMMENT '0 if normal event, 1 if world event', + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `game_event` +-- + +LOCK TABLES `game_event` WRITE; +/*!40000 ALTER TABLE `game_event` DISABLE KEYS */; +/*!40000 ALTER TABLE `game_event` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `game_event_condition` +-- + +DROP TABLE IF EXISTS `game_event_condition`; +CREATE TABLE `game_event_condition` ( + `event_id` mediumint(8) unsigned NOT NULL default '0', + `condition_id` mediumint(8) unsigned NOT NULL default '0', + `req_num` float default '0', + `max_world_state_field` smallint(5) unsigned NOT NULL default '0', + `done_world_state_field` smallint(5) unsigned NOT NULL default '0', + `description` varchar(25) NOT NULL default '', + PRIMARY KEY (`event_id`,`condition_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `game_event_condition` +-- + +LOCK TABLES `game_event_condition` WRITE; +/*!40000 ALTER TABLE `game_event_condition` DISABLE KEYS */; +/*!40000 ALTER TABLE `game_event_condition` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `game_event_creature` +-- + +DROP TABLE IF EXISTS `game_event_creature`; +CREATE TABLE `game_event_creature` ( + `guid` int(10) unsigned NOT NULL, + `event` smallint(6) NOT NULL default '0' COMMENT 'Put negatives values to remove during event', + PRIMARY KEY (`guid`,`event`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `game_event_creature` +-- + +LOCK TABLES `game_event_creature` WRITE; +/*!40000 ALTER TABLE `game_event_creature` DISABLE KEYS */; +/*!40000 ALTER TABLE `game_event_creature` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `game_event_creature_quest` +-- + +DROP TABLE IF EXISTS `game_event_creature_quest`; +CREATE TABLE `game_event_creature_quest` ( + `id` mediumint(8) unsigned NOT NULL default '0', + `quest` mediumint(8) unsigned NOT NULL default '0', + `event` smallint(5) unsigned NOT NULL default '0', + PRIMARY KEY (`quest`,`event`,`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `game_event_creature_quest` +-- + +LOCK TABLES `game_event_creature_quest` WRITE; +/*!40000 ALTER TABLE `game_event_creature_quest` DISABLE KEYS */; +/*!40000 ALTER TABLE `game_event_creature_quest` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `game_event_gameobject` +-- + +DROP TABLE IF EXISTS `game_event_gameobject`; +CREATE TABLE `game_event_gameobject` ( + `guid` int(10) unsigned NOT NULL, + `event` smallint(6) NOT NULL default '0' COMMENT 'Put negatives values to remove during event', + PRIMARY KEY (`guid`,`event`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `game_event_gameobject` +-- + +LOCK TABLES `game_event_gameobject` WRITE; +/*!40000 ALTER TABLE `game_event_gameobject` DISABLE KEYS */; +/*!40000 ALTER TABLE `game_event_gameobject` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `game_event_gameobject_quest` +-- + +DROP TABLE IF EXISTS `game_event_gameobject_quest`; +CREATE TABLE `game_event_gameobject_quest` ( + `id` mediumint(8) unsigned NOT NULL default '0', + `quest` mediumint(8) unsigned NOT NULL default '0', + `event` smallint(5) unsigned NOT NULL default '0', + PRIMARY KEY (`quest`,`event`,`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `game_event_gameobject_quest` +-- + +LOCK TABLES `game_event_gameobject_quest` WRITE; +/*!40000 ALTER TABLE `game_event_gameobject_quest` DISABLE KEYS */; +/*!40000 ALTER TABLE `game_event_gameobject_quest` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `game_event_model_equip` +-- + +DROP TABLE IF EXISTS `game_event_model_equip`; +CREATE TABLE `game_event_model_equip` ( + `guid` int(10) unsigned NOT NULL default '0', + `modelid` mediumint(8) unsigned NOT NULL default '0', + `equipment_id` mediumint(8) unsigned NOT NULL default '0', + `event` smallint(5) unsigned NOT NULL default '0', + PRIMARY KEY (`guid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `game_event_model_equip` +-- + +LOCK TABLES `game_event_model_equip` WRITE; +/*!40000 ALTER TABLE `game_event_model_equip` DISABLE KEYS */; +/*!40000 ALTER TABLE `game_event_model_equip` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `game_event_npc_gossip` +-- + +DROP TABLE IF EXISTS `game_event_npc_gossip`; +CREATE TABLE `game_event_npc_gossip` ( + `guid` int(10) unsigned NOT NULL, + `event_id` mediumint(8) unsigned NOT NULL default '0', + `textid` mediumint(8) unsigned NOT NULL default '0', + PRIMARY KEY (`guid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `game_event_npc_gossip` +-- + +LOCK TABLES `game_event_npc_gossip` WRITE; +/*!40000 ALTER TABLE `game_event_npc_gossip` DISABLE KEYS */; +/*!40000 ALTER TABLE `game_event_npc_gossip` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `game_event_npc_vendor` +-- + +DROP TABLE IF EXISTS `game_event_npc_vendor`; +CREATE TABLE `game_event_npc_vendor` ( + `event` mediumint(8) unsigned NOT NULL default '0', + `guid` mediumint(8) unsigned NOT NULL default '0', + `item` mediumint(8) unsigned NOT NULL default '0', + `maxcount` mediumint(8) unsigned NOT NULL default '0', + `incrtime` mediumint(8) unsigned NOT NULL default '0', + `ExtendedCost` mediumint(8) unsigned NOT NULL default '0', + PRIMARY KEY (`guid`,`item`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `game_event_npc_vendor` +-- + +LOCK TABLES `game_event_npc_vendor` WRITE; +/*!40000 ALTER TABLE `game_event_npc_vendor` DISABLE KEYS */; +/*!40000 ALTER TABLE `game_event_npc_vendor` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `game_event_npcflag` +-- + +DROP TABLE IF EXISTS `game_event_npcflag`; +CREATE TABLE `game_event_npcflag` ( + `guid` mediumint(8) unsigned NOT NULL default '0', + `event_id` mediumint(8) unsigned NOT NULL default '0', + `npcflag` int(10) unsigned NOT NULL default '0', + PRIMARY KEY (`guid`,`event_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `game_event_npcflag` +-- + +LOCK TABLES `game_event_npcflag` WRITE; +/*!40000 ALTER TABLE `game_event_npcflag` DISABLE KEYS */; +/*!40000 ALTER TABLE `game_event_npcflag` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `game_event_prerequisite` +-- + +DROP TABLE IF EXISTS `game_event_prerequisite`; +CREATE TABLE `game_event_prerequisite` ( + `event_id` mediumint(8) unsigned NOT NULL, + `prerequisite_event` mediumint(8) unsigned NOT NULL, + PRIMARY KEY (`event_id`,`prerequisite_event`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `game_event_prerequisite` +-- + +LOCK TABLES `game_event_prerequisite` WRITE; +/*!40000 ALTER TABLE `game_event_prerequisite` DISABLE KEYS */; +/*!40000 ALTER TABLE `game_event_prerequisite` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `game_event_quest_condition` +-- + +DROP TABLE IF EXISTS `game_event_quest_condition`; +CREATE TABLE `game_event_quest_condition` ( + `quest` mediumint(8) unsigned NOT NULL default '0', + `event_id` mediumint(8) unsigned NOT NULL default '0', + `condition_id` mediumint(8) unsigned NOT NULL default '0', + `num` float default '0', + PRIMARY KEY (`quest`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `game_event_quest_condition` +-- + +LOCK TABLES `game_event_quest_condition` WRITE; +/*!40000 ALTER TABLE `game_event_quest_condition` DISABLE KEYS */; +/*!40000 ALTER TABLE `game_event_quest_condition` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `game_graveyard_zone` +-- + +DROP TABLE IF EXISTS `game_graveyard_zone`; +CREATE TABLE `game_graveyard_zone` ( + `id` mediumint(8) unsigned NOT NULL default '0', + `ghost_zone` mediumint(8) unsigned NOT NULL default '0', + `faction` smallint(5) unsigned NOT NULL default '0', + PRIMARY KEY (`id`,`ghost_zone`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Trigger System'; + +-- +-- Dumping data for table `game_graveyard_zone` +-- + +LOCK TABLES `game_graveyard_zone` WRITE; +/*!40000 ALTER TABLE `game_graveyard_zone` DISABLE KEYS */; +/*!40000 ALTER TABLE `game_graveyard_zone` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `game_tele` +-- + +DROP TABLE IF EXISTS `game_tele`; +CREATE TABLE `game_tele` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `position_x` float NOT NULL default '0', + `position_y` float NOT NULL default '0', + `position_z` float NOT NULL default '0', + `orientation` float NOT NULL default '0', + `map` smallint(5) unsigned NOT NULL default '0', + `name` varchar(100) NOT NULL default '', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Tele Command'; + +-- +-- Dumping data for table `game_tele` +-- + +LOCK TABLES `game_tele` WRITE; +/*!40000 ALTER TABLE `game_tele` DISABLE KEYS */; +/*!40000 ALTER TABLE `game_tele` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `game_weather` +-- + +DROP TABLE IF EXISTS `game_weather`; +CREATE TABLE `game_weather` ( + `zone` mediumint(8) unsigned NOT NULL default '0', + `spring_rain_chance` tinyint(3) unsigned NOT NULL default '25', + `spring_snow_chance` tinyint(3) unsigned NOT NULL default '25', + `spring_storm_chance` tinyint(3) unsigned NOT NULL default '25', + `summer_rain_chance` tinyint(3) unsigned NOT NULL default '25', + `summer_snow_chance` tinyint(3) unsigned NOT NULL default '25', + `summer_storm_chance` tinyint(3) unsigned NOT NULL default '25', + `fall_rain_chance` tinyint(3) unsigned NOT NULL default '25', + `fall_snow_chance` tinyint(3) unsigned NOT NULL default '25', + `fall_storm_chance` tinyint(3) unsigned NOT NULL default '25', + `winter_rain_chance` tinyint(3) unsigned NOT NULL default '25', + `winter_snow_chance` tinyint(3) unsigned NOT NULL default '25', + `winter_storm_chance` tinyint(3) unsigned NOT NULL default '25', + PRIMARY KEY (`zone`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Weather System'; + +-- +-- Dumping data for table `game_weather` +-- + +LOCK TABLES `game_weather` WRITE; +/*!40000 ALTER TABLE `game_weather` DISABLE KEYS */; +/*!40000 ALTER TABLE `game_weather` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gameobject` +-- + +DROP TABLE IF EXISTS `gameobject`; +CREATE TABLE `gameobject` ( + `guid` int(10) unsigned NOT NULL auto_increment COMMENT 'Global Unique Identifier', + `id` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Gameobject Identifier', + `map` smallint(5) unsigned NOT NULL default '0' COMMENT 'Map Identifier', + `spawnMask` tinyint(3) unsigned NOT NULL default '1', + `position_x` float NOT NULL default '0', + `position_y` float NOT NULL default '0', + `position_z` float NOT NULL default '0', + `orientation` float NOT NULL default '0', + `rotation0` float NOT NULL default '0', + `rotation1` float NOT NULL default '0', + `rotation2` float NOT NULL default '0', + `rotation3` float NOT NULL default '0', + `spawntimesecs` int(11) NOT NULL default '0', + `animprogress` tinyint(3) unsigned NOT NULL default '0', + `state` tinyint(3) unsigned NOT NULL default '0', + PRIMARY KEY (`guid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Gameobject System'; + +-- +-- Dumping data for table `gameobject` +-- + +LOCK TABLES `gameobject` WRITE; +/*!40000 ALTER TABLE `gameobject` DISABLE KEYS */; +/*!40000 ALTER TABLE `gameobject` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gameobject_involvedrelation` +-- + +DROP TABLE IF EXISTS `gameobject_involvedrelation`; +CREATE TABLE `gameobject_involvedrelation` ( + `id` mediumint(8) unsigned NOT NULL default '0', + `quest` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Quest Identifier', + PRIMARY KEY (`id`,`quest`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `gameobject_involvedrelation` +-- + +LOCK TABLES `gameobject_involvedrelation` WRITE; +/*!40000 ALTER TABLE `gameobject_involvedrelation` DISABLE KEYS */; +/*!40000 ALTER TABLE `gameobject_involvedrelation` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gameobject_loot_template` +-- + +DROP TABLE IF EXISTS `gameobject_loot_template`; +CREATE TABLE `gameobject_loot_template` ( + `entry` mediumint(8) unsigned NOT NULL default '0', + `item` mediumint(8) unsigned NOT NULL default '0', + `ChanceOrQuestChance` float NOT NULL default '100', + `groupid` tinyint(3) unsigned NOT NULL default '0', + `mincountOrRef` mediumint(9) NOT NULL default '1', + `maxcount` tinyint(3) unsigned NOT NULL default '1', + `lootcondition` tinyint(3) unsigned NOT NULL default '0', + `condition_value1` mediumint(8) unsigned NOT NULL default '0', + `condition_value2` mediumint(8) unsigned NOT NULL default '0', + PRIMARY KEY (`entry`,`item`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Loot System'; + +-- +-- Dumping data for table `gameobject_loot_template` +-- + +LOCK TABLES `gameobject_loot_template` WRITE; +/*!40000 ALTER TABLE `gameobject_loot_template` DISABLE KEYS */; +/*!40000 ALTER TABLE `gameobject_loot_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gameobject_questrelation` +-- + +DROP TABLE IF EXISTS `gameobject_questrelation`; +CREATE TABLE `gameobject_questrelation` ( + `id` mediumint(8) unsigned NOT NULL default '0', + `quest` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Quest Identifier', + PRIMARY KEY (`id`,`quest`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `gameobject_questrelation` +-- + +LOCK TABLES `gameobject_questrelation` WRITE; +/*!40000 ALTER TABLE `gameobject_questrelation` DISABLE KEYS */; +/*!40000 ALTER TABLE `gameobject_questrelation` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gameobject_respawn` +-- + +DROP TABLE IF EXISTS `gameobject_respawn`; +CREATE TABLE `gameobject_respawn` ( + `guid` int(10) unsigned NOT NULL default '0' COMMENT 'Global Unique Identifier', + `respawntime` bigint(20) NOT NULL default '0', + `instance` mediumint(8) unsigned NOT NULL default '0', + PRIMARY KEY (`guid`,`instance`), + KEY `instance` (`instance`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Grid Loading System'; + +-- +-- Dumping data for table `gameobject_respawn` +-- + +LOCK TABLES `gameobject_respawn` WRITE; +/*!40000 ALTER TABLE `gameobject_respawn` DISABLE KEYS */; +/*!40000 ALTER TABLE `gameobject_respawn` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gameobject_scripts` +-- + +DROP TABLE IF EXISTS `gameobject_scripts`; +CREATE TABLE `gameobject_scripts` ( + `id` mediumint(8) unsigned NOT NULL default '0', + `delay` int(10) unsigned NOT NULL default '0', + `command` mediumint(8) unsigned NOT NULL default '0', + `datalong` mediumint(8) unsigned NOT NULL default '0', + `datalong2` int(10) unsigned NOT NULL default '0', + `datatext` text NOT NULL, + `x` float NOT NULL default '0', + `y` float NOT NULL default '0', + `z` float NOT NULL default '0', + `o` float NOT NULL default '0' +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `gameobject_scripts` +-- + +LOCK TABLES `gameobject_scripts` WRITE; +/*!40000 ALTER TABLE `gameobject_scripts` DISABLE KEYS */; +/*!40000 ALTER TABLE `gameobject_scripts` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gameobject_template` +-- + +DROP TABLE IF EXISTS `gameobject_template`; +CREATE TABLE `gameobject_template` ( + `entry` mediumint(8) unsigned NOT NULL default '0', + `type` tinyint(3) unsigned NOT NULL default '0', + `displayId` mediumint(8) unsigned NOT NULL default '0', + `name` varchar(100) NOT NULL default '', + `castBarCaption` varchar(100) NOT NULL default '', + `faction` smallint(5) unsigned NOT NULL default '0', + `flags` int(10) unsigned NOT NULL default '0', + `size` float NOT NULL default '1', + `data0` int(10) unsigned NOT NULL default '0', + `data1` int(10) unsigned NOT NULL default '0', + `data2` int(10) unsigned NOT NULL default '0', + `data3` int(10) unsigned NOT NULL default '0', + `data4` int(10) unsigned NOT NULL default '0', + `data5` int(10) unsigned NOT NULL default '0', + `data6` int(10) unsigned NOT NULL default '0', + `data7` int(10) unsigned NOT NULL default '0', + `data8` int(10) unsigned NOT NULL default '0', + `data9` int(10) unsigned NOT NULL default '0', + `data10` int(10) unsigned NOT NULL default '0', + `data11` int(10) unsigned NOT NULL default '0', + `data12` int(10) unsigned NOT NULL default '0', + `data13` int(10) unsigned NOT NULL default '0', + `data14` int(10) unsigned NOT NULL default '0', + `data15` int(10) unsigned NOT NULL default '0', + `data16` int(10) unsigned NOT NULL default '0', + `data17` int(10) unsigned NOT NULL default '0', + `data18` int(10) unsigned NOT NULL default '0', + `data19` int(10) unsigned NOT NULL default '0', + `data20` int(10) unsigned NOT NULL default '0', + `data21` int(10) unsigned NOT NULL default '0', + `data22` int(10) unsigned NOT NULL default '0', + `data23` int(10) unsigned NOT NULL default '0', + `ScriptName` varchar(64) NOT NULL default '', + PRIMARY KEY (`entry`), + KEY `idx_name` (`name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Gameobject System'; + +-- +-- Dumping data for table `gameobject_template` +-- + +LOCK TABLES `gameobject_template` WRITE; +/*!40000 ALTER TABLE `gameobject_template` DISABLE KEYS */; +/*!40000 ALTER TABLE `gameobject_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `instance_template` +-- + +DROP TABLE IF EXISTS `instance_template`; +CREATE TABLE `instance_template` ( + `map` smallint(5) unsigned NOT NULL, + `parent` int(10) unsigned NOT NULL, + `levelMin` tinyint(3) unsigned NOT NULL default '0', + `levelMax` tinyint(3) unsigned NOT NULL default '0', + `maxPlayers` tinyint(3) unsigned NOT NULL default '0', + `reset_delay` int(10) unsigned NOT NULL default '0', + `startLocX` float default NULL, + `startLocY` float default NULL, + `startLocZ` float default NULL, + `startLocO` float default NULL, + `script` varchar(128) NOT NULL default '', + PRIMARY KEY (`map`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `instance_template` +-- + +LOCK TABLES `instance_template` WRITE; +/*!40000 ALTER TABLE `instance_template` DISABLE KEYS */; +/*!40000 ALTER TABLE `instance_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `item_enchantment_template` +-- + +DROP TABLE IF EXISTS `item_enchantment_template`; +CREATE TABLE `item_enchantment_template` ( + `entry` mediumint(8) unsigned NOT NULL default '0', + `ench` mediumint(8) unsigned NOT NULL default '0', + `chance` float unsigned NOT NULL default '0', + PRIMARY KEY (`entry`,`ench`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Item Random Enchantment System'; + +-- +-- Dumping data for table `item_enchantment_template` +-- + +LOCK TABLES `item_enchantment_template` WRITE; +/*!40000 ALTER TABLE `item_enchantment_template` DISABLE KEYS */; +/*!40000 ALTER TABLE `item_enchantment_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `item_loot_template` +-- + +DROP TABLE IF EXISTS `item_loot_template`; +CREATE TABLE `item_loot_template` ( + `entry` mediumint(8) unsigned NOT NULL default '0', + `item` mediumint(8) unsigned NOT NULL default '0', + `ChanceOrQuestChance` float NOT NULL default '100', + `groupid` tinyint(3) unsigned NOT NULL default '0', + `mincountOrRef` mediumint(9) NOT NULL default '1', + `maxcount` smallint(5) unsigned NOT NULL default '1', + `lootcondition` tinyint(3) unsigned NOT NULL default '0', + `condition_value1` mediumint(8) unsigned NOT NULL default '0', + `condition_value2` mediumint(8) unsigned NOT NULL default '0', + PRIMARY KEY (`entry`,`item`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System'; + +-- +-- Dumping data for table `item_loot_template` +-- + +LOCK TABLES `item_loot_template` WRITE; +/*!40000 ALTER TABLE `item_loot_template` DISABLE KEYS */; +/*!40000 ALTER TABLE `item_loot_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `item_template` +-- + +DROP TABLE IF EXISTS `item_template`; +CREATE TABLE `item_template` ( + `entry` mediumint(8) unsigned NOT NULL default '0', + `class` tinyint(3) unsigned NOT NULL default '0', + `subclass` tinyint(3) unsigned NOT NULL default '0', + `unk0` int(11) NOT NULL default '-1', + `name` varchar(255) NOT NULL default '', + `displayid` mediumint(8) unsigned NOT NULL default '0', + `Quality` tinyint(3) unsigned NOT NULL default '0', + `Flags` int(10) unsigned NOT NULL default '0', + `BuyCount` tinyint(3) unsigned NOT NULL default '1', + `BuyPrice` int(10) unsigned NOT NULL default '0', + `SellPrice` int(10) unsigned NOT NULL default '0', + `InventoryType` tinyint(3) unsigned NOT NULL default '0', + `AllowableClass` mediumint(9) NOT NULL default '-1', + `AllowableRace` mediumint(9) NOT NULL default '-1', + `ItemLevel` tinyint(3) unsigned NOT NULL default '0', + `RequiredLevel` tinyint(3) unsigned NOT NULL default '0', + `RequiredSkill` smallint(5) unsigned NOT NULL default '0', + `RequiredSkillRank` smallint(5) unsigned NOT NULL default '0', + `requiredspell` mediumint(8) unsigned NOT NULL default '0', + `requiredhonorrank` mediumint(8) unsigned NOT NULL default '0', + `RequiredCityRank` mediumint(8) unsigned NOT NULL default '0', + `RequiredReputationFaction` smallint(5) unsigned NOT NULL default '0', + `RequiredReputationRank` smallint(5) unsigned NOT NULL default '0', + `maxcount` smallint(5) unsigned NOT NULL default '0', + `stackable` smallint(5) unsigned NOT NULL default '1', + `ContainerSlots` tinyint(3) unsigned NOT NULL default '0', + `stat_type1` tinyint(3) unsigned NOT NULL default '0', + `stat_value1` smallint(6) NOT NULL default '0', + `stat_type2` tinyint(3) unsigned NOT NULL default '0', + `stat_value2` smallint(6) NOT NULL default '0', + `stat_type3` tinyint(3) unsigned NOT NULL default '0', + `stat_value3` smallint(6) NOT NULL default '0', + `stat_type4` tinyint(3) unsigned NOT NULL default '0', + `stat_value4` smallint(6) NOT NULL default '0', + `stat_type5` tinyint(3) unsigned NOT NULL default '0', + `stat_value5` smallint(6) NOT NULL default '0', + `stat_type6` tinyint(3) unsigned NOT NULL default '0', + `stat_value6` smallint(6) NOT NULL default '0', + `stat_type7` tinyint(3) unsigned NOT NULL default '0', + `stat_value7` smallint(6) NOT NULL default '0', + `stat_type8` tinyint(3) unsigned NOT NULL default '0', + `stat_value8` smallint(6) NOT NULL default '0', + `stat_type9` tinyint(3) unsigned NOT NULL default '0', + `stat_value9` smallint(6) NOT NULL default '0', + `stat_type10` tinyint(3) unsigned NOT NULL default '0', + `stat_value10` smallint(6) NOT NULL default '0', + `dmg_min1` float NOT NULL default '0', + `dmg_max1` float NOT NULL default '0', + `dmg_type1` tinyint(3) unsigned NOT NULL default '0', + `dmg_min2` float NOT NULL default '0', + `dmg_max2` float NOT NULL default '0', + `dmg_type2` tinyint(3) unsigned NOT NULL default '0', + `dmg_min3` float NOT NULL default '0', + `dmg_max3` float NOT NULL default '0', + `dmg_type3` tinyint(3) unsigned NOT NULL default '0', + `dmg_min4` float NOT NULL default '0', + `dmg_max4` float NOT NULL default '0', + `dmg_type4` tinyint(3) unsigned NOT NULL default '0', + `dmg_min5` float NOT NULL default '0', + `dmg_max5` float NOT NULL default '0', + `dmg_type5` tinyint(3) unsigned NOT NULL default '0', + `armor` smallint(5) unsigned NOT NULL default '0', + `holy_res` tinyint(3) unsigned NOT NULL default '0', + `fire_res` tinyint(3) unsigned NOT NULL default '0', + `nature_res` tinyint(3) unsigned NOT NULL default '0', + `frost_res` tinyint(3) unsigned NOT NULL default '0', + `shadow_res` tinyint(3) unsigned NOT NULL default '0', + `arcane_res` tinyint(3) unsigned NOT NULL default '0', + `delay` smallint(5) unsigned NOT NULL default '1000', + `ammo_type` tinyint(3) unsigned NOT NULL default '0', + `RangedModRange` float NOT NULL default '0', + `spellid_1` mediumint(8) unsigned NOT NULL default '0', + `spelltrigger_1` tinyint(3) unsigned NOT NULL default '0', + `spellcharges_1` tinyint(4) NOT NULL default '0', + `spellppmRate_1` float NOT NULL default '0', + `spellcooldown_1` int(11) NOT NULL default '-1', + `spellcategory_1` smallint(5) unsigned NOT NULL default '0', + `spellcategorycooldown_1` int(11) NOT NULL default '-1', + `spellid_2` mediumint(8) unsigned NOT NULL default '0', + `spelltrigger_2` tinyint(3) unsigned NOT NULL default '0', + `spellcharges_2` tinyint(4) NOT NULL default '0', + `spellppmRate_2` float NOT NULL default '0', + `spellcooldown_2` int(11) NOT NULL default '-1', + `spellcategory_2` smallint(5) unsigned NOT NULL default '0', + `spellcategorycooldown_2` int(11) NOT NULL default '-1', + `spellid_3` mediumint(8) unsigned NOT NULL default '0', + `spelltrigger_3` tinyint(3) unsigned NOT NULL default '0', + `spellcharges_3` tinyint(4) NOT NULL default '0', + `spellppmRate_3` float NOT NULL default '0', + `spellcooldown_3` int(11) NOT NULL default '-1', + `spellcategory_3` smallint(5) unsigned NOT NULL default '0', + `spellcategorycooldown_3` int(11) NOT NULL default '-1', + `spellid_4` mediumint(8) unsigned NOT NULL default '0', + `spelltrigger_4` tinyint(3) unsigned NOT NULL default '0', + `spellcharges_4` tinyint(4) NOT NULL default '0', + `spellppmRate_4` float NOT NULL default '0', + `spellcooldown_4` int(11) NOT NULL default '-1', + `spellcategory_4` smallint(5) unsigned NOT NULL default '0', + `spellcategorycooldown_4` int(11) NOT NULL default '-1', + `spellid_5` mediumint(8) unsigned NOT NULL default '0', + `spelltrigger_5` tinyint(3) unsigned NOT NULL default '0', + `spellcharges_5` tinyint(4) NOT NULL default '0', + `spellppmRate_5` float NOT NULL default '0', + `spellcooldown_5` int(11) NOT NULL default '-1', + `spellcategory_5` smallint(5) unsigned NOT NULL default '0', + `spellcategorycooldown_5` int(11) NOT NULL default '-1', + `bonding` tinyint(3) unsigned NOT NULL default '0', + `description` varchar(255) NOT NULL default '', + `PageText` mediumint(8) unsigned NOT NULL default '0', + `LanguageID` tinyint(3) unsigned NOT NULL default '0', + `PageMaterial` tinyint(3) unsigned NOT NULL default '0', + `startquest` mediumint(8) unsigned NOT NULL default '0', + `lockid` mediumint(8) unsigned NOT NULL default '0', + `Material` tinyint(4) NOT NULL default '0', + `sheath` tinyint(3) unsigned NOT NULL default '0', + `RandomProperty` mediumint(8) unsigned NOT NULL default '0', + `RandomSuffix` mediumint(8) unsigned NOT NULL default '0', + `block` mediumint(8) unsigned NOT NULL default '0', + `itemset` mediumint(8) unsigned NOT NULL default '0', + `MaxDurability` smallint(5) unsigned NOT NULL default '0', + `area` mediumint(8) unsigned NOT NULL default '0', + `Map` smallint(6) NOT NULL default '0', + `BagFamily` mediumint(9) NOT NULL default '0', + `TotemCategory` tinyint(4) NOT NULL default '0', + `socketColor_1` tinyint(4) NOT NULL default '0', + `socketContent_1` mediumint(9) NOT NULL default '0', + `socketColor_2` tinyint(4) NOT NULL default '0', + `socketContent_2` mediumint(9) NOT NULL default '0', + `socketColor_3` tinyint(4) NOT NULL default '0', + `socketContent_3` mediumint(9) NOT NULL default '0', + `socketBonus` mediumint(9) NOT NULL default '0', + `GemProperties` mediumint(9) NOT NULL default '0', + `RequiredDisenchantSkill` smallint(6) NOT NULL default '-1', + `ArmorDamageModifier` float NOT NULL default '0', + `ScriptName` varchar(64) NOT NULL default '', + `DisenchantID` mediumint(8) unsigned NOT NULL default '0', + `FoodType` tinyint(3) unsigned NOT NULL default '0', + `minMoneyLoot` int(10) unsigned NOT NULL default '0', + `maxMoneyLoot` int(10) unsigned NOT NULL default '0', + `Duration` int(11) NOT NULL default '0' COMMENT 'Duration in seconds. Negative value means realtime, postive value ingame time', + PRIMARY KEY (`entry`), + KEY `idx_name` (`name`), + KEY `items_index` (`class`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Item System'; + +-- +-- Dumping data for table `item_template` +-- + +LOCK TABLES `item_template` WRITE; +/*!40000 ALTER TABLE `item_template` DISABLE KEYS */; +/*!40000 ALTER TABLE `item_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `locales_creature` +-- + +DROP TABLE IF EXISTS `locales_creature`; +CREATE TABLE `locales_creature` ( + `entry` mediumint(8) unsigned NOT NULL default '0', + `name_loc1` varchar(100) NOT NULL default '', + `name_loc2` varchar(100) NOT NULL default '', + `name_loc3` varchar(100) NOT NULL default '', + `name_loc4` varchar(100) NOT NULL default '', + `name_loc5` varchar(100) NOT NULL default '', + `name_loc6` varchar(100) NOT NULL default '', + `name_loc7` varchar(100) NOT NULL default '', + `name_loc8` varchar(100) NOT NULL default '', + `subname_loc1` varchar(100) default NULL, + `subname_loc2` varchar(100) default NULL, + `subname_loc3` varchar(100) default NULL, + `subname_loc4` varchar(100) default NULL, + `subname_loc5` varchar(100) default NULL, + `subname_loc6` varchar(100) default NULL, + `subname_loc7` varchar(100) default NULL, + `subname_loc8` varchar(100) default NULL, + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `locales_creature` +-- + +LOCK TABLES `locales_creature` WRITE; +/*!40000 ALTER TABLE `locales_creature` DISABLE KEYS */; +/*!40000 ALTER TABLE `locales_creature` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `locales_gameobject` +-- + +DROP TABLE IF EXISTS `locales_gameobject`; +CREATE TABLE `locales_gameobject` ( + `entry` mediumint(8) unsigned NOT NULL default '0', + `name_loc1` varchar(100) NOT NULL default '', + `name_loc2` varchar(100) NOT NULL default '', + `name_loc3` varchar(100) NOT NULL default '', + `name_loc4` varchar(100) NOT NULL default '', + `name_loc5` varchar(100) NOT NULL default '', + `name_loc6` varchar(100) NOT NULL default '', + `name_loc7` varchar(100) NOT NULL default '', + `name_loc8` varchar(100) NOT NULL default '', + `castbarcaption_loc1` varchar(100) NOT NULL default '', + `castbarcaption_loc2` varchar(100) NOT NULL default '', + `castbarcaption_loc3` varchar(100) NOT NULL default '', + `castbarcaption_loc4` varchar(100) NOT NULL default '', + `castbarcaption_loc5` varchar(100) NOT NULL default '', + `castbarcaption_loc6` varchar(100) NOT NULL default '', + `castbarcaption_loc7` varchar(100) NOT NULL default '', + `castbarcaption_loc8` varchar(100) NOT NULL default '', + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `locales_gameobject` +-- + +LOCK TABLES `locales_gameobject` WRITE; +/*!40000 ALTER TABLE `locales_gameobject` DISABLE KEYS */; +/*!40000 ALTER TABLE `locales_gameobject` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `locales_item` +-- + +DROP TABLE IF EXISTS `locales_item`; +CREATE TABLE `locales_item` ( + `entry` mediumint(8) unsigned NOT NULL default '0', + `name_loc1` varchar(100) NOT NULL default '', + `name_loc2` varchar(100) NOT NULL default '', + `name_loc3` varchar(100) NOT NULL default '', + `name_loc4` varchar(100) NOT NULL default '', + `name_loc5` varchar(100) NOT NULL default '', + `name_loc6` varchar(100) NOT NULL default '', + `name_loc7` varchar(100) NOT NULL default '', + `name_loc8` varchar(100) NOT NULL default '', + `description_loc1` varchar(255) default NULL, + `description_loc2` varchar(255) default NULL, + `description_loc3` varchar(255) default NULL, + `description_loc4` varchar(255) default NULL, + `description_loc5` varchar(255) default NULL, + `description_loc6` varchar(255) default NULL, + `description_loc7` varchar(255) default NULL, + `description_loc8` varchar(255) default NULL, + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `locales_item` +-- + +LOCK TABLES `locales_item` WRITE; +/*!40000 ALTER TABLE `locales_item` DISABLE KEYS */; +/*!40000 ALTER TABLE `locales_item` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `locales_npc_text` +-- + +DROP TABLE IF EXISTS `locales_npc_text`; +CREATE TABLE `locales_npc_text` ( + `entry` mediumint(8) unsigned NOT NULL default '0', + `Text0_0_loc1` longtext, + `Text0_0_loc2` longtext, + `Text0_0_loc3` longtext, + `Text0_0_loc4` longtext, + `Text0_0_loc5` longtext, + `Text0_0_loc6` longtext, + `Text0_0_loc7` longtext, + `Text0_0_loc8` longtext, + `Text0_1_loc1` longtext, + `Text0_1_loc2` longtext, + `Text0_1_loc3` longtext, + `Text0_1_loc4` longtext, + `Text0_1_loc5` longtext, + `Text0_1_loc6` longtext, + `Text0_1_loc7` longtext, + `Text0_1_loc8` longtext, + `Text1_0_loc1` longtext, + `Text1_0_loc2` longtext, + `Text1_0_loc3` longtext, + `Text1_0_loc4` longtext, + `Text1_0_loc5` longtext, + `Text1_0_loc6` longtext, + `Text1_0_loc7` longtext, + `Text1_0_loc8` longtext, + `Text1_1_loc1` longtext, + `Text1_1_loc2` longtext, + `Text1_1_loc3` longtext, + `Text1_1_loc4` longtext, + `Text1_1_loc5` longtext, + `Text1_1_loc6` longtext, + `Text1_1_loc7` longtext, + `Text1_1_loc8` longtext, + `Text2_0_loc1` longtext, + `Text2_0_loc2` longtext, + `Text2_0_loc3` longtext, + `Text2_0_loc4` longtext, + `Text2_0_loc5` longtext, + `Text2_0_loc6` longtext, + `Text2_0_loc7` longtext, + `Text2_0_loc8` longtext, + `Text2_1_loc1` longtext, + `Text2_1_loc2` longtext, + `Text2_1_loc3` longtext, + `Text2_1_loc4` longtext, + `Text2_1_loc5` longtext, + `Text2_1_loc6` longtext, + `Text2_1_loc7` longtext, + `Text2_1_loc8` longtext, + `Text3_0_loc1` longtext, + `Text3_0_loc2` longtext, + `Text3_0_loc3` longtext, + `Text3_0_loc4` longtext, + `Text3_0_loc5` longtext, + `Text3_0_loc6` longtext, + `Text3_0_loc7` longtext, + `Text3_0_loc8` longtext, + `Text3_1_loc1` longtext, + `Text3_1_loc2` longtext, + `Text3_1_loc3` longtext, + `Text3_1_loc4` longtext, + `Text3_1_loc5` longtext, + `Text3_1_loc6` longtext, + `Text3_1_loc7` longtext, + `Text3_1_loc8` longtext, + `Text4_0_loc1` longtext, + `Text4_0_loc2` longtext, + `Text4_0_loc3` longtext, + `Text4_0_loc4` longtext, + `Text4_0_loc5` longtext, + `Text4_0_loc6` longtext, + `Text4_0_loc7` longtext, + `Text4_0_loc8` longtext, + `Text4_1_loc1` longtext, + `Text4_1_loc2` longtext, + `Text4_1_loc3` longtext, + `Text4_1_loc4` longtext, + `Text4_1_loc5` longtext, + `Text4_1_loc6` longtext, + `Text4_1_loc7` longtext, + `Text4_1_loc8` longtext, + `Text5_0_loc1` longtext, + `Text5_0_loc2` longtext, + `Text5_0_loc3` longtext, + `Text5_0_loc4` longtext, + `Text5_0_loc5` longtext, + `Text5_0_loc6` longtext, + `Text5_0_loc7` longtext, + `Text5_0_loc8` longtext, + `Text5_1_loc1` longtext, + `Text5_1_loc2` longtext, + `Text5_1_loc3` longtext, + `Text5_1_loc4` longtext, + `Text5_1_loc5` longtext, + `Text5_1_loc6` longtext, + `Text5_1_loc7` longtext, + `Text5_1_loc8` longtext, + `Text6_0_loc1` longtext, + `Text6_0_loc2` longtext, + `Text6_0_loc3` longtext, + `Text6_0_loc4` longtext, + `Text6_0_loc5` longtext, + `Text6_0_loc6` longtext, + `Text6_0_loc7` longtext, + `Text6_0_loc8` longtext, + `Text6_1_loc1` longtext, + `Text6_1_loc2` longtext, + `Text6_1_loc3` longtext, + `Text6_1_loc4` longtext, + `Text6_1_loc5` longtext, + `Text6_1_loc6` longtext, + `Text6_1_loc7` longtext, + `Text6_1_loc8` longtext, + `Text7_0_loc1` longtext, + `Text7_0_loc2` longtext, + `Text7_0_loc3` longtext, + `Text7_0_loc4` longtext, + `Text7_0_loc5` longtext, + `Text7_0_loc6` longtext, + `Text7_0_loc7` longtext, + `Text7_0_loc8` longtext, + `Text7_1_loc1` longtext, + `Text7_1_loc2` longtext, + `Text7_1_loc3` longtext, + `Text7_1_loc4` longtext, + `Text7_1_loc5` longtext, + `Text7_1_loc6` longtext, + `Text7_1_loc7` longtext, + `Text7_1_loc8` longtext, + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `locales_npc_text` +-- + +LOCK TABLES `locales_npc_text` WRITE; +/*!40000 ALTER TABLE `locales_npc_text` DISABLE KEYS */; +/*!40000 ALTER TABLE `locales_npc_text` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `locales_page_text` +-- + +DROP TABLE IF EXISTS `locales_page_text`; +CREATE TABLE `locales_page_text` ( + `entry` mediumint(8) unsigned NOT NULL default '0', + `Text_loc1` longtext, + `Text_loc2` longtext, + `Text_loc3` longtext, + `Text_loc4` longtext, + `Text_loc5` longtext, + `Text_loc6` longtext, + `Text_loc7` longtext, + `Text_loc8` longtext, + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `locales_page_text` +-- + +LOCK TABLES `locales_page_text` WRITE; +/*!40000 ALTER TABLE `locales_page_text` DISABLE KEYS */; +/*!40000 ALTER TABLE `locales_page_text` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `locales_quest` +-- + +DROP TABLE IF EXISTS `locales_quest`; +CREATE TABLE `locales_quest` ( + `entry` mediumint(8) unsigned NOT NULL default '0', + `Title_loc1` text, + `Title_loc2` text, + `Title_loc3` text, + `Title_loc4` text, + `Title_loc5` text, + `Title_loc6` text, + `Title_loc7` text, + `Title_loc8` text, + `Details_loc1` text, + `Details_loc2` text, + `Details_loc3` text, + `Details_loc4` text, + `Details_loc5` text, + `Details_loc6` text, + `Details_loc7` text, + `Details_loc8` text, + `Objectives_loc1` text, + `Objectives_loc2` text, + `Objectives_loc3` text, + `Objectives_loc4` text, + `Objectives_loc5` text, + `Objectives_loc6` text, + `Objectives_loc7` text, + `Objectives_loc8` text, + `OfferRewardText_loc1` text, + `OfferRewardText_loc2` text, + `OfferRewardText_loc3` text, + `OfferRewardText_loc4` text, + `OfferRewardText_loc5` text, + `OfferRewardText_loc6` text, + `OfferRewardText_loc7` text, + `OfferRewardText_loc8` text, + `RequestItemsText_loc1` text, + `RequestItemsText_loc2` text, + `RequestItemsText_loc3` text, + `RequestItemsText_loc4` text, + `RequestItemsText_loc5` text, + `RequestItemsText_loc6` text, + `RequestItemsText_loc7` text, + `RequestItemsText_loc8` text, + `EndText_loc1` text, + `EndText_loc2` text, + `EndText_loc3` text, + `EndText_loc4` text, + `EndText_loc5` text, + `EndText_loc6` text, + `EndText_loc7` text, + `EndText_loc8` text, + `ObjectiveText1_loc1` text, + `ObjectiveText1_loc2` text, + `ObjectiveText1_loc3` text, + `ObjectiveText1_loc4` text, + `ObjectiveText1_loc5` text, + `ObjectiveText1_loc6` text, + `ObjectiveText1_loc7` text, + `ObjectiveText1_loc8` text, + `ObjectiveText2_loc1` text, + `ObjectiveText2_loc2` text, + `ObjectiveText2_loc3` text, + `ObjectiveText2_loc4` text, + `ObjectiveText2_loc5` text, + `ObjectiveText2_loc6` text, + `ObjectiveText2_loc7` text, + `ObjectiveText2_loc8` text, + `ObjectiveText3_loc1` text, + `ObjectiveText3_loc2` text, + `ObjectiveText3_loc3` text, + `ObjectiveText3_loc4` text, + `ObjectiveText3_loc5` text, + `ObjectiveText3_loc6` text, + `ObjectiveText3_loc7` text, + `ObjectiveText3_loc8` text, + `ObjectiveText4_loc1` text, + `ObjectiveText4_loc2` text, + `ObjectiveText4_loc3` text, + `ObjectiveText4_loc4` text, + `ObjectiveText4_loc5` text, + `ObjectiveText4_loc6` text, + `ObjectiveText4_loc7` text, + `ObjectiveText4_loc8` text, + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `locales_quest` +-- + +LOCK TABLES `locales_quest` WRITE; +/*!40000 ALTER TABLE `locales_quest` DISABLE KEYS */; +/*!40000 ALTER TABLE `locales_quest` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `npc_gossip` +-- + +DROP TABLE IF EXISTS `npc_gossip`; +CREATE TABLE `npc_gossip` ( + `npc_guid` int(10) unsigned NOT NULL default '0', + `textid` mediumint(8) unsigned NOT NULL default '0', + PRIMARY KEY (`npc_guid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `npc_gossip` +-- + +LOCK TABLES `npc_gossip` WRITE; +/*!40000 ALTER TABLE `npc_gossip` DISABLE KEYS */; +/*!40000 ALTER TABLE `npc_gossip` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `npc_gossip_textid` +-- + +DROP TABLE IF EXISTS `npc_gossip_textid`; +CREATE TABLE `npc_gossip_textid` ( + `zoneid` smallint(5) unsigned NOT NULL default '0', + `action` smallint(5) unsigned NOT NULL default '0', + `textid` mediumint(8) unsigned NOT NULL default '0', + KEY `zoneid` (`zoneid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `npc_gossip_textid` +-- + +LOCK TABLES `npc_gossip_textid` WRITE; +/*!40000 ALTER TABLE `npc_gossip_textid` DISABLE KEYS */; +/*!40000 ALTER TABLE `npc_gossip_textid` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `npc_option` +-- + +DROP TABLE IF EXISTS `npc_option`; +CREATE TABLE `npc_option` ( + `id` tinyint(3) unsigned NOT NULL default '0', + `gossip_id` tinyint(3) unsigned NOT NULL default '0', + `npcflag` int(10) unsigned NOT NULL default '0', + `icon` tinyint(3) unsigned NOT NULL default '0', + `action` tinyint(3) unsigned NOT NULL default '0', + `option_text` text, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `npc_option` +-- + +LOCK TABLES `npc_option` WRITE; +/*!40000 ALTER TABLE `npc_option` DISABLE KEYS */; +/*!40000 ALTER TABLE `npc_option` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `npc_text` +-- + +DROP TABLE IF EXISTS `npc_text`; +CREATE TABLE `npc_text` ( + `ID` mediumint(8) unsigned NOT NULL default '0', + `text0_0` longtext, + `text0_1` longtext, + `lang0` tinyint(3) unsigned NOT NULL default '0', + `prob0` float NOT NULL default '0', + `em0_0` smallint(5) unsigned NOT NULL default '0', + `em0_1` smallint(5) unsigned NOT NULL default '0', + `em0_2` smallint(5) unsigned NOT NULL default '0', + `em0_3` smallint(5) unsigned NOT NULL default '0', + `em0_4` smallint(5) unsigned NOT NULL default '0', + `em0_5` smallint(5) unsigned NOT NULL default '0', + `text1_0` longtext, + `text1_1` longtext, + `lang1` tinyint(3) unsigned NOT NULL default '0', + `prob1` float NOT NULL default '0', + `em1_0` smallint(5) unsigned NOT NULL default '0', + `em1_1` smallint(5) unsigned NOT NULL default '0', + `em1_2` smallint(5) unsigned NOT NULL default '0', + `em1_3` smallint(5) unsigned NOT NULL default '0', + `em1_4` smallint(5) unsigned NOT NULL default '0', + `em1_5` smallint(5) unsigned NOT NULL default '0', + `text2_0` longtext, + `text2_1` longtext, + `lang2` tinyint(3) unsigned NOT NULL default '0', + `prob2` float NOT NULL default '0', + `em2_0` smallint(5) unsigned NOT NULL default '0', + `em2_1` smallint(5) unsigned NOT NULL default '0', + `em2_2` smallint(5) unsigned NOT NULL default '0', + `em2_3` smallint(5) unsigned NOT NULL default '0', + `em2_4` smallint(5) unsigned NOT NULL default '0', + `em2_5` smallint(5) unsigned NOT NULL default '0', + `text3_0` longtext, + `text3_1` longtext, + `lang3` tinyint(3) unsigned NOT NULL default '0', + `prob3` float NOT NULL default '0', + `em3_0` smallint(5) unsigned NOT NULL default '0', + `em3_1` smallint(5) unsigned NOT NULL default '0', + `em3_2` smallint(5) unsigned NOT NULL default '0', + `em3_3` smallint(5) unsigned NOT NULL default '0', + `em3_4` smallint(5) unsigned NOT NULL default '0', + `em3_5` smallint(5) unsigned NOT NULL default '0', + `text4_0` longtext, + `text4_1` longtext, + `lang4` tinyint(3) unsigned NOT NULL default '0', + `prob4` float NOT NULL default '0', + `em4_0` smallint(5) unsigned NOT NULL default '0', + `em4_1` smallint(5) unsigned NOT NULL default '0', + `em4_2` smallint(5) unsigned NOT NULL default '0', + `em4_3` smallint(5) unsigned NOT NULL default '0', + `em4_4` smallint(5) unsigned NOT NULL default '0', + `em4_5` smallint(5) unsigned NOT NULL default '0', + `text5_0` longtext, + `text5_1` longtext, + `lang5` tinyint(3) unsigned NOT NULL default '0', + `prob5` float NOT NULL default '0', + `em5_0` smallint(5) unsigned NOT NULL default '0', + `em5_1` smallint(5) unsigned NOT NULL default '0', + `em5_2` smallint(5) unsigned NOT NULL default '0', + `em5_3` smallint(5) unsigned NOT NULL default '0', + `em5_4` smallint(5) unsigned NOT NULL default '0', + `em5_5` smallint(5) unsigned NOT NULL default '0', + `text6_0` longtext, + `text6_1` longtext, + `lang6` tinyint(3) unsigned NOT NULL default '0', + `prob6` float NOT NULL default '0', + `em6_0` smallint(5) unsigned NOT NULL default '0', + `em6_1` smallint(5) unsigned NOT NULL default '0', + `em6_2` smallint(5) unsigned NOT NULL default '0', + `em6_3` smallint(5) unsigned NOT NULL default '0', + `em6_4` smallint(5) unsigned NOT NULL default '0', + `em6_5` smallint(5) unsigned NOT NULL default '0', + `text7_0` longtext, + `text7_1` longtext, + `lang7` tinyint(3) unsigned NOT NULL default '0', + `prob7` float NOT NULL default '0', + `em7_0` smallint(5) unsigned NOT NULL default '0', + `em7_1` smallint(5) unsigned NOT NULL default '0', + `em7_2` smallint(5) unsigned NOT NULL default '0', + `em7_3` smallint(5) unsigned NOT NULL default '0', + `em7_4` smallint(5) unsigned NOT NULL default '0', + `em7_5` smallint(5) unsigned NOT NULL default '0', + PRIMARY KEY (`ID`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `npc_text` +-- + +LOCK TABLES `npc_text` WRITE; +/*!40000 ALTER TABLE `npc_text` DISABLE KEYS */; +/*!40000 ALTER TABLE `npc_text` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `npc_trainer` +-- + +DROP TABLE IF EXISTS `npc_trainer`; +CREATE TABLE `npc_trainer` ( + `entry` mediumint(8) unsigned NOT NULL default '0', + `spell` mediumint(8) unsigned NOT NULL default '0', + `spellcost` int(10) unsigned NOT NULL default '0', + `reqskill` smallint(5) unsigned NOT NULL default '0', + `reqskillvalue` smallint(5) unsigned NOT NULL default '0', + `reqlevel` tinyint(3) unsigned NOT NULL default '0', + PRIMARY KEY (`entry`,`spell`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `npc_trainer` +-- + +LOCK TABLES `npc_trainer` WRITE; +/*!40000 ALTER TABLE `npc_trainer` DISABLE KEYS */; +/*!40000 ALTER TABLE `npc_trainer` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `npc_vendor` +-- + +DROP TABLE IF EXISTS `npc_vendor`; +CREATE TABLE `npc_vendor` ( + `entry` mediumint(8) unsigned NOT NULL default '0', + `item` mediumint(8) unsigned NOT NULL default '0', + `maxcount` tinyint(3) unsigned NOT NULL default '0', + `incrtime` int(10) unsigned NOT NULL default '0', + `ExtendedCost` mediumint(8) unsigned NOT NULL default '0', + PRIMARY KEY (`entry`,`item`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Npc System'; + +-- +-- Dumping data for table `npc_vendor` +-- + +LOCK TABLES `npc_vendor` WRITE; +/*!40000 ALTER TABLE `npc_vendor` DISABLE KEYS */; +/*!40000 ALTER TABLE `npc_vendor` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `page_text` +-- + +DROP TABLE IF EXISTS `page_text`; +CREATE TABLE `page_text` ( + `entry` mediumint(8) unsigned NOT NULL default '0', + `text` longtext NOT NULL, + `next_page` mediumint(8) unsigned NOT NULL default '0', + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Item System'; + +-- +-- Dumping data for table `page_text` +-- + +LOCK TABLES `page_text` WRITE; +/*!40000 ALTER TABLE `page_text` DISABLE KEYS */; +/*!40000 ALTER TABLE `page_text` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `pet_levelstats` +-- + +DROP TABLE IF EXISTS `pet_levelstats`; +CREATE TABLE `pet_levelstats` ( + `creature_entry` mediumint(8) unsigned NOT NULL, + `level` tinyint(3) unsigned NOT NULL, + `hp` smallint(5) unsigned NOT NULL, + `mana` smallint(5) unsigned NOT NULL, + `armor` int(10) unsigned NOT NULL default '0', + `str` smallint(5) unsigned NOT NULL, + `agi` smallint(5) unsigned NOT NULL, + `sta` smallint(5) unsigned NOT NULL, + `inte` smallint(5) unsigned NOT NULL, + `spi` smallint(5) unsigned NOT NULL, + PRIMARY KEY (`creature_entry`,`level`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=0 COMMENT='Stores pet levels stats.'; + +-- +-- Dumping data for table `pet_levelstats` +-- + +LOCK TABLES `pet_levelstats` WRITE; +/*!40000 ALTER TABLE `pet_levelstats` DISABLE KEYS */; +/*!40000 ALTER TABLE `pet_levelstats` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `pet_name_generation` +-- + +DROP TABLE IF EXISTS `pet_name_generation`; +CREATE TABLE `pet_name_generation` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `word` tinytext NOT NULL, + `entry` mediumint(8) unsigned NOT NULL default '0', + `half` tinyint(4) NOT NULL default '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `pet_name_generation` +-- + +LOCK TABLES `pet_name_generation` WRITE; +/*!40000 ALTER TABLE `pet_name_generation` DISABLE KEYS */; +/*!40000 ALTER TABLE `pet_name_generation` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `petcreateinfo_spell` +-- + +DROP TABLE IF EXISTS `petcreateinfo_spell`; +CREATE TABLE `petcreateinfo_spell` ( + `entry` mediumint(8) unsigned NOT NULL default '0', + `Spell1` mediumint(8) unsigned NOT NULL default '0', + `Spell2` mediumint(8) unsigned NOT NULL default '0', + `Spell3` mediumint(8) unsigned NOT NULL default '0', + `Spell4` mediumint(8) unsigned NOT NULL default '0', + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Pet Create Spells'; + +-- +-- Dumping data for table `petcreateinfo_spell` +-- + +LOCK TABLES `petcreateinfo_spell` WRITE; +/*!40000 ALTER TABLE `petcreateinfo_spell` DISABLE KEYS */; +/*!40000 ALTER TABLE `petcreateinfo_spell` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `pickpocketing_loot_template` +-- + +DROP TABLE IF EXISTS `pickpocketing_loot_template`; +CREATE TABLE `pickpocketing_loot_template` ( + `entry` mediumint(8) unsigned NOT NULL default '0', + `item` mediumint(8) unsigned NOT NULL default '0', + `ChanceOrQuestChance` float NOT NULL default '100', + `groupid` tinyint(3) unsigned NOT NULL default '0', + `mincountOrRef` mediumint(9) NOT NULL default '1', + `maxcount` tinyint(3) unsigned NOT NULL default '1', + `lootcondition` tinyint(3) unsigned NOT NULL default '0', + `condition_value1` mediumint(8) unsigned NOT NULL default '0', + `condition_value2` mediumint(8) unsigned NOT NULL default '0', + PRIMARY KEY (`entry`,`item`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System'; + +-- +-- Dumping data for table `pickpocketing_loot_template` +-- + +LOCK TABLES `pickpocketing_loot_template` WRITE; +/*!40000 ALTER TABLE `pickpocketing_loot_template` DISABLE KEYS */; +/*!40000 ALTER TABLE `pickpocketing_loot_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `player_classlevelstats` +-- + +DROP TABLE IF EXISTS `player_classlevelstats`; +CREATE TABLE `player_classlevelstats` ( + `class` tinyint(3) unsigned NOT NULL, + `level` tinyint(3) unsigned NOT NULL, + `basehp` smallint(5) unsigned NOT NULL, + `basemana` smallint(5) unsigned NOT NULL, + PRIMARY KEY (`class`,`level`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=0 COMMENT='Stores levels stats.'; + +-- +-- Dumping data for table `player_classlevelstats` +-- + +LOCK TABLES `player_classlevelstats` WRITE; +/*!40000 ALTER TABLE `player_classlevelstats` DISABLE KEYS */; +/*!40000 ALTER TABLE `player_classlevelstats` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `player_levelstats` +-- + +DROP TABLE IF EXISTS `player_levelstats`; +CREATE TABLE `player_levelstats` ( + `race` tinyint(3) unsigned NOT NULL, + `class` tinyint(3) unsigned NOT NULL, + `level` tinyint(3) unsigned NOT NULL, + `str` tinyint(3) unsigned NOT NULL, + `agi` tinyint(3) unsigned NOT NULL, + `sta` tinyint(3) unsigned NOT NULL, + `inte` tinyint(3) unsigned NOT NULL, + `spi` tinyint(3) unsigned NOT NULL, + PRIMARY KEY (`race`,`class`,`level`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=0 COMMENT='Stores levels stats.'; + +-- +-- Dumping data for table `player_levelstats` +-- + +LOCK TABLES `player_levelstats` WRITE; +/*!40000 ALTER TABLE `player_levelstats` DISABLE KEYS */; +/*!40000 ALTER TABLE `player_levelstats` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `playercreateinfo` +-- + +DROP TABLE IF EXISTS `playercreateinfo`; +CREATE TABLE `playercreateinfo` ( + `race` tinyint(3) unsigned NOT NULL default '0', + `class` tinyint(3) unsigned NOT NULL default '0', + `map` smallint(5) unsigned NOT NULL default '0', + `zone` 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', + PRIMARY KEY (`race`,`class`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `playercreateinfo` +-- + +LOCK TABLES `playercreateinfo` WRITE; +/*!40000 ALTER TABLE `playercreateinfo` DISABLE KEYS */; +/*!40000 ALTER TABLE `playercreateinfo` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `playercreateinfo_action` +-- + +DROP TABLE IF EXISTS `playercreateinfo_action`; +CREATE TABLE `playercreateinfo_action` ( + `race` tinyint(3) unsigned NOT NULL default '0', + `class` tinyint(3) unsigned NOT NULL default '0', + `button` smallint(5) unsigned NOT NULL default '0', + `action` smallint(5) unsigned NOT NULL default '0', + `type` smallint(5) unsigned NOT NULL default '0', + `misc` smallint(5) unsigned NOT NULL default '0', + KEY `playercreateinfo_race_class_index` (`race`,`class`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `playercreateinfo_action` +-- + +LOCK TABLES `playercreateinfo_action` WRITE; +/*!40000 ALTER TABLE `playercreateinfo_action` DISABLE KEYS */; +/*!40000 ALTER TABLE `playercreateinfo_action` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `playercreateinfo_item` +-- + +DROP TABLE IF EXISTS `playercreateinfo_item`; +CREATE TABLE `playercreateinfo_item` ( + `race` tinyint(3) unsigned NOT NULL default '0', + `class` tinyint(3) unsigned NOT NULL default '0', + `itemid` mediumint(8) unsigned NOT NULL default '0', + `amount` tinyint(3) unsigned NOT NULL default '1', + KEY `playercreateinfo_race_class_index` (`race`,`class`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `playercreateinfo_item` +-- + +LOCK TABLES `playercreateinfo_item` WRITE; +/*!40000 ALTER TABLE `playercreateinfo_item` DISABLE KEYS */; +/*!40000 ALTER TABLE `playercreateinfo_item` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `playercreateinfo_spell` +-- + +DROP TABLE IF EXISTS `playercreateinfo_spell`; +CREATE TABLE `playercreateinfo_spell` ( + `race` tinyint(3) unsigned NOT NULL default '0', + `class` tinyint(3) unsigned NOT NULL default '0', + `Spell` mediumint(8) unsigned NOT NULL default '0', + `Note` varchar(255) default NULL, + `Active` tinyint(3) unsigned NOT NULL default '1', + PRIMARY KEY (`race`,`class`,`Spell`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `playercreateinfo_spell` +-- + +LOCK TABLES `playercreateinfo_spell` WRITE; +/*!40000 ALTER TABLE `playercreateinfo_spell` DISABLE KEYS */; +/*!40000 ALTER TABLE `playercreateinfo_spell` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `playercreateinfo_spell_custom` +-- + +DROP TABLE IF EXISTS `playercreateinfo_spell_custom`; +CREATE TABLE `playercreateinfo_spell_custom` ( + `race` tinyint(3) unsigned NOT NULL default '0', + `class` tinyint(3) unsigned NOT NULL default '0', + `Spell` mediumint(8) unsigned NOT NULL default '0', + `Note` varchar(255) default NULL, + `Active` tinyint(3) unsigned NOT NULL default '1', + PRIMARY KEY (`race`,`class`,`Spell`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `playercreateinfo_spell_custom` +-- + +LOCK TABLES `playercreateinfo_spell_custom` WRITE; +/*!40000 ALTER TABLE `playercreateinfo_spell_custom` DISABLE KEYS */; +/*!40000 ALTER TABLE `playercreateinfo_spell_custom` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `prospecting_loot_template` +-- + +DROP TABLE IF EXISTS `prospecting_loot_template`; +CREATE TABLE `prospecting_loot_template` ( + `entry` mediumint(8) unsigned NOT NULL default '0', + `item` mediumint(8) unsigned NOT NULL default '0', + `ChanceOrQuestChance` float NOT NULL default '100', + `groupid` tinyint(3) unsigned NOT NULL default '0', + `mincountOrRef` mediumint(9) NOT NULL default '1', + `maxcount` tinyint(3) unsigned NOT NULL default '1', + `lootcondition` tinyint(3) unsigned NOT NULL default '0', + `condition_value1` mediumint(8) unsigned NOT NULL default '0', + `condition_value2` mediumint(8) unsigned NOT NULL default '0', + PRIMARY KEY (`entry`,`item`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System'; + +-- +-- Dumping data for table `prospecting_loot_template` +-- + +LOCK TABLES `prospecting_loot_template` WRITE; +/*!40000 ALTER TABLE `prospecting_loot_template` DISABLE KEYS */; +/*!40000 ALTER TABLE `prospecting_loot_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `quest_end_scripts` +-- + +DROP TABLE IF EXISTS `quest_end_scripts`; +CREATE TABLE `quest_end_scripts` ( + `id` mediumint(8) unsigned NOT NULL default '0', + `delay` int(10) unsigned NOT NULL default '0', + `command` mediumint(8) unsigned NOT NULL default '0', + `datalong` mediumint(8) unsigned NOT NULL default '0', + `datalong2` int(10) unsigned NOT NULL default '0', + `datatext` text NOT NULL, + `x` float NOT NULL default '0', + `y` float NOT NULL default '0', + `z` float NOT NULL default '0', + `o` float NOT NULL default '0' +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `quest_end_scripts` +-- + +LOCK TABLES `quest_end_scripts` WRITE; +/*!40000 ALTER TABLE `quest_end_scripts` DISABLE KEYS */; +/*!40000 ALTER TABLE `quest_end_scripts` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `quest_mail_loot_template` +-- + +DROP TABLE IF EXISTS `quest_mail_loot_template`; +CREATE TABLE `quest_mail_loot_template` ( + `entry` mediumint(8) unsigned NOT NULL default '0', + `item` mediumint(8) unsigned NOT NULL default '0', + `ChanceOrQuestChance` float NOT NULL default '100', + `groupid` tinyint(3) unsigned NOT NULL default '0', + `mincountOrRef` mediumint(9) NOT NULL default '1', + `maxcount` tinyint(3) unsigned NOT NULL default '1', + `lootcondition` tinyint(3) unsigned NOT NULL default '0', + `condition_value1` mediumint(8) unsigned NOT NULL default '0', + `condition_value2` mediumint(8) unsigned NOT NULL default '0', + PRIMARY KEY (`entry`,`item`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System'; + +-- +-- Dumping data for table `quest_mail_loot_template` +-- + +LOCK TABLES `quest_mail_loot_template` WRITE; +/*!40000 ALTER TABLE `quest_mail_loot_template` DISABLE KEYS */; +/*!40000 ALTER TABLE `quest_mail_loot_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `quest_start_scripts` +-- + +DROP TABLE IF EXISTS `quest_start_scripts`; +CREATE TABLE `quest_start_scripts` ( + `id` mediumint(8) unsigned NOT NULL default '0', + `delay` int(10) unsigned NOT NULL default '0', + `command` mediumint(8) unsigned NOT NULL default '0', + `datalong` mediumint(8) unsigned NOT NULL default '0', + `datalong2` int(10) unsigned NOT NULL default '0', + `datatext` text NOT NULL, + `x` float NOT NULL default '0', + `y` float NOT NULL default '0', + `z` float NOT NULL default '0', + `o` float NOT NULL default '0' +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `quest_start_scripts` +-- + +LOCK TABLES `quest_start_scripts` WRITE; +/*!40000 ALTER TABLE `quest_start_scripts` DISABLE KEYS */; +/*!40000 ALTER TABLE `quest_start_scripts` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `quest_template` +-- + +DROP TABLE IF EXISTS `quest_template`; +CREATE TABLE `quest_template` ( + `entry` mediumint(8) unsigned NOT NULL default '0', + `Method` tinyint(3) unsigned NOT NULL default '2', + `ZoneOrSort` smallint(6) NOT NULL default '0', + `SkillOrClass` smallint(6) NOT NULL default '0', + `MinLevel` tinyint(3) unsigned NOT NULL default '0', + `QuestLevel` tinyint(3) unsigned NOT NULL default '0', + `Type` smallint(5) unsigned NOT NULL default '0', + `RequiredRaces` smallint(5) unsigned NOT NULL default '0', + `RequiredSkillValue` smallint(5) unsigned NOT NULL default '0', + `RepObjectiveFaction` smallint(5) unsigned NOT NULL default '0', + `RepObjectiveValue` mediumint(9) NOT NULL default '0', + `RequiredMinRepFaction` smallint(5) unsigned NOT NULL default '0', + `RequiredMinRepValue` mediumint(9) NOT NULL default '0', + `RequiredMaxRepFaction` smallint(5) unsigned NOT NULL default '0', + `RequiredMaxRepValue` mediumint(9) NOT NULL default '0', + `SuggestedPlayers` tinyint(3) unsigned NOT NULL default '0', + `LimitTime` int(10) unsigned NOT NULL default '0', + `QuestFlags` smallint(5) unsigned NOT NULL default '0', + `SpecialFlags` tinyint(3) unsigned NOT NULL default '0', + `CharTitleId` tinyint(3) unsigned NOT NULL default '0', + `PrevQuestId` mediumint(9) NOT NULL default '0', + `NextQuestId` mediumint(9) NOT NULL default '0', + `ExclusiveGroup` mediumint(9) NOT NULL default '0', + `NextQuestInChain` mediumint(8) unsigned NOT NULL default '0', + `SrcItemId` mediumint(8) unsigned NOT NULL default '0', + `SrcItemCount` tinyint(3) unsigned NOT NULL default '0', + `SrcSpell` mediumint(8) unsigned NOT NULL default '0', + `Title` text, + `Details` text, + `Objectives` text, + `OfferRewardText` text, + `RequestItemsText` text, + `EndText` text, + `ObjectiveText1` text, + `ObjectiveText2` text, + `ObjectiveText3` text, + `ObjectiveText4` text, + `ReqItemId1` mediumint(8) unsigned NOT NULL default '0', + `ReqItemId2` mediumint(8) unsigned NOT NULL default '0', + `ReqItemId3` mediumint(8) unsigned NOT NULL default '0', + `ReqItemId4` mediumint(8) unsigned NOT NULL default '0', + `ReqItemCount1` smallint(5) unsigned NOT NULL default '0', + `ReqItemCount2` smallint(5) unsigned NOT NULL default '0', + `ReqItemCount3` smallint(5) unsigned NOT NULL default '0', + `ReqItemCount4` smallint(5) unsigned NOT NULL default '0', + `ReqSourceId1` mediumint(8) unsigned NOT NULL default '0', + `ReqSourceId2` mediumint(8) unsigned NOT NULL default '0', + `ReqSourceId3` mediumint(8) unsigned NOT NULL default '0', + `ReqSourceId4` mediumint(8) unsigned NOT NULL default '0', + `ReqSourceCount1` smallint(5) unsigned NOT NULL default '0', + `ReqSourceCount2` smallint(5) unsigned NOT NULL default '0', + `ReqSourceCount3` smallint(5) unsigned NOT NULL default '0', + `ReqSourceCount4` smallint(5) unsigned NOT NULL default '0', + `ReqSourceRef1` tinyint(3) unsigned NOT NULL default '0', + `ReqSourceRef2` tinyint(3) unsigned NOT NULL default '0', + `ReqSourceRef3` tinyint(3) unsigned NOT NULL default '0', + `ReqSourceRef4` tinyint(3) unsigned NOT NULL default '0', + `ReqCreatureOrGOId1` mediumint(9) NOT NULL default '0', + `ReqCreatureOrGOId2` mediumint(9) NOT NULL default '0', + `ReqCreatureOrGOId3` mediumint(9) NOT NULL default '0', + `ReqCreatureOrGOId4` mediumint(9) NOT NULL default '0', + `ReqCreatureOrGOCount1` smallint(5) unsigned NOT NULL default '0', + `ReqCreatureOrGOCount2` smallint(5) unsigned NOT NULL default '0', + `ReqCreatureOrGOCount3` smallint(5) unsigned NOT NULL default '0', + `ReqCreatureOrGOCount4` smallint(5) unsigned NOT NULL default '0', + `ReqSpellCast1` mediumint(8) unsigned NOT NULL default '0', + `ReqSpellCast2` mediumint(8) unsigned NOT NULL default '0', + `ReqSpellCast3` mediumint(8) unsigned NOT NULL default '0', + `ReqSpellCast4` mediumint(8) unsigned NOT NULL default '0', + `RewChoiceItemId1` mediumint(8) unsigned NOT NULL default '0', + `RewChoiceItemId2` mediumint(8) unsigned NOT NULL default '0', + `RewChoiceItemId3` mediumint(8) unsigned NOT NULL default '0', + `RewChoiceItemId4` mediumint(8) unsigned NOT NULL default '0', + `RewChoiceItemId5` mediumint(8) unsigned NOT NULL default '0', + `RewChoiceItemId6` mediumint(8) unsigned NOT NULL default '0', + `RewChoiceItemCount1` smallint(5) unsigned NOT NULL default '0', + `RewChoiceItemCount2` smallint(5) unsigned NOT NULL default '0', + `RewChoiceItemCount3` smallint(5) unsigned NOT NULL default '0', + `RewChoiceItemCount4` smallint(5) unsigned NOT NULL default '0', + `RewChoiceItemCount5` smallint(5) unsigned NOT NULL default '0', + `RewChoiceItemCount6` smallint(5) unsigned NOT NULL default '0', + `RewItemId1` mediumint(8) unsigned NOT NULL default '0', + `RewItemId2` mediumint(8) unsigned NOT NULL default '0', + `RewItemId3` mediumint(8) unsigned NOT NULL default '0', + `RewItemId4` mediumint(8) unsigned NOT NULL default '0', + `RewItemCount1` smallint(5) unsigned NOT NULL default '0', + `RewItemCount2` smallint(5) unsigned NOT NULL default '0', + `RewItemCount3` smallint(5) unsigned NOT NULL default '0', + `RewItemCount4` smallint(5) unsigned NOT NULL default '0', + `RewRepFaction1` smallint(5) unsigned NOT NULL default '0' COMMENT 'faction id from Faction.dbc in this case', + `RewRepFaction2` smallint(5) unsigned NOT NULL default '0' COMMENT 'faction id from Faction.dbc in this case', + `RewRepFaction3` smallint(5) unsigned NOT NULL default '0' COMMENT 'faction id from Faction.dbc in this case', + `RewRepFaction4` smallint(5) unsigned NOT NULL default '0' COMMENT 'faction id from Faction.dbc in this case', + `RewRepFaction5` smallint(5) unsigned NOT NULL default '0' COMMENT 'faction id from Faction.dbc in this case', + `RewRepValue1` mediumint(9) NOT NULL default '0', + `RewRepValue2` mediumint(9) NOT NULL default '0', + `RewRepValue3` mediumint(9) NOT NULL default '0', + `RewRepValue4` mediumint(9) NOT NULL default '0', + `RewRepValue5` mediumint(9) NOT NULL default '0', + `RewHonorableKills` mediumint(9) unsigned NOT NULL default '0', + `RewOrReqMoney` int(11) NOT NULL default '0', + `RewMoneyMaxLevel` int(10) unsigned NOT NULL default '0', + `RewSpell` mediumint(8) unsigned NOT NULL default '0', + `RewSpellCast` mediumint(8) unsigned NOT NULL default '0', + `RewMailTemplateId` mediumint(8) unsigned NOT NULL default '0', + `RewMailDelaySecs` int(11) unsigned NOT NULL default '0', + `PointMapId` smallint(5) unsigned NOT NULL default '0', + `PointX` float NOT NULL default '0', + `PointY` float NOT NULL default '0', + `PointOpt` mediumint(8) unsigned NOT NULL default '0', + `DetailsEmote1` smallint(5) unsigned NOT NULL default '0', + `DetailsEmote2` smallint(5) unsigned NOT NULL default '0', + `DetailsEmote3` smallint(5) unsigned NOT NULL default '0', + `DetailsEmote4` smallint(5) unsigned NOT NULL default '0', + `IncompleteEmote` smallint(5) unsigned NOT NULL default '0', + `CompleteEmote` smallint(5) unsigned NOT NULL default '0', + `OfferRewardEmote1` smallint(5) unsigned NOT NULL default '0', + `OfferRewardEmote2` smallint(5) unsigned NOT NULL default '0', + `OfferRewardEmote3` smallint(5) unsigned NOT NULL default '0', + `OfferRewardEmote4` smallint(5) unsigned NOT NULL default '0', + `StartScript` mediumint(8) unsigned NOT NULL default '0', + `CompleteScript` mediumint(8) unsigned NOT NULL default '0', + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Quest System'; + +-- +-- Dumping data for table `quest_template` +-- + +LOCK TABLES `quest_template` WRITE; +/*!40000 ALTER TABLE `quest_template` DISABLE KEYS */; +/*!40000 ALTER TABLE `quest_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `reference_loot_template` +-- + +DROP TABLE IF EXISTS `reference_loot_template`; +CREATE TABLE `reference_loot_template` ( + `entry` mediumint(8) unsigned NOT NULL default '0', + `item` mediumint(8) unsigned NOT NULL default '0', + `ChanceOrQuestChance` float NOT NULL default '100', + `groupid` tinyint(3) unsigned NOT NULL default '0', + `mincountOrRef` mediumint(9) NOT NULL default '1', + `maxcount` tinyint(3) unsigned NOT NULL default '1', + `lootcondition` tinyint(3) unsigned NOT NULL default '0', + `condition_value1` mediumint(8) unsigned NOT NULL default '0', + `condition_value2` mediumint(8) unsigned NOT NULL default '0', + PRIMARY KEY (`entry`,`item`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System'; + +-- +-- Dumping data for table `reference_loot_template` +-- + +LOCK TABLES `reference_loot_template` WRITE; +/*!40000 ALTER TABLE `reference_loot_template` DISABLE KEYS */; +/*!40000 ALTER TABLE `reference_loot_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `reserved_name` +-- + +DROP TABLE IF EXISTS `reserved_name`; +CREATE TABLE `reserved_name` ( + `name` varchar(12) NOT NULL default '', + PRIMARY KEY (`name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Player Reserved Names'; + +-- +-- Dumping data for table `reserved_name` +-- + +LOCK TABLES `reserved_name` WRITE; +/*!40000 ALTER TABLE `reserved_name` DISABLE KEYS */; +/*!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` +-- + +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` tinyint(3) unsigned NOT NULL default '0', + `type` tinyint(3) unsigned NOT NULL default '0', + `language` tinyint(3) 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 `skill_discovery_template` +-- + +DROP TABLE IF EXISTS `skill_discovery_template`; +CREATE TABLE `skill_discovery_template` ( + `spellId` mediumint(8) unsigned NOT NULL default '0' COMMENT 'SpellId of the discoverable spell', + `reqSpell` mediumint(8) unsigned NOT NULL default '0' COMMENT 'spell requirement', + `chance` float NOT NULL default '0' COMMENT 'chance to discover', + PRIMARY KEY (`spellId`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Skill Discovery System'; + +-- +-- Dumping data for table `skill_discovery_template` +-- + +LOCK TABLES `skill_discovery_template` WRITE; +/*!40000 ALTER TABLE `skill_discovery_template` DISABLE KEYS */; +/*!40000 ALTER TABLE `skill_discovery_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `skill_extra_item_template` +-- + +DROP TABLE IF EXISTS `skill_extra_item_template`; +CREATE TABLE `skill_extra_item_template` ( + `spellId` mediumint(8) unsigned NOT NULL default '0' COMMENT 'SpellId of the item creation spell', + `requiredSpecialization` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Specialization spell id', + `additionalCreateChance` float NOT NULL default '0' COMMENT 'chance to create add', + `additionalMaxNum` tinyint(3) unsigned NOT NULL default '0' COMMENT 'max num of adds', + PRIMARY KEY (`spellId`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Skill Specialization System'; + +-- +-- Dumping data for table `skill_extra_item_template` +-- + +LOCK TABLES `skill_extra_item_template` WRITE; +/*!40000 ALTER TABLE `skill_extra_item_template` DISABLE KEYS */; +/*!40000 ALTER TABLE `skill_extra_item_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `skill_fishing_base_level` +-- + +DROP TABLE IF EXISTS `skill_fishing_base_level`; +CREATE TABLE `skill_fishing_base_level` ( + `entry` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Area identifier', + `skill` smallint(6) NOT NULL default '0' COMMENT 'Base skill level requirement', + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Fishing system'; + +-- +-- Dumping data for table `skill_fishing_base_level` +-- + +LOCK TABLES `skill_fishing_base_level` WRITE; +/*!40000 ALTER TABLE `skill_fishing_base_level` DISABLE KEYS */; +/*!40000 ALTER TABLE `skill_fishing_base_level` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `skinning_loot_template` +-- + +DROP TABLE IF EXISTS `skinning_loot_template`; +CREATE TABLE `skinning_loot_template` ( + `entry` mediumint(8) unsigned NOT NULL default '0', + `item` mediumint(8) unsigned NOT NULL default '0', + `ChanceOrQuestChance` float NOT NULL default '100', + `groupid` tinyint(3) unsigned NOT NULL default '0', + `mincountOrRef` mediumint(9) NOT NULL default '1', + `maxcount` tinyint(3) unsigned NOT NULL default '1', + `lootcondition` tinyint(3) unsigned NOT NULL default '0', + `condition_value1` mediumint(8) unsigned NOT NULL default '0', + `condition_value2` mediumint(8) unsigned NOT NULL default '0', + PRIMARY KEY (`entry`,`item`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Loot System'; + +-- +-- Dumping data for table `skinning_loot_template` +-- + +LOCK TABLES `skinning_loot_template` WRITE; +/*!40000 ALTER TABLE `skinning_loot_template` DISABLE KEYS */; +/*!40000 ALTER TABLE `skinning_loot_template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `spell_affect` +-- + +DROP TABLE IF EXISTS `spell_affect`; +CREATE TABLE `spell_affect` ( + `entry` smallint(5) unsigned NOT NULL default '0', + `effectId` tinyint(3) unsigned NOT NULL default '0', + `SpellFamilyMask` bigint(20) unsigned NOT NULL default '0', + PRIMARY KEY (`entry`,`effectId`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `spell_affect` +-- + +LOCK TABLES `spell_affect` WRITE; +/*!40000 ALTER TABLE `spell_affect` DISABLE KEYS */; +/*!40000 ALTER TABLE `spell_affect` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `spell_chain` +-- + +DROP TABLE IF EXISTS `spell_chain`; +CREATE TABLE `spell_chain` ( + `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` +-- + +LOCK TABLES `spell_chain` WRITE; +/*!40000 ALTER TABLE `spell_chain` DISABLE KEYS */; +/*!40000 ALTER TABLE `spell_chain` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `spell_disabled` +-- + +DROP TABLE IF EXISTS `spell_disabled`; +CREATE TABLE `spell_disabled` ( + `entry` int(11) unsigned NOT NULL default '0' COMMENT 'Spell entry', + `disable_mask` int(8) unsigned NOT NULL default '0', + `comment` varchar(64) NOT NULL default '', + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Disabled Spell System'; + +-- +-- Dumping data for table `spell_disabled` +-- + +LOCK TABLES `spell_disabled` WRITE; +/*!40000 ALTER TABLE `spell_disabled` DISABLE KEYS */; +/*!40000 ALTER TABLE `spell_disabled` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `spell_elixir` +-- + +DROP TABLE IF EXISTS `spell_elixir`; +CREATE TABLE `spell_elixir` ( + `entry` int(11) unsigned NOT NULL default '0' COMMENT 'SpellId of potion', + `mask` tinyint(1) unsigned NOT NULL default '0' COMMENT 'Mask 0x1 battle 0x2 guardian 0x3 flask 0x7 unstable flasks 0xB shattrath flasks', + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Spell System'; + +-- +-- Dumping data for table `spell_elixir` +-- + +LOCK TABLES `spell_elixir` WRITE; +/*!40000 ALTER TABLE `spell_elixir` DISABLE KEYS */; +/*!40000 ALTER TABLE `spell_elixir` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `spell_learn_spell` +-- + +DROP TABLE IF EXISTS `spell_learn_spell`; +CREATE TABLE `spell_learn_spell` ( + `entry` smallint(5) unsigned NOT NULL default '0', + `SpellID` smallint(5) unsigned NOT NULL default '0', + PRIMARY KEY (`entry`,`SpellID`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Item System'; + +-- +-- Dumping data for table `spell_learn_spell` +-- + +LOCK TABLES `spell_learn_spell` WRITE; +/*!40000 ALTER TABLE `spell_learn_spell` DISABLE KEYS */; +/*!40000 ALTER TABLE `spell_learn_spell` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `spell_pet_auras` +-- + +DROP TABLE IF EXISTS `spell_pet_auras`; +CREATE TABLE `spell_pet_auras` ( + `spell` mediumint(8) unsigned NOT NULL COMMENT 'dummy spell id', + `pet` mediumint(8) unsigned NOT NULL default '0' COMMENT 'pet id; 0 = all', + `aura` mediumint(8) unsigned NOT NULL COMMENT 'pet aura id', + PRIMARY KEY (`spell`,`pet`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `spell_pet_auras` +-- + +LOCK TABLES `spell_pet_auras` WRITE; +/*!40000 ALTER TABLE `spell_pet_auras` DISABLE KEYS */; +/*!40000 ALTER TABLE `spell_pet_auras` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `spell_proc_event` +-- + +DROP TABLE IF EXISTS `spell_proc_event`; +CREATE TABLE `spell_proc_event` ( + `entry` smallint(5) unsigned NOT NULL default '0', + `SchoolMask` tinyint(4) NOT NULL default '0', + `Category` smallint(6) NOT NULL default '0', + `SkillID` smallint(6) NOT NULL default '0', + `SpellFamilyName` smallint(5) unsigned NOT NULL default '0', + `SpellFamilyMask` bigint(20) unsigned NOT NULL default '0', + `procFlags` int(10) unsigned NOT NULL default '0', + `ppmRate` float NOT NULL default '0', + `cooldown` int(10) unsigned NOT NULL default '0', + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `spell_proc_event` +-- + +LOCK TABLES `spell_proc_event` WRITE; +/*!40000 ALTER TABLE `spell_proc_event` DISABLE KEYS */; +/*!40000 ALTER TABLE `spell_proc_event` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `spell_script_target` +-- + +DROP TABLE IF EXISTS `spell_script_target`; +CREATE TABLE `spell_script_target` ( + `entry` mediumint(8) unsigned NOT NULL, + `type` tinyint(3) unsigned NOT NULL default '0', + `targetEntry` mediumint(8) unsigned NOT NULL default '0', + UNIQUE KEY `entry_type_target` (`entry`,`type`,`targetEntry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Spell System'; + +-- +-- Dumping data for table `spell_script_target` +-- + +LOCK TABLES `spell_script_target` WRITE; +/*!40000 ALTER TABLE `spell_script_target` DISABLE KEYS */; +/*!40000 ALTER TABLE `spell_script_target` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `spell_scripts` +-- + +DROP TABLE IF EXISTS `spell_scripts`; +CREATE TABLE `spell_scripts` ( + `id` mediumint(8) unsigned NOT NULL default '0', + `delay` int(10) unsigned NOT NULL default '0', + `command` mediumint(8) unsigned NOT NULL default '0', + `datalong` mediumint(8) unsigned NOT NULL default '0', + `datalong2` int(10) unsigned NOT NULL default '0', + `datatext` text character set latin1 NOT NULL, + `x` float NOT NULL default '0', + `y` float NOT NULL default '0', + `z` float NOT NULL default '0', + `o` float NOT NULL default '0' +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `spell_scripts` +-- + +LOCK TABLES `spell_scripts` WRITE; +/*!40000 ALTER TABLE `spell_scripts` DISABLE KEYS */; +/*!40000 ALTER TABLE `spell_scripts` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `spell_target_position` +-- + +DROP TABLE IF EXISTS `spell_target_position`; +CREATE TABLE `spell_target_position` ( + `id` mediumint(8) unsigned NOT NULL default '0' COMMENT 'Identifier', + `target_map` smallint(5) unsigned NOT NULL default '0', + `target_position_x` float NOT NULL default '0', + `target_position_y` float NOT NULL default '0', + `target_position_z` float NOT NULL default '0', + `target_orientation` float NOT NULL default '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Spell System'; + +-- +-- Dumping data for table `spell_target_position` +-- + +LOCK TABLES `spell_target_position` WRITE; +/*!40000 ALTER TABLE `spell_target_position` DISABLE KEYS */; +/*!40000 ALTER TABLE `spell_target_position` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `spell_threat` +-- + +DROP TABLE IF EXISTS `spell_threat`; +CREATE TABLE `spell_threat` ( + `entry` mediumint(8) unsigned NOT NULL, + `Threat` smallint(6) NOT NULL, + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED; + +-- +-- Dumping data for table `spell_threat` +-- + +LOCK TABLES `spell_threat` WRITE; +/*!40000 ALTER TABLE `spell_threat` DISABLE KEYS */; +/*!40000 ALTER TABLE `spell_threat` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `transports` +-- + +DROP TABLE IF EXISTS `transports`; +CREATE TABLE `transports` ( + `entry` mediumint(8) unsigned NOT NULL default '0', + `name` text, + `period` mediumint(8) unsigned NOT NULL default '0', + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Transports'; + +-- +-- Dumping data for table `transports` +-- + +LOCK TABLES `transports` WRITE; +/*!40000 ALTER TABLE `transports` DISABLE KEYS */; +/*!40000 ALTER TABLE `transports` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `trinity_string` +-- + +DROP TABLE IF EXISTS `trinity_string`; +CREATE TABLE `trinity_string` ( + `entry` mediumint(8) unsigned NOT NULL default '0', + `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, + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `trinity_string` +-- + +LOCK TABLES `trinity_string` WRITE; +/*!40000 ALTER TABLE `trinity_string` DISABLE KEYS */; +/*!40000 ALTER TABLE `trinity_string` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `uptime` +-- + +DROP TABLE IF EXISTS `uptime`; +CREATE TABLE `uptime` ( + `starttime` bigint(20) unsigned NOT NULL default '0', + `startstring` varchar(64) NOT NULL default '', + `uptime` bigint(20) unsigned NOT NULL default '0', + `maxplayers` smallint(5) unsigned NOT NULL default '0', + PRIMARY KEY (`starttime`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Uptime system'; + +-- +-- Dumping data for table `uptime` +-- + +LOCK TABLES `uptime` WRITE; +/*!40000 ALTER TABLE `uptime` DISABLE KEYS */; +/*!40000 ALTER TABLE `uptime` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2008-10-14 13:23:35 diff --git a/src/game/Chat.cpp b/src/game/Chat.cpp index 951f443e479..745a2f6e268 100644 --- a/src/game/Chat.cpp +++ b/src/game/Chat.cpp @@ -134,15 +134,18 @@ ChatCommand * ChatHandler::getCommandTable() { NULL, 0, false, NULL, "", NULL } }; - static ChatCommand wpCommandTable[] = - { - { "show", SEC_GAMEMASTER, false, &ChatHandler::HandleWpShowCommand, "", NULL }, - { "add", SEC_GAMEMASTER, false, &ChatHandler::HandleWpAddCommand, "", NULL }, - { "modify", SEC_GAMEMASTER, false, &ChatHandler::HandleWpModifyCommand, "", NULL }, - { "export", SEC_ADMINISTRATOR, false, &ChatHandler::HandleWpExportCommand, "", NULL }, - { "import", SEC_ADMINISTRATOR, false, &ChatHandler::HandleWpImportCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } - }; + static ChatCommand wpCommandTable[] = + { + { "show", SEC_GAMEMASTER, false, &ChatHandler::HandleWpShowCommand, "", NULL }, + { "addwp", SEC_GAMEMASTER, false, &ChatHandler::HandleWpAddCommand, "", NULL }, + { "load", SEC_GAMEMASTER, false, &ChatHandler::HandleWpLoadPathCommand, "", NULL }, + { "modify", SEC_GAMEMASTER, false, &ChatHandler::HandleWpModifyCommand, "", NULL }, + { "event", SEC_GAMEMASTER, false, &ChatHandler::HandleWpEventCommand, "", NULL }, + { "unload", SEC_GAMEMASTER, false, &ChatHandler::HandleWpUnLoadPathCommand, "", NULL }, + + { NULL, 0, false, NULL, "", NULL } + }; + static ChatCommand banCommandTable[] = { @@ -293,6 +296,7 @@ ChatCommand * ChatHandler::getCommandTable() { "locales_npc_text", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesNpcTextCommand, "", NULL }, { "locales_page_text", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesPageTextCommand, "", NULL }, { "locales_quest", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesQuestCommand, "", NULL }, + { "waypoint_scripts", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadWpScriptsCommand, "", NULL }, { "", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadCommand, "", NULL }, { NULL, 0, false, NULL, "", NULL } @@ -507,8 +511,12 @@ ChatCommand * ChatHandler::getCommandTable() { "event", SEC_GAMEMASTER, false, NULL, "", eventCommandTable }, { "gobject", SEC_GAMEMASTER, false, NULL, "", gobjectCommandTable }, { "honor", SEC_GAMEMASTER, false, NULL, "", honorCommandTable }, - { "wp", SEC_GAMEMASTER, false, NULL, "", wpCommandTable }, - { "quest", SEC_ADMINISTRATOR, false, NULL, "", questCommandTable }, + + //wp commands + { "path", SEC_GAMEMASTER, false, NULL, "", wpCommandTable }, + { "loadpath", SEC_ADMINISTRATOR, false, &ChatHandler::HandleReloadAllPaths, "", NULL }, + + { "quest", SEC_ADMINISTRATOR, false, NULL, "", questCommandTable }, { "reload", SEC_ADMINISTRATOR, true, NULL, "", reloadCommandTable }, { "list", SEC_ADMINISTRATOR, true, NULL, "", listCommandTable }, { "lookup", SEC_ADMINISTRATOR, true, NULL, "", lookupCommandTable }, diff --git a/src/game/Chat.h b/src/game/Chat.h index b62bae39d17..faa84b032b9 100644 --- a/src/game/Chat.h +++ b/src/game/Chat.h @@ -211,7 +211,8 @@ class ChatHandler bool HandleReloadConfigCommand(const char* args); - bool HandleReloadAreaTriggerTavernCommand(const char* args); + bool HandleReloadWpScriptsCommand(const char* args); + bool HandleReloadAreaTriggerTavernCommand(const char* args); bool HandleReloadAreaTriggerTeleportCommand(const char* args); bool HandleReloadEventScriptsCommand(const char* args); bool HandleReloadCommandCommand(const char* args); @@ -410,11 +411,16 @@ class ChatHandler bool HandlePasswordCommand(const char* args); bool HandleLockAccountCommand(const char* args); bool HandleRespawnCommand(const char* args); - bool HandleWpAddCommand(const char* args); - bool HandleWpModifyCommand(const char* args); - bool HandleWpShowCommand(const char* args); - bool HandleWpExportCommand(const char* args); - bool HandleWpImportCommand(const char* args); + + //New Wp Commands + bool HandleWpAddCommand(const char* args); + bool HandleWpLoadPathCommand(const char* args); + bool HandleWpUnLoadPathCommand(const char* args); + bool HandleWpModifyCommand(const char* args); + bool HandleWpEventCommand(const char* args); + bool HandleWpShowCommand(const char* args); + bool HandleReloadAllPaths(const char *args); + bool HandleFlyModeCommand(const char* args); bool HandleSendOpcodeCommand(const char* args); bool HandleSellErrorCommand(const char* args); diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index 80eba6fde98..4f8132fe404 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -2068,6 +2068,10 @@ bool Creature::LoadCreaturesAddon(bool reload) if (cainfo->move_flags != 0) SetUnitMovementFlags(cainfo->move_flags); + //Load Path + if (cainfo->path_id != 0) + m_path_id = cainfo->path_id; + if(cainfo->auras) { for (CreatureDataAddonAura const* cAura = cainfo->auras; cAura->spell_id; ++cAura) diff --git a/src/game/Creature.h b/src/game/Creature.h index 31386d3b180..fce9854e6cf 100644 --- a/src/game/Creature.h +++ b/src/game/Creature.h @@ -279,7 +279,8 @@ struct CreatureDataAddonAura struct CreatureDataAddon { uint32 guidOrEntry; - uint32 mount; + uint32 path_id; + uint32 mount; uint32 bytes0; uint32 bytes1; uint32 bytes2; @@ -616,7 +617,14 @@ class TRINITY_DLL_SPEC Creature : public Unit void GetCombatStartPosition(float &x, float &y, float &z) { x = CombatStartX; y = CombatStartY; z = CombatStartZ; } uint32 GetGlobalCooldown() const { return m_GlobalCooldown; } - protected: + + uint32 GetWaypointPath(){return m_path_id;} + void LoadPath(uint32 pathid) { m_path_id = pathid; } + + uint32 GetCurrentWaypointID(){return m_waypointID;} + void UpdateWaypointID(uint32 wpID){m_waypointID = wpID;} + + protected: bool CreateFromProto(uint32 guidlow,uint32 Entry,uint32 team, const CreatureData *data = NULL); bool InitEntry(uint32 entry, uint32 team=ALLIANCE, const CreatureData* data=NULL); @@ -666,7 +674,11 @@ class TRINITY_DLL_SPEC Creature : public Unit float CombatStartZ; private: - GridReference m_gridRef; + //WaypointMovementGenerator vars + uint32 m_waypointID; + uint32 m_path_id; + + GridReference m_gridRef; CreatureInfo const* m_creatureInfo; // in heroic mode can different from ObjMgr::GetCreatureTemplate(GetEntry()) }; diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp index bb6a4473e0b..a9e74926a76 100644 --- a/src/game/Level2.cpp +++ b/src/game/Level2.cpp @@ -1371,11 +1371,9 @@ bool ChatHandler::HandleNpcAddMoveCommand(const char* args) Player* player = m_session->GetPlayer(); - WaypointMgr.AddLastNode(lowguid, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation(), wait, 0); - // update movement type WorldDatabase.PExecuteLog("UPDATE creature SET MovementType = '%u' WHERE guid = '%u'", WAYPOINT_MOTION_TYPE,lowguid); - if(pCreature) + if(pCreature && pCreature->GetWaypointPath()) { pCreature->SetDefaultMovementType(WAYPOINT_MOTION_TYPE); pCreature->GetMotionMaster()->Initialize(); @@ -1387,8 +1385,6 @@ bool ChatHandler::HandleNpcAddMoveCommand(const char* args) pCreature->SaveToDB(); } - SendSysMessage(LANG_WAYPOINT_ADDED); - return true; } @@ -1507,13 +1503,13 @@ bool ChatHandler::HandleNpcSetMoveTypeCommand(const char* args) else return false; - // update movement type - if(doNotDelete == false) - WaypointMgr.DeletePath(lowguid); - if(pCreature) { - pCreature->SetDefaultMovementType(move_type); + // update movement type + if(doNotDelete == false) + pCreature->LoadPath(0); + + pCreature->SetDefaultMovementType(move_type); pCreature->GetMotionMaster()->Initialize(); if(pCreature->isAlive()) // dead creature will reset movement generator at respawn { @@ -2159,1151 +2155,1122 @@ bool ChatHandler::HandleNpcSpawnTimeCommand(const char* args) return true; } - -/** - * Add a waypoint to a creature. - * - * The user can either select an npc or provide its GUID. - * - * The user can even select a visual waypoint - then the new waypoint - * is placed *after* the selected one - this makes insertion of new - * waypoints possible. - * - * eg: - * .wp add 12345 - * -> adds a waypoint to the npc with the GUID 12345 - * - * .wp add - * -> adds a waypoint to the currently selected creature - * - * - * @param args if the user did not provide a GUID, it is NULL - * - * @return true - command did succeed, false - something went wrong - */ -bool ChatHandler::HandleWpAddCommand(const char* args) -{ - sLog.outDebug("DEBUG: HandleWpAddCommand"); - - // optional - char* guid_str = NULL; - - if(*args) - { - guid_str = strtok((char*)args, " "); - } - - uint32 lowguid = 0; - uint32 point = 0; - Creature* target = getSelectedCreature(); - // Did player provide a GUID? - if (!guid_str) - { - sLog.outDebug("DEBUG: HandleWpAddCommand - No GUID provided"); - - // No GUID provided - // -> Player must have selected a creature - - if(!target || target->isPet()) - { - SendSysMessage(LANG_SELECT_CREATURE); - SetSentErrorMessage(true); - return false; - } - if (target->GetEntry() == VISUAL_WAYPOINT ) - { - sLog.outDebug("DEBUG: HandleWpAddCommand - target->GetEntry() == VISUAL_WAYPOINT (1) "); - - QueryResult *result = - WorldDatabase.PQuery( "SELECT id, point FROM creature_movement WHERE wpguid = %u", - target->GetGUIDLow() ); - if(!result) - { - PSendSysMessage(LANG_WAYPOINT_NOTFOUNDSEARCH, target->GetGUIDLow()); - // User selected a visual spawnpoint -> get the NPC - // Select NPC GUID - // Since we compare float values, we have to deal with - // some difficulties. - // Here we search for all waypoints that only differ in one from 1 thousand - // (0.001) - There is no other way to compare C++ floats with mySQL floats - // See also: http://dev.mysql.com/doc/refman/5.0/en/problems-with-float.html - const char* maxDIFF = "0.01"; - result = WorldDatabase.PQuery( "SELECT id, point FROM creature_movement WHERE (abs(position_x - %f) <= %s ) and (abs(position_y - %f) <= %s ) and (abs(position_z - %f) <= %s )", - target->GetPositionX(), maxDIFF, target->GetPositionY(), maxDIFF, target->GetPositionZ(), maxDIFF); - if(!result) - { - PSendSysMessage(LANG_WAYPOINT_NOTFOUNDDBPROBLEM, target->GetGUIDLow()); - SetSentErrorMessage(true); - return false; - } - } - do - { - Field *fields = result->Fetch(); - lowguid = fields[0].GetUInt32(); - point = fields[1].GetUInt32(); - }while( result->NextRow() ); - delete result; - - CreatureData const* data = objmgr.GetCreatureData(lowguid); - if(!data) - { - PSendSysMessage(LANG_WAYPOINT_CREATNOTFOUND, lowguid); - SetSentErrorMessage(true); - return false; - } - - target = ObjectAccessor::GetCreature(*m_session->GetPlayer(),MAKE_NEW_GUID(lowguid,data->id,HIGHGUID_UNIT)); - if(!target) - { - PSendSysMessage(LANG_WAYPOINT_NOTFOUNDDBPROBLEM, lowguid); - SetSentErrorMessage(true); - return false; - } - } - else - { - lowguid = target->GetDBTableGUIDLow(); - } - } - else - { - sLog.outDebug("DEBUG: HandleWpAddCommand - GUID provided"); - - // GUID provided - // Warn if player also selected a creature - // -> Creature selection is ignored <- - if(target) - { - SendSysMessage(LANG_WAYPOINT_CREATSELECTED); - } - lowguid = atoi((char*)guid_str); - - CreatureData const* data = objmgr.GetCreatureData(lowguid); - if(!data) - { - PSendSysMessage(LANG_WAYPOINT_CREATNOTFOUND, lowguid); - SetSentErrorMessage(true); - return false; - } - - target = ObjectAccessor::GetCreature(*m_session->GetPlayer(),MAKE_NEW_GUID(lowguid,data->id,HIGHGUID_UNIT)); - if(!target || target->isPet()) - { - PSendSysMessage(LANG_WAYPOINT_CREATNOTFOUND, lowguid); - SetSentErrorMessage(true); - return false; - } - } - // lowguid -> GUID of the NPC - // point -> number of the waypoint (if not 0) - sLog.outDebug("DEBUG: HandleWpAddCommand - danach"); - - sLog.outDebug("DEBUG: HandleWpAddCommand - point == 0"); - - Player* player = m_session->GetPlayer(); - WaypointMgr.AddLastNode(lowguid, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation(), 0, 0); - - // update movement type - if(target) - { - target->SetDefaultMovementType(WAYPOINT_MOTION_TYPE); - target->GetMotionMaster()->Initialize(); - if(target->isAlive()) // dead creature will reset movement generator at respawn - { - target->setDeathState(JUST_DIED); - target->Respawn(); - } - target->SaveToDB(); - } - else - WorldDatabase.PExecuteLog("UPDATE creature SET MovementType = '%u' WHERE guid = '%u'", WAYPOINT_MOTION_TYPE,lowguid); - - PSendSysMessage(LANG_WAYPOINT_ADDED, point, lowguid); - - return true; -} // HandleWpAddCommand - -/** - * .wp modify emote | spell | text | del | move | add - * - * add -> add a WP after the selected visual waypoint - * User must select a visual waypoint and then issue ".wp modify add" - * - * emote - * User has selected a visual waypoint before. - * is added to this waypoint. Everytime the - * NPC comes to this waypoint, the emote is called. - * - * emote - * User has not selected visual waypoint before. - * For the waypoint for the NPC with - * an emote is added. - * Everytime the NPC comes to this waypoint, the emote is called. - * - * - * info -> User did not select a visual waypoint and - */ -bool ChatHandler::HandleWpModifyCommand(const char* args) -{ - sLog.outDebug("DEBUG: HandleWpModifyCommand"); - - if(!*args) - return false; - - // first arg: add del text emote spell waittime move - char* show_str = strtok((char*)args, " "); - if (!show_str) - { - return false; - } - - std::string show = show_str; - // Check - // Remember: "show" must also be the name of a column! - if( (show != "emote") && (show != "spell") && (show != "textid1") && (show != "textid2") - && (show != "textid3") && (show != "textid4") && (show != "textid5") - && (show != "waittime") && (show != "del") && (show != "move") && (show != "add") - && (show != "model1") && (show != "model2") && (show != "orientation")) - { - return false; - } - - // Next arg is: - - // Did user provide a GUID - // or did the user select a creature? - // -> variable lowguid is filled with the GUID of the NPC - uint32 lowguid = 0; - uint32 point = 0; - uint32 wpGuid = 0; - Creature* target = getSelectedCreature(); - - if(target) - { - sLog.outDebug("DEBUG: HandleWpModifyCommand - User did select an NPC"); - - // Did the user select a visual spawnpoint? - if (target->GetEntry() != VISUAL_WAYPOINT ) - { - PSendSysMessage(LANG_WAYPOINT_VP_SELECT); - SetSentErrorMessage(true); - return false; - } - - wpGuid = target->GetGUIDLow(); - - // The visual waypoint - QueryResult *result = - WorldDatabase.PQuery( "SELECT id, point FROM creature_movement WHERE wpguid = %u LIMIT 1", - target->GetGUIDLow() ); - if(!result) - { - PSendSysMessage(LANG_WAYPOINT_NOTFOUNDDBPROBLEM, wpGuid); - SetSentErrorMessage(true); - return false; - } - sLog.outDebug("DEBUG: HandleWpModifyCommand - After getting wpGuid"); - - Field *fields = result->Fetch(); - lowguid = fields[0].GetUInt32(); - point = fields[1].GetUInt32(); - - // Cleanup memory - sLog.outDebug("DEBUG: HandleWpModifyCommand - Cleanup memory"); - delete result; - } - else - { - // User did provide - - char* guid_str = strtok((char*)NULL, " "); - if( !guid_str ) - { - SendSysMessage(LANG_WAYPOINT_NOGUID); - return false; - } - lowguid = atoi((char*)guid_str); - - CreatureData const* data = objmgr.GetCreatureData(lowguid); - if(!data) - { - PSendSysMessage(LANG_WAYPOINT_CREATNOTFOUND, lowguid); - SetSentErrorMessage(true); - return false; - } - - PSendSysMessage("DEBUG: GUID provided: %d", lowguid); - - char* point_str = strtok((char*)NULL, " "); - if( !point_str ) - { - SendSysMessage(LANG_WAYPOINT_NOWAYPOINTGIVEN); - return false; - } - point = atoi((char*)point_str); - - PSendSysMessage("DEBUG: wpNumber provided: %d", point); - - // Now we need the GUID of the visual waypoint - // -> "del", "move", "add" command - - QueryResult *result = WorldDatabase.PQuery( "SELECT wpguid FROM creature_movement WHERE id = '%u' AND point = '%u' LIMIT 1", lowguid, point); - if (!result) - { - PSendSysMessage(LANG_WAYPOINT_NOTFOUNDSEARCH, lowguid, point); - SetSentErrorMessage(true); - return false; - } - - Field *fields = result->Fetch(); - wpGuid = fields[0].GetUInt32(); - - // Free memory - delete result; - } - - char* arg_str = NULL; - // Check for argument - if( (show.find("text") == std::string::npos ) && (show != "del") && (show != "move") && (show != "add")) - { - // Text is enclosed in "<>", all other arguments not - if( show.find("text") != std::string::npos ) - arg_str = strtok((char*)NULL, "<>"); - else - arg_str = strtok((char*)NULL, " "); - - if( !arg_str) - { - PSendSysMessage(LANG_WAYPOINT_ARGUMENTREQ, show_str); - return false; - } - } - - sLog.outDebug("DEBUG: HandleWpModifyCommand - Parameters parsed - now execute the command"); - - // wpGuid -> GUID of the waypoint creature - // lowguid -> GUID of the NPC - // point -> waypoint number - - // Special functions: - // add - move - del -> no args commands - // Add a waypoint after the selected visual - if(show == "add" && target) - { - PSendSysMessage("DEBUG: wp modify add, GUID: %u", lowguid); - - // Get the creature for which we read the waypoint - CreatureData const* data = objmgr.GetCreatureData(lowguid); - if(!data) - { - PSendSysMessage(LANG_WAYPOINT_CREATNOTFOUND, lowguid); - SetSentErrorMessage(true); - return false; - } - - Creature* npcCreature = ObjectAccessor::GetCreature(*m_session->GetPlayer(), MAKE_NEW_GUID(lowguid, data->id, HIGHGUID_UNIT)); - - if( !npcCreature ) - { - PSendSysMessage(LANG_WAYPOINT_NPCNOTFOUND); - SetSentErrorMessage(true); - return false; - } - - sLog.outDebug("DEBUG: HandleWpModifyCommand - add -- npcCreature"); - - // What to do: - // Add the visual spawnpoint (DB only) - // Adjust the waypoints - // Respawn the owner of the waypoints - sLog.outDebug("DEBUG: HandleWpModifyCommand - add"); - - Player* chr = m_session->GetPlayer(); - Map *map = chr->GetMap(); - - if(npcCreature) - { - npcCreature->GetMotionMaster()->Initialize(); - if(npcCreature->isAlive()) // dead creature will reset movement generator at respawn - { - npcCreature->setDeathState(JUST_DIED); - npcCreature->Respawn(); - } - } - - // create the waypoint creature - wpGuid = 0; - Creature* wpCreature = new Creature; - if (!wpCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), map,VISUAL_WAYPOINT,0)) - { - PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, VISUAL_WAYPOINT); - delete wpCreature; - } - else - { - wpCreature->Relocate(chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ(), chr->GetOrientation()); - - if(!wpCreature->IsPositionValid()) - { - sLog.outError("ERROR: Creature (guidlow %d, entry %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)",wpCreature->GetGUIDLow(),wpCreature->GetEntry(),wpCreature->GetPositionX(),wpCreature->GetPositionY()); - delete wpCreature; - } - else - { - wpCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode())); - // To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells(); - wpCreature->LoadFromDB(wpCreature->GetDBTableGUIDLow(), map); - map->Add(wpCreature); - wpGuid = wpCreature->GetGUIDLow(); - } - } - - WaypointMgr.AddAfterNode(lowguid, point, chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ(), 0, 0, wpGuid); - - if(!wpGuid) - return false; - - PSendSysMessage(LANG_WAYPOINT_ADDED_NO, point+1); - return true; - } // add - - if(show == "del" && target) - { - PSendSysMessage("DEBUG: wp modify del, GUID: %u", lowguid); - - // Get the creature for which we read the waypoint - CreatureData const* data = objmgr.GetCreatureData(lowguid); - if(!data) - { - PSendSysMessage(LANG_WAYPOINT_CREATNOTFOUND, lowguid); - SetSentErrorMessage(true); - return false; - } - - Creature* npcCreature = ObjectAccessor::GetCreature(*m_session->GetPlayer(), MAKE_NEW_GUID(lowguid, data->id, HIGHGUID_UNIT)); - - // wpCreature - Creature* wpCreature = NULL; - if( wpGuid != 0 ) - { - wpCreature = ObjectAccessor::GetCreature(*m_session->GetPlayer(),MAKE_NEW_GUID(wpGuid, VISUAL_WAYPOINT, HIGHGUID_UNIT)); - wpCreature->DeleteFromDB(); - wpCreature->CleanupsBeforeDelete(); - wpCreature->AddObjectToRemoveList(); - } - - // What to do: - // Remove the visual spawnpoint - // Adjust the waypoints - // Respawn the owner of the waypoints - - WaypointMgr.DeleteNode(lowguid, point); - - if(npcCreature) - { - // Any waypoints left? - QueryResult *result2 = WorldDatabase.PQuery( "SELECT point FROM creature_movement WHERE id = '%u'",lowguid); - if(!result2) - { - npcCreature->SetDefaultMovementType(RANDOM_MOTION_TYPE); - } - else - { - npcCreature->SetDefaultMovementType(WAYPOINT_MOTION_TYPE); - delete result2; - } - npcCreature->GetMotionMaster()->Initialize(); - if(npcCreature->isAlive()) // dead creature will reset movement generator at respawn - { - npcCreature->setDeathState(JUST_DIED); - npcCreature->Respawn(); - } - npcCreature->SaveToDB(); - } - - PSendSysMessage(LANG_WAYPOINT_REMOVED); - return true; - } // del - - if(show == "move" && target) - { - PSendSysMessage("DEBUG: wp move, GUID: %u", lowguid); - - Player *chr = m_session->GetPlayer(); - Map *map = chr->GetMap(); - { - // Get the creature for which we read the waypoint - CreatureData const* data = objmgr.GetCreatureData(lowguid); - if(!data) - { - PSendSysMessage(LANG_WAYPOINT_CREATNOTFOUND, lowguid); - SetSentErrorMessage(true); - return false; - } - - Creature* npcCreature = ObjectAccessor::GetCreature(*m_session->GetPlayer(), MAKE_NEW_GUID(lowguid, data->id, HIGHGUID_UNIT)); - - // wpCreature - Creature* wpCreature = NULL; - // What to do: - // Move the visual spawnpoint - // Respawn the owner of the waypoints - if( wpGuid != 0 ) - { - wpCreature = ObjectAccessor::GetCreature(*m_session->GetPlayer(),MAKE_NEW_GUID(wpGuid, VISUAL_WAYPOINT, HIGHGUID_UNIT)); - wpCreature->DeleteFromDB(); - wpCreature->CleanupsBeforeDelete(); - wpCreature->AddObjectToRemoveList(); - // re-create - Creature* wpCreature2 = new Creature; - if (!wpCreature2->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), map, VISUAL_WAYPOINT, 0)) - { - PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, VISUAL_WAYPOINT); - delete wpCreature2; - return false; - } - - wpCreature2->Relocate(chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ(), chr->GetOrientation()); - - if(!wpCreature2->IsPositionValid()) - { - sLog.outError("ERROR: Creature (guidlow %d, entry %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)",wpCreature2->GetGUIDLow(),wpCreature2->GetEntry(),wpCreature2->GetPositionX(),wpCreature2->GetPositionY()); - delete wpCreature2; - return false; - } - - wpCreature2->SaveToDB(map->GetId(), (1 << map->GetSpawnMode())); - // To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells(); - wpCreature2->LoadFromDB(wpCreature2->GetDBTableGUIDLow(), map); - map->Add(wpCreature2); - //MapManager::Instance().GetMap(npcCreature->GetMapId())->Add(wpCreature2); - } - - WaypointMgr.SetNodePosition(lowguid, point, chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ()); - - if(npcCreature) - { - npcCreature->GetMotionMaster()->Initialize(); - if(npcCreature->isAlive()) // dead creature will reset movement generator at respawn - { - npcCreature->setDeathState(JUST_DIED); - npcCreature->Respawn(); - } - } - PSendSysMessage(LANG_WAYPOINT_CHANGED); - } - return true; - } // move - - // Create creature - npc that has the waypoint - CreatureData const* data = objmgr.GetCreatureData(lowguid); - if(!data) - { - PSendSysMessage(LANG_WAYPOINT_CREATNOTFOUND, lowguid); - SetSentErrorMessage(true); - return false; - } - - // set in game textids not supported - if( show == "textid1" || show == "textid2" || show == "textid3" || - show == "textid4" || show == "textid5" ) - { - return false; - } - - WaypointMgr.SetNodeText(lowguid, point, show_str, arg_str); - - Creature* npcCreature = ObjectAccessor::GetCreature(*m_session->GetPlayer(), MAKE_NEW_GUID(lowguid, data->id, HIGHGUID_UNIT)); - if(npcCreature) - { - npcCreature->SetDefaultMovementType(WAYPOINT_MOTION_TYPE); - npcCreature->GetMotionMaster()->Initialize(); - if(npcCreature->isAlive()) // dead creature will reset movement generator at respawn - { - npcCreature->setDeathState(JUST_DIED); - npcCreature->Respawn(); - } - } - PSendSysMessage(LANG_WAYPOINT_CHANGED_NO, show_str); - - return true; -} - -/** - * .wp show info | on | off - * - * info -> User has selected a visual waypoint before - * - * info -> User did not select a visual waypoint and - * provided the GUID of the NPC and the number of - * the waypoint. - * - * on -> User has selected an NPC; all visual waypoints for this - * NPC are added to the world - * - * on -> User did not select an NPC - instead the GUID of the - * NPC is provided. All visual waypoints for this NPC - * are added from the world. - * - * off -> User has selected an NPC; all visual waypoints for this - * NPC are removed from the world. - * - * on -> User did not select an NPC - instead the GUID of the - * NPC is provided. All visual waypoints for this NPC - * are removed from the world. - * - * - */ -bool ChatHandler::HandleWpShowCommand(const char* args) -{ - sLog.outDebug("DEBUG: HandleWpShowCommand"); - - if(!*args) - return false; - - // first arg: on, off, first, last - char* show_str = strtok((char*)args, " "); - if (!show_str) - { - return false; - } - // second arg: GUID (optional, if a creature is selected) - char* guid_str = strtok((char*)NULL, " "); - sLog.outDebug("DEBUG: HandleWpShowCommand: show_str: %s guid_str: %s", show_str, guid_str); - //if (!guid_str) { - // return false; - //} - - // Did user provide a GUID - // or did the user select a creature? - // -> variable lowguid is filled with the GUID - Creature* target = getSelectedCreature(); - // Did player provide a GUID? - if (!guid_str) - { - sLog.outDebug("DEBUG: HandleWpShowCommand: !guid_str"); - // No GUID provided - // -> Player must have selected a creature - - if(!target) - { - SendSysMessage(LANG_SELECT_CREATURE); - SetSentErrorMessage(true); - return false; - } - } - else - { - sLog.outDebug("DEBUG: HandleWpShowCommand: GUID provided"); - // GUID provided - // Warn if player also selected a creature - // -> Creature selection is ignored <- - if(target) - { - SendSysMessage(LANG_WAYPOINT_CREATSELECTED); - } - - uint32 lowguid = atoi((char*)guid_str); - - CreatureData const* data = objmgr.GetCreatureData(lowguid); - if(!data) - { - PSendSysMessage(LANG_WAYPOINT_CREATNOTFOUND, lowguid); - SetSentErrorMessage(true); - return false; - } - - target = ObjectAccessor::GetCreature(*m_session->GetPlayer(),MAKE_NEW_GUID(lowguid,data->id,HIGHGUID_UNIT)); - - if(!target) - { - PSendSysMessage(LANG_WAYPOINT_CREATNOTFOUND, lowguid); - SetSentErrorMessage(true); - return false; - } - } - - uint32 lowguid = target->GetDBTableGUIDLow(); - - std::string show = show_str; - uint32 Maxpoint; - - sLog.outDebug("DEBUG: HandleWpShowCommand: lowguid: %u show: %s", lowguid, show_str); - - // Show info for the selected waypoint - if(show == "info") - { - PSendSysMessage("DEBUG: wp info, GUID: %u", lowguid); - - // Check if the user did specify a visual waypoint - if( target->GetEntry() != VISUAL_WAYPOINT ) - { - PSendSysMessage(LANG_WAYPOINT_VP_SELECT); - SetSentErrorMessage(true); - return false; - } - - //PSendSysMessage("wp on, GUID: %u", lowguid); - - //pCreature->GetPositionX(); - - QueryResult *result = - WorldDatabase.PQuery( "SELECT id, point, waittime, emote, spell, textid1, textid2, textid3, textid4, textid5, model1, model2 FROM creature_movement WHERE wpguid = %u", - target->GetGUIDLow() ); - if(!result) - { - // Since we compare float values, we have to deal with - // some difficulties. - // Here we search for all waypoints that only differ in one from 1 thousand - // (0.001) - There is no other way to compare C++ floats with mySQL floats - // See also: http://dev.mysql.com/doc/refman/5.0/en/problems-with-float.html - const char* maxDIFF = "0.01"; - PSendSysMessage(LANG_WAYPOINT_NOTFOUNDSEARCH, target->GetGUID()); - - result = WorldDatabase.PQuery( "SELECT id, point, waittime, emote, spell, textid1, textid2, textid3, textid4, textid5, model1, model2 FROM creature_movement WHERE (abs(position_x - %f) <= %s ) and (abs(position_y - %f) <= %s ) and (abs(position_z - %f) <= %s )", - target->GetPositionX(), maxDIFF, target->GetPositionY(), maxDIFF, target->GetPositionZ(), maxDIFF); - if(!result) - { - PSendSysMessage(LANG_WAYPOINT_NOTFOUNDDBPROBLEM, lowguid); - SetSentErrorMessage(true); - return false; - } - } - do - { - Field *fields = result->Fetch(); - uint32 creGUID = fields[0].GetUInt32(); - uint32 point = fields[1].GetUInt32(); - int waittime = fields[2].GetUInt32(); - uint32 emote = fields[3].GetUInt32(); - uint32 spell = fields[4].GetUInt32(); - uint32 textid[MAX_WAYPOINT_TEXT]; - for(int i = 0; i < MAX_WAYPOINT_TEXT; ++i) - textid[i] = fields[5+i].GetUInt32(); - uint32 model1 = fields[10].GetUInt32(); - uint32 model2 = fields[11].GetUInt32(); - - // Get the creature for which we read the waypoint - Creature* wpCreature = ObjectAccessor::GetCreature(*m_session->GetPlayer(),MAKE_NEW_GUID(creGUID,VISUAL_WAYPOINT,HIGHGUID_UNIT)); - - PSendSysMessage(LANG_WAYPOINT_INFO_TITLE, point, (wpCreature ? wpCreature->GetName() : ""), creGUID); - PSendSysMessage(LANG_WAYPOINT_INFO_WAITTIME, waittime); - PSendSysMessage(LANG_WAYPOINT_INFO_MODEL, 1, model1); - PSendSysMessage(LANG_WAYPOINT_INFO_MODEL, 2, model2); - PSendSysMessage(LANG_WAYPOINT_INFO_EMOTE, emote); - PSendSysMessage(LANG_WAYPOINT_INFO_SPELL, spell); - for(int i = 0; i < MAX_WAYPOINT_TEXT; ++i) - PSendSysMessage(LANG_WAYPOINT_INFO_TEXT, i+1, textid[i], (textid[i] ? GetTrinityString(textid[i]) : "")); - - }while( result->NextRow() ); - // Cleanup memory - delete result; - return true; - } - - if(show == "on") - { - PSendSysMessage("DEBUG: wp on, GUID: %u", lowguid); - - QueryResult *result = WorldDatabase.PQuery( "SELECT point, position_x,position_y,position_z FROM creature_movement WHERE id = '%u'",lowguid); - if(!result) - { - PSendSysMessage(LANG_WAYPOINT_NOTFOUND, lowguid); - SetSentErrorMessage(true); - return false; - } - // Delete all visuals for this NPC - QueryResult *result2 = WorldDatabase.PQuery( "SELECT wpguid FROM creature_movement WHERE id = '%u' and wpguid <> 0", lowguid); - if(result2) - { - bool hasError = false; - do - { - Field *fields = result2->Fetch(); - uint32 wpguid = fields[0].GetUInt32(); - Creature* pCreature = ObjectAccessor::GetCreature(*m_session->GetPlayer(),MAKE_NEW_GUID(wpguid,VISUAL_WAYPOINT,HIGHGUID_UNIT)); - - if(!pCreature) - { - PSendSysMessage(LANG_WAYPOINT_NOTREMOVED, wpguid); - hasError = true; - WorldDatabase.PExecuteLog("DELETE FROM creature WHERE guid = '%u'", wpguid); - } - else - { - pCreature->DeleteFromDB(); - pCreature->CleanupsBeforeDelete(); - pCreature->AddObjectToRemoveList(); - } - - }while( result2->NextRow() ); - delete result2; - if( hasError ) - { - PSendSysMessage(LANG_WAYPOINT_TOOFAR1); - PSendSysMessage(LANG_WAYPOINT_TOOFAR2); - PSendSysMessage(LANG_WAYPOINT_TOOFAR3); - } - } - - do - { - Field *fields = result->Fetch(); - uint32 point = fields[0].GetUInt32(); - float x = fields[1].GetFloat(); - float y = fields[2].GetFloat(); - float z = fields[3].GetFloat(); - - uint32 id = VISUAL_WAYPOINT; - - Player *chr = m_session->GetPlayer(); - Map *map = chr->GetMap(); - float o = chr->GetOrientation(); - - Creature* wpCreature = new Creature; - if (!wpCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), map, id, 0)) - { - PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, id); - delete wpCreature; - delete result; - return false; - } - - wpCreature->Relocate(x, y, z, o); - - if(!wpCreature->IsPositionValid()) - { - sLog.outError("ERROR: Creature (guidlow %d, entry %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)",wpCreature->GetGUIDLow(),wpCreature->GetEntry(),wpCreature->GetPositionX(),wpCreature->GetPositionY()); - delete wpCreature; - delete result; - return false; - } - - wpCreature->SetVisibility(VISIBILITY_OFF); - sLog.outDebug("DEBUG: UPDATE creature_movement SET wpguid = '%u"); - // set "wpguid" column to the visual waypoint - WorldDatabase.PExecuteLog("UPDATE creature_movement SET wpguid = '%u' WHERE id = '%u' and point = '%u'", wpCreature->GetGUIDLow(), lowguid, point); - - wpCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode())); - // To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells(); - wpCreature->LoadFromDB(wpCreature->GetDBTableGUIDLow(),map); - map->Add(wpCreature); - //MapManager::Instance().GetMap(wpCreature->GetMapId())->Add(wpCreature); - }while( result->NextRow() ); - - // Cleanup memory - delete result; - return true; - } - - if(show == "first") - { - PSendSysMessage("DEBUG: wp first, GUID: %u", lowguid); - - QueryResult *result = WorldDatabase.PQuery( "SELECT position_x,position_y,position_z FROM creature_movement WHERE point='1' AND id = '%u'",lowguid); - if(!result) - { - PSendSysMessage(LANG_WAYPOINT_NOTFOUND, lowguid); - SetSentErrorMessage(true); - return false; - } - - Field *fields = result->Fetch(); - float x = fields[0].GetFloat(); - float y = fields[1].GetFloat(); - float z = fields[2].GetFloat(); - uint32 id = VISUAL_WAYPOINT; - - Player *chr = m_session->GetPlayer(); - float o = chr->GetOrientation(); - Map *map = chr->GetMap(); - - Creature* pCreature = new Creature; - if (!pCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT),map, id, 0)) - { - PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, id); - delete pCreature; - delete result; - return false; - } - - pCreature->Relocate(x, y, z, o); - - if(!pCreature->IsPositionValid()) - { - sLog.outError("ERROR: Creature (guidlow %d, entry %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)",pCreature->GetGUIDLow(),pCreature->GetEntry(),pCreature->GetPositionX(),pCreature->GetPositionY()); - delete pCreature; - delete result; - return false; - } - - pCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode())); - pCreature->LoadFromDB(pCreature->GetDBTableGUIDLow(), map); - map->Add(pCreature); - //player->PlayerTalkClass->SendPointOfInterest(x, y, 6, 6, 0, "First Waypoint"); - - // Cleanup memory - delete result; - return true; - } - - if(show == "last") - { - PSendSysMessage("DEBUG: wp last, GUID: %u", lowguid); - - QueryResult *result = WorldDatabase.PQuery( "SELECT MAX(point) FROM creature_movement WHERE id = '%u'",lowguid); - if( result ) - { - Maxpoint = (*result)[0].GetUInt32(); - - delete result; - } - else - Maxpoint = 0; - - result = WorldDatabase.PQuery( "SELECT position_x,position_y,position_z FROM creature_movement WHERE point ='%u' AND id = '%u'",Maxpoint, lowguid); - if(!result) - { - PSendSysMessage(LANG_WAYPOINT_NOTFOUNDLAST, lowguid); - SetSentErrorMessage(true); - return false; - } - Field *fields = result->Fetch(); - float x = fields[0].GetFloat(); - float y = fields[1].GetFloat(); - float z = fields[2].GetFloat(); - uint32 id = VISUAL_WAYPOINT; - - Player *chr = m_session->GetPlayer(); - float o = chr->GetOrientation(); - Map *map = chr->GetMap(); - - Creature* pCreature = new Creature; - if (!pCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), map, id, 0)) - { - PSendSysMessage(LANG_WAYPOINT_NOTCREATED, id); - delete pCreature; - delete result; - return false; - } - - pCreature->Relocate(x, y, z, o); - - if(!pCreature->IsPositionValid()) - { - sLog.outError("ERROR: Creature (guidlow %d, entry %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)",pCreature->GetGUIDLow(),pCreature->GetEntry(),pCreature->GetPositionX(),pCreature->GetPositionY()); - delete pCreature; - delete result; - return false; - } - - pCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode())); - pCreature->LoadFromDB(pCreature->GetDBTableGUIDLow(), map); - map->Add(pCreature); - //player->PlayerTalkClass->SendPointOfInterest(x, y, 6, 6, 0, "Last Waypoint"); - // Cleanup memory - delete result; - return true; - } - - if(show == "off") - { - QueryResult *result = WorldDatabase.PQuery("SELECT guid FROM creature WHERE id = '%d'", VISUAL_WAYPOINT); - if(!result) - { - SendSysMessage(LANG_WAYPOINT_VP_NOTFOUND); - SetSentErrorMessage(true); - return false; - } - bool hasError = false; - do - { - Field *fields = result->Fetch(); - uint32 guid = fields[0].GetUInt32(); - Creature* pCreature = ObjectAccessor::GetCreature(*m_session->GetPlayer(),MAKE_NEW_GUID(guid,VISUAL_WAYPOINT,HIGHGUID_UNIT)); - - //Creature* pCreature = ObjectAccessor::GetCreature(*m_session->GetPlayer(), guid); - - if(!pCreature) - { - PSendSysMessage(LANG_WAYPOINT_NOTREMOVED, guid); - hasError = true; - WorldDatabase.PExecuteLog("DELETE FROM creature WHERE guid = '%u'", guid); - } - else - { - pCreature->DeleteFromDB(); - pCreature->CleanupsBeforeDelete(); - pCreature->AddObjectToRemoveList(); - } - }while(result->NextRow()); - // set "wpguid" column to "empty" - no visual waypoint spawned - WorldDatabase.PExecuteLog("UPDATE creature_movement SET wpguid = '0'"); - - if( hasError ) - { - PSendSysMessage(LANG_WAYPOINT_TOOFAR1); - PSendSysMessage(LANG_WAYPOINT_TOOFAR2); - PSendSysMessage(LANG_WAYPOINT_TOOFAR3); - } - - SendSysMessage(LANG_WAYPOINT_VP_ALLREMOVED); - // Cleanup memory - delete result; - - return true; - } - - PSendSysMessage("DEBUG: wpshow - no valid command found"); - - return true; -} // HandleWpShowCommand - -bool ChatHandler::HandleWpExportCommand(const char *args) -{ - if(!*args) - return false; - - // Next arg is: - - // Did user provide a GUID - // or did the user select a creature? - // -> variable lowguid is filled with the GUID of the NPC - uint32 lowguid = 0; - Creature* target = getSelectedCreature(); - char* arg_str = NULL; - if (target) - { - if (target->GetEntry() != VISUAL_WAYPOINT) - lowguid = target->GetGUIDLow(); - else - { - QueryResult *result = WorldDatabase.PQuery( "SELECT id FROM creature_movement WHERE wpguid = %u LIMIT 1", target->GetGUIDLow() ); - if (!result) - { - PSendSysMessage(LANG_WAYPOINT_NOTFOUNDDBPROBLEM, target->GetGUIDLow()); - return true; - } - Field *fields = result->Fetch(); - lowguid = fields[0].GetUInt32();; - delete result; - } - - arg_str = strtok((char*)args, " "); - } - else - { - // user provided - char* guid_str = strtok((char*)args, " "); - if( !guid_str ) - { - SendSysMessage(LANG_WAYPOINT_NOGUID); - return false; - } - lowguid = atoi((char*)guid_str); - - arg_str = strtok((char*)NULL, " "); - } - - if( !arg_str) - { - PSendSysMessage(LANG_WAYPOINT_ARGUMENTREQ, "export"); - return false; - } - - PSendSysMessage("DEBUG: wp export, GUID: %u", lowguid); - - QueryResult *result = WorldDatabase.PQuery( - // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 - "SELECT point, position_x, position_y, position_z, orientation, model1, model2, waittime, emote, spell, textid1, textid2, textid3, textid4, textid5, id FROM creature_movement WHERE id = '%u' ORDER BY point", lowguid ); - - if (!result) - { - PSendSysMessage(LANG_WAYPOINT_NOTHINGTOEXPORT); - SetSentErrorMessage(true); - return false; - } - - std::ofstream outfile; - outfile.open (arg_str); - - do - { - Field *fields = result->Fetch(); - - outfile << "INSERT INTO creature_movement "; - outfile << "( id, point, position_x, position_y, position_z, orientation, model1, model2, waittime, emote, spell, textid1, textid2, textid3, textid4, textid5 ) VALUES "; - - outfile << "( "; - outfile << fields[15].GetUInt32(); // id - outfile << ", "; - outfile << fields[0].GetUInt32(); // point - outfile << ", "; - outfile << fields[1].GetFloat(); // position_x - outfile << ", "; - outfile << fields[2].GetFloat(); // position_y - outfile << ", "; - outfile << fields[3].GetUInt32(); // position_z - outfile << ", "; - outfile << fields[4].GetUInt32(); // orientation - outfile << ", "; - outfile << fields[5].GetUInt32(); // model1 - outfile << ", "; - outfile << fields[6].GetUInt32(); // model2 - outfile << ", "; - outfile << fields[7].GetUInt16(); // waittime - outfile << ", "; - outfile << fields[8].GetUInt32(); // emote - outfile << ", "; - outfile << fields[9].GetUInt32(); // spell - outfile << ", "; - outfile << fields[10].GetUInt32(); // textid1 - outfile << ", "; - outfile << fields[11].GetUInt32(); // textid2 - outfile << ", "; - outfile << fields[12].GetUInt32(); // textid3 - outfile << ", "; - outfile << fields[13].GetUInt32(); // textid4 - outfile << ", "; - outfile << fields[14].GetUInt32(); // textid5 - outfile << ");\n "; - - } while( result->NextRow() ); - delete result; - - PSendSysMessage(LANG_WAYPOINT_EXPORTED); - outfile.close(); - - return true; -} - -bool ChatHandler::HandleWpImportCommand(const char *args) -{ - if(!*args) - return false; - - char* arg_str = strtok((char*)args, " "); - if (!arg_str) - return false; - - std::string line; - std::ifstream infile (arg_str); - if (infile.is_open()) - { - while (! infile.eof() ) - { - getline (infile,line); - //cout << line << endl; - QueryResult *result = WorldDatabase.Query(line.c_str()); - delete result; - } - infile.close(); - } - PSendSysMessage(LANG_WAYPOINT_IMPORTED); - - return true; -} + +/////WAYPOINT COMMANDS + +bool ChatHandler::HandleWpAddCommand(const char* args) +{ + sLog.outDebug("DEBUG: HandleWpAddCommand"); + + // optional + char* path_number = NULL; + uint32 pathid = 0; + + if(*args) + path_number = strtok((char*)args, " "); + + uint32 point = 0; + Creature* target = getSelectedCreature(); + + if (!path_number) + { + if(target) + pathid = target->GetWaypointPath(); + else + { + QueryResult *result = WorldDatabase.PQuery( "SELECT MAX(id) FROM waypoint_data"); + uint32 maxpathid = result->Fetch()->GetInt32(); + pathid = maxpathid+1; + sLog.outDebug("DEBUG: HandleWpAddCommand - New path started."); + PSendSysMessage("%s%s|r", "|cff00ff00", "New path started."); + + } + } + else + pathid = atoi(path_number); + + // path_id -> ID of the Path + // point -> number of the waypoint (if not 0) + + if(!pathid) + { + sLog.outDebug("DEBUG: HandleWpAddCommand - Current creature haven't loaded path."); + PSendSysMessage("%s%s|r", "|cffff33ff", "Current creature haven't loaded path."); + return true; + } + + sLog.outDebug("DEBUG: HandleWpAddCommand - point == 0"); + + QueryResult *result = WorldDatabase.PQuery( "SELECT MAX(point) FROM waypoint_data WHERE id = '%u'",pathid); + + if( result ) + { + point = (*result)[0].GetUInt32(); + delete result; + } + + Player* player = m_session->GetPlayer(); + Map *map = player->GetMap(); + + WorldDatabase.PExecuteLog("INSERT INTO waypoint_data (id,point,position_x,position_y,position_z) VALUES ('%u','%u','%f', '%f', '%f')", + pathid, point+1, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ()); + + PSendSysMessage("%s%s%u%s%u%s|r", "|cff00ff00", "PathID: |r|cff00ffff", pathid, "|r|cff00ff00: Waypoint |r|cff00ffff", point,"|r|cff00ff00 created. "); + + return true; +} // HandleWpAddCommand + +bool ChatHandler::HandleWpLoadPathCommand(const char *args) +{ + + if(!*args) + return false; + + // optional + char* path_number = NULL; + + if(*args) + { + path_number = strtok((char*)args, " "); + } + + uint32 pathid = 0; + uint32 guidlow = 0; + Creature* target = getSelectedCreature(); + + // Did player provide a path_id? + if (!path_number) + sLog.outDebug("DEBUG: HandleWpLoadPathCommand - No path number provided"); + + if(!target) + { + SendSysMessage(LANG_SELECT_CREATURE); + SetSentErrorMessage(true); + return false; + } + if(target->GetEntry() == 1) + { + PSendSysMessage("%s%s|r", "|cffff33ff", "You want to load path to a waypoint? Aren't you?"); + SetSentErrorMessage(true); + return false; + } + + pathid = atoi(path_number); + if(!pathid) + { + PSendSysMessage("%s%s|r", "|cffff33ff", "No vallid path number provided."); + return true; + } + + guidlow = target->GetGUIDLow(); + + QueryResult *result = WorldDatabase.PQuery( "SELECT guid FROM creature_addon WHERE guid = '%u'",guidlow); + + if( result ) + { + WorldDatabase.PExecute("UPDATE creature_addon SET path_id = '%u' WHERE guid = '%u'", pathid, guidlow); + delete result; + } + else + WorldDatabase.PExecute("INSERT INTO creature_addon(guid,path_id) VALUES ('%u','%u')", guidlow, pathid); + + WorldDatabase.PExecute("UPDATE creature SET MovementType = '%u' WHERE guid = '%u'", WAYPOINT_MOTION_TYPE, guidlow); + + target->LoadPath(pathid); + + target->SetDefaultMovementType(WAYPOINT_MOTION_TYPE); + + target->GetMotionMaster()->Initialize(); + + target->Say("Path loaded.",0,0); + + return true; +} + + +bool ChatHandler::HandleReloadAllPaths(const char* args) +{ +if(!*args) + return false; + +uint32 id = atoi(args); + +if(!id) + return false; + + PSendSysMessage("%s%s|r|cff00ffff%u|r", "|cff00ff00", "Loading Path: ", id); + WaypointMgr.UpdatePath(id); + return true; +} + +bool ChatHandler::HandleWpUnLoadPathCommand(const char *args) +{ + uint32 guidlow = 0; + Creature* target = getSelectedCreature(); + + if(!target) + { + PSendSysMessage("%s%s|r", "|cff33ffff", "You must select target."); + return true; + } + + if(target->GetCreatureAddon()) + { + if(target->GetCreatureAddon()->path_id != 0) + { + WorldDatabase.PExecute("DELETE FROM creature_addon WHERE guid = %u", target->GetGUIDLow()); + target->UpdateWaypointID(0); + WorldDatabase.PExecute("UPDATE creature SET MovementType = '%u' WHERE guid = '%u'", IDLE_MOTION_TYPE, guidlow); + target->LoadPath(0); + target->SetDefaultMovementType(IDLE_MOTION_TYPE); + target->GetMotionMaster()->MoveTargetedHome(); + target->GetMotionMaster()->Initialize(); + target->Say("Path unloaded.",0,0); + return true; + } + PSendSysMessage("%s%s|r", "|cffff33ff", "Target have no loaded path."); + return true; + } + PSendSysMessage("%s%s|r", "|cffff33ff", "Target have no loaded path."); + return true; +} + +bool ChatHandler::HandleWpEventCommand(const char* args) +{ +if(!*args) + return false; + + char* show_str = strtok((char*)args, " "); + + std::string show = show_str; + + // Check + if( (show != "add") && (show != "mod") && (show != "del") && (show != "listid")) return false; + + + if(show == "add") + { + uint32 id = 0; + char* arg_id = strtok(NULL, " "); + + if(arg_id) + uint32 id = atoi(arg_id); + + if(id) + { + QueryResult *result = WorldDatabase.PQuery( "SELECT `id` FROM waypoint_scripts WHERE guid = %u", id); + + if( !result ) + { + WorldDatabase.PExecute("INSERT INTO waypoint_scripts(guid)VALUES(%u)", id); + PSendSysMessage("%s%s%u|r", "|cff00ff00", "Wp Event: New waypoint event added: ", id); + } + else + { + PSendSysMessage("|cff00ff00Wp Event: You have choosed an existing waypoint script guid: %u|r", id); + delete result; + } + } + else + { + QueryResult *result = WorldDatabase.PQuery( "SELECT MAX(guid) FROM waypoint_scripts"); + id = result->Fetch()->GetUInt32(); + WorldDatabase.PExecute("INSERT INTO waypoint_scripts(guid)VALUES(%u)", id+1); + PSendSysMessage("%s%s%u|r", "|cff00ff00","Wp Event: New waypoint event added: |r|cff00ffff", id+1); + } + + return true; + } + + + if(show == "listid") + { + uint32 id; + char* arg_id = strtok(NULL, " "); + + if(!arg_id) + { + PSendSysMessage("%s%s|r", "|cff33ffff","Wp Event: You must provide waypoint script id."); + return true; + } + + id = atoi(arg_id); + + uint32 a2, a3, a4, a5, a6; + float a8, a9, a10, a11; + char const* a7; + + QueryResult *result = WorldDatabase.PQuery( "SELECT `guid`, `delay`, `command`, `datalong`, `datalong2`, `dataint`, `x`, `y`, `z`, `o` FROM waypoint_scripts WHERE id = %u", id); + + if( !result ) + { + PSendSysMessage("%s%s%u|r", "|cff33ffff", "Wp Event: No waypoint scripts found on id: ", id); + return true; + } + + Field *fields; + + do + { + fields = result->Fetch(); + a2 = fields[0].GetUInt32(); + a3 = fields[1].GetUInt32(); + a4 = fields[2].GetUInt32(); + a5 = fields[3].GetUInt32(); + a6 = fields[4].GetUInt32(); + a7 = fields[5].GetString(); + a8 = fields[6].GetFloat(); + a9 = fields[7].GetFloat(); + a10 = fields[8].GetFloat(); + a11 = fields[9].GetFloat(); + + PSendSysMessage("|cffff33ffid:|r|cff00ffff %u|r|cff00ff00, guid: |r|cff00ffff%u|r|cff00ff00, delay: |r|cff00ffff%u|r|cff00ff00, command: |r|cff00ffff%u|r|cff00ff00, datalong: |r|cff00ffff%u|r|cff00ff00, datalong2: |r|cff00ffff%u|r|cff00ff00, datatext: |r|cff00ffff%s|r|cff00ff00, posx: |r|cff00ffff%f|r|cff00ff00, posy: |r|cff00ffff%f|r|cff00ff00, posz: |r|cff00ffff%f|r|cff00ff00, orientation: |r|cff00ffff%f|r", id, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); + }while(result->NextRow()); + + delete result; + } + + if(show == "del") + { + + char* arg_id = strtok(NULL, " "); + uint32 id = atoi(arg_id); + + QueryResult *result = WorldDatabase.PQuery( "SELECT `guid` FROM waypoint_scripts WHERE guid = %u", id); + + if( result ) + { + + WorldDatabase.PExecuteLog("DELETE FROM waypoint_scripts WHERE guid = %u", id); + PSendSysMessage("%s%s%u|r","|cff00ff00","Wp Event: Waypoint script removed: ", id); + delete result; + } + else + PSendSysMessage("|cffff33ffWp Event: ERROR: you have selected a non existing script: %u|r", id); + + return true; + } + + + if(show == "mod") + { + char* arg_1 = strtok(NULL," "); + + if(!arg_1) + { + SendSysMessage("|cffff33ffERROR: Waypoint script guid not present.|r"); + return true; + } + + uint32 id = atoi(arg_1); + + if(!id) + { + SendSysMessage("|cffff33ffERROR: No vallid waypoint script id not present.|r"); + return true; + } + + char* arg_2 = strtok(NULL," "); + + if(!arg_2) + { SendSysMessage("|cffff33ffERROR: No argument present.|r"); + return true;} + + + std::string arg_string = arg_2; + + +if( (arg_string != "setid") && (arg_string != "delay") && (arg_string != "command") +&& (arg_string != "datalong") && (arg_string != "datalong2") && (arg_string != "dataint") && (arg_string != "posx") +&& (arg_string != "posy") && (arg_string != "posz") && (arg_string != "orientation") +) { SendSysMessage("|cffff33ffERROR: No valid argument present.|r"); + return true;} + + +char* arg_3; +std::string arg_str_2 = arg_2; +arg_3 = strtok(NULL," "); + +if(!arg_3) +{SendSysMessage("|cffff33ffERROR: No additional argument present.|r"); + return true;} + +float coord; + + if(arg_str_2 == "setid") + { + uint32 newid = atoi(arg_3); + PSendSysMessage("%s%s|r|cff00ffff%u|r|cff00ff00%s|r|cff00ffff%u|r","|cff00ff00","Wp Event: Wypoint scipt guid: ", newid," id changed: ", id); + WorldDatabase.PExecuteLog("UPDATE waypoint_scripts SET id='%u' WHERE guid='%u'", + newid, id); return true; + } + else + { + + QueryResult *result = WorldDatabase.PQuery("SELECT id FROM waypoint_scripts WHERE guid='%u'",id); + + if(!result) + { + SendSysMessage("|cffff33ffERROR: You have selected an non existing waypoint script guid.|r"); + return true; + } + + delete result; + +if(arg_str_2 == "posx") +{ + coord = atof(arg_3); + WorldDatabase.PExecuteLog("UPDATE waypoint_scripts SET x='%f' WHERE guid='%u'", + coord, id); + PSendSysMessage("|cff00ff00Waypoint script:|r|cff00ffff %u|r|cff00ff00 position_x updated.|r", id); + return true; +}else if(arg_str_2 == "posy") +{ + coord = atof(arg_3); + WorldDatabase.PExecuteLog("UPDATE waypoint_scripts SET y='%f' WHERE guid='%u'", + coord, id); + PSendSysMessage("|cff00ff00Waypoint script: %u position_y updated.|r", id); + return true; +} else if(arg_str_2 == "posz") +{ + coord = atof(arg_3); + WorldDatabase.PExecuteLog("UPDATE waypoint_scripts SET z='%f' WHERE guid='%u'", + coord, id); + PSendSysMessage("|cff00ff00Waypoint script: |r|cff00ffff%u|r|cff00ff00 position_z updated.|r", id); + return true; +} else if(arg_str_2 == "orientation") +{ + coord = atof(arg_3); + WorldDatabase.PExecuteLog("UPDATE waypoint_scripts SET o='%f' WHERE guid='%u'", + coord, id); + PSendSysMessage("|cff00ff00Waypoint script: |r|cff00ffff%u|r|cff00ff00 orientation updated.|r", id); + return true; +} else if(arg_str_2 == "dataint") +{ + WorldDatabase.PExecuteLog("UPDATE waypoint_scripts SET %s='%u' WHERE guid='%u'", + arg_2, atoi(arg_3), id); + PSendSysMessage("|cff00ff00Waypoint script: |r|cff00ffff%u|r|cff00ff00 dataint updated.|r", id); + return true; +}else +{ + std::string arg_str_3 = arg_3; + WorldDatabase.escape_string(arg_str_3); + WorldDatabase.PExecuteLog("UPDATE waypoint_scripts SET %s='%s' WHERE guid='%u'", + arg_2, arg_str_3.c_str(), id); +} +} + PSendSysMessage("%s%s|r|cff00ffff%u:|r|cff00ff00 %s %s|r","|cff00ff00","Waypoint script:", id, arg_2,"updated."); +} +return true; +} + +bool ChatHandler::HandleWpModifyCommand(const char* args) +{ + sLog.outDebug("DEBUG: HandleWpModifyCommand"); + + if(!*args) + return false; + + // first arg: add del text emote spell waittime move + char* show_str = strtok((char*)args, " "); + if (!show_str) + { + return false; + } + + std::string show = show_str; + // Check + // Remember: "show" must also be the name of a column! + if( (show != "delay") && (show != "event_id") && (show != "event_chance") + && (show != "move_flag") && (show != "del") && (show != "move") && (show != "wpadd") + ) + { + return false; + } + + // Next arg is: + char* arg_str = NULL; + + // Did user provide a GUID + // or did the user select a creature? + // -> variable lowguid is filled with the GUID of the NPC + uint32 pathid = 0; + uint32 point = 0; + uint32 wpGuid = 0; + Creature* target = getSelectedCreature(); + + if(target) + { + sLog.outDebug("DEBUG: HandleWpModifyCommand - User did select an NPC"); + + // The visual waypoint + Creature* wpCreature = NULL; + + wpGuid = target->GetGUIDLow(); + + // Did the user select a visual spawnpoint? + + if(wpGuid) + wpCreature = ObjectAccessor::GetCreature(*m_session->GetPlayer(),MAKE_NEW_GUID(wpGuid, VISUAL_WAYPOINT, HIGHGUID_UNIT)); + + // attempt check creature existence by DB data + else + { + + QueryResult *result = WorldDatabase.PQuery( "SELECT guid FROM creature_addon WHERE path_id = '%u'",wpGuid); + if(!result) + { + PSendSysMessage(LANG_WAYPOINT_CREATNOTFOUND, wpGuid); + return true; + } + + } + // User did select a visual waypoint? + // Check the creature + if (wpCreature->GetEntry() == VISUAL_WAYPOINT ) + { + QueryResult *result = + WorldDatabase.PQuery( "SELECT id, point FROM waypoint_data WHERE wpguid = %u", + wpGuid); + if(!result) + { + sLog.outDebug("DEBUG: HandleWpModifyCommand - No waypoint found - used 'wpguid'"); + + PSendSysMessage(LANG_WAYPOINT_NOTFOUNDSEARCH, target->GetGUIDLow()); + // Select waypoint number from database + // Since we compare float values, we have to deal with + // some difficulties. + // Here we search for all waypoints that only differ in one from 1 thousand + // (0.001) - There is no other way to compare C++ floats with mySQL floats + // See also: http://dev.mysql.com/doc/refman/5.0/en/problems-with-float.html + const char* maxDIFF = "0.01"; + result = WorldDatabase.PQuery( "SELECT id, point FROM waypoint_data WHERE (abs(position_x - %f) <= %s ) and (abs(position_y - %f) <= %s ) and (abs(position_z - %f) <= %s )", + wpCreature->GetPositionX(), maxDIFF, wpCreature->GetPositionY(), maxDIFF, wpCreature->GetPositionZ(), maxDIFF); + if(!result) + { + PSendSysMessage(LANG_WAYPOINT_NOTFOUNDDBPROBLEM, wpGuid); + return true; + } + } + sLog.outDebug("DEBUG: HandleWpModifyCommand - After getting wpGuid"); + + do + { + Field *fields = result->Fetch(); + pathid = fields[0].GetUInt32(); + point = fields[1].GetUInt32(); + }while( result->NextRow() ); + + // Cleanup memory + sLog.outDebug("DEBUG: HandleWpModifyCommand - Cleanup memory"); + delete result; + // We have the waypoint number and the GUID of the "master npc" + // Text is enclosed in "<>", all other arguments not + + arg_str = strtok((char*)NULL, " "); + + } + } + else + { + // User did provide + char* guid_str = strtok((char*)NULL, " "); + char* point_str = strtok((char*)NULL, " "); + + arg_str = strtok((char*)NULL, " "); + + if( !guid_str ) + { + SendSysMessage(LANG_WAYPOINT_NOGUID); + return false; + } + + if( !point_str ) + { + SendSysMessage(LANG_WAYPOINT_NOWAYPOINTGIVEN); + return false; + } + if( (show != "del") && (show != "move") ) + { + if( !arg_str ) + { + PSendSysMessage(LANG_WAYPOINT_ARGUMENTREQ, show.c_str()); + return false; + } + } + + pathid = atoi((char*)guid_str); + PSendSysMessage("|cff33ffffDEBUG: GUID provided: %d|r", pathid); + + point = atoi((char*)point_str); + PSendSysMessage("|cff33ffffDEBUG: wpNumber provided: %d|r", point); + + // Now we need the GUID of the visual waypoint + // -> "del", "move", "add" command + + QueryResult *result = WorldDatabase.PQuery( "SELECT wpguid FROM waypoint_data WHERE id = '%u' AND point = '%u'", pathid, point); + if(result) + { + + do + { + Field *fields = result->Fetch(); + wpGuid = fields[0].GetUInt32(); + }while( result->NextRow() ); + + + // Free memory + delete result; + } + else + { + PSendSysMessage(LANG_WAYPOINT_NOTFOUNDSEARCH, pathid, point); + // Select waypoint number from database + QueryResult *result = WorldDatabase.PQuery( "SELECT position_x,position_y,position_z FROM waypoint_data WHERE point='%d' AND id = '%u'", point, pathid); + if(!result) + { + PSendSysMessage(LANG_WAYPOINT_NOTFOUND, pathid); + return true; + } + + Field *fields = result->Fetch(); + float x = fields[0].GetFloat(); + float y = fields[1].GetFloat(); + float z = fields[2].GetFloat(); + // Cleanup memory + delete result; + + // Select waypoint number from database + // Since we compare float values, we have to deal with + // some difficulties. + // Here we search for all waypoints that only differ in one from 1 thousand + // (0.001) - There is no other way to compare C++ floats with mySQL floats + // See also: http://dev.mysql.com/doc/refman/5.0/en/problems-with-float.html + const char* maxDIFF = "0.01"; + + result = WorldDatabase.PQuery( "SELECT guid FROM creature WHERE (abs(position_x - %f) <= %s ) and (abs(position_y - %f) <= %s ) and (abs(position_z - %f) <= %s ) and id=%d", + x, maxDIFF, y, maxDIFF, z, maxDIFF, VISUAL_WAYPOINT); + if(!result) + { + + PSendSysMessage(LANG_WAYPOINT_WPCREATNOTFOUND, VISUAL_WAYPOINT); + return true; + } + do + { + Field *fields = result->Fetch(); + wpGuid = fields[0].GetUInt32(); + }while( result->NextRow() ); + + + // Free memory + delete result; + + } + } + + sLog.outDebug("DEBUG: HandleWpModifyCommand - Parameters parsed - now execute the command"); + + // Check for argument + if((show != "del") && (show != "move")) + { + if( arg_str == NULL ) + { + PSendSysMessage(LANG_WAYPOINT_ARGUMENTREQ, show_str); + return false; + } + } + + if(show == "del" && target) + { + PSendSysMessage("|cff00ff00DEBUG: wp modify del, PathID: |r|cff00ffff%u|r", pathid); + + // wpCreature + + Creature* wpCreature = NULL; + if( wpGuid != 0 ) + { + wpCreature = ObjectAccessor::GetCreature(*m_session->GetPlayer(),MAKE_NEW_GUID(wpGuid, VISUAL_WAYPOINT, HIGHGUID_UNIT)); + wpCreature->CombatStop(); + wpCreature->DeleteFromDB(); + wpCreature->AddObjectToRemoveList(); + } + + WorldDatabase.PExecuteLog("DELETE FROM waypoint_data WHERE id='%u' AND point='%u'", + pathid, point); + WorldDatabase.PExecuteLog("UPDATE waypoint_data SET point=point-1 WHERE id='%u' AND point>'%u'", + pathid, point); + + PSendSysMessage(LANG_WAYPOINT_REMOVED); + return true; + } // del + + if(show == "move" && target) + { + PSendSysMessage("|cff00ff00DEBUG: wp move, PathID: |r|cff00ffff%u|r", pathid); + + Player *chr = m_session->GetPlayer(); + Map *map = chr->GetMap(); + { + // wpCreature + Creature* wpCreature = NULL; + // What to do: + // Move the visual spawnpoint + // Respawn the owner of the waypoints + if( wpGuid != 0 ) + { + wpCreature = ObjectAccessor::GetCreature(*m_session->GetPlayer(),MAKE_NEW_GUID(wpGuid, VISUAL_WAYPOINT, HIGHGUID_UNIT)); + wpCreature->CombatStop(); + wpCreature->DeleteFromDB(); + wpCreature->AddObjectToRemoveList(); + // re-create + Creature* wpCreature2 = new Creature; + if (!wpCreature2->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), map, VISUAL_WAYPOINT, 0)) + { + PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, VISUAL_WAYPOINT); + delete wpCreature2; + return false; + } + wpCreature2->Relocate(chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ(), chr->GetOrientation()); + + if(!wpCreature2->IsPositionValid()) + { + sLog.outError("ERROR: Creature (guidlow %d, entry %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)",wpCreature2->GetGUIDLow(),wpCreature2->GetEntry(),wpCreature2->GetPositionX(),wpCreature2->GetPositionY()); + delete wpCreature2; + return false; + } + + wpCreature2->SaveToDB(map->GetId(), (1 << map->GetSpawnMode())); + // To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells(); + wpCreature2->LoadFromDB(wpCreature2->GetDBTableGUIDLow(), map); + map->Add(wpCreature2); + //MapManager::Instance().GetMap(npcCreature->GetMapId())->Add(wpCreature2); + } + + WorldDatabase.PExecuteLog("UPDATE waypoint_data SET position_x = '%f',position_y = '%f',position_z = '%f' where id = '%u' AND point='%u'", + chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ(), pathid, point ); + + PSendSysMessage(LANG_WAYPOINT_CHANGED); + } + return true; + } // move + + + const char *text = arg_str; + + if( text == 0 ) + { + // show_str check for present in list of correct values, no sql injection possible + WorldDatabase.PExecuteLog("UPDATE waypoint_data SET %s=NULL WHERE id='%u' AND point='%u'", + show_str, pathid, point); + } + else + { + // show_str check for present in list of correct values, no sql injection possible + std::string text2 = text; + WorldDatabase.escape_string(text2); + WorldDatabase.PExecuteLog("UPDATE waypoint_data SET %s='%s' WHERE id='%u' AND point='%u'", + show_str, text2.c_str(), pathid, point); + } + + PSendSysMessage(LANG_WAYPOINT_CHANGED_NO, show_str); + + return true; +} + + +bool ChatHandler::HandleWpShowCommand(const char* args) +{ + sLog.outDebug("DEBUG: HandleWpShowCommand"); + + if(!*args) + return false; + + // first arg: on, off, first, last + char* show_str = strtok((char*)args, " "); + if (!show_str) + { + return false; + } + // second arg: GUID (optional, if a creature is selected) + char* guid_str = strtok((char*)NULL, " "); + sLog.outDebug("DEBUG: HandleWpShowCommand: show_str: %s guid_str: %s", show_str, guid_str); + + uint32 pathid = 0; + Creature* target = getSelectedCreature(); + + // Did player provide a PathID? + + if (!guid_str) + { + sLog.outDebug("DEBUG: HandleWpShowCommand: !guid_str"); + // No PathID provided + // -> Player must have selected a creature + + if(!target) + { + SendSysMessage(LANG_SELECT_CREATURE); + SetSentErrorMessage(true); + return false; + } + + pathid = target->GetWaypointPath(); + } + + else + { + sLog.outDebug("|cff00ff00DEBUG: HandleWpShowCommand: PathID provided|r"); + // PathID provided + // Warn if player also selected a creature + // -> Creature selection is ignored <- + if(target) + { + SendSysMessage(LANG_WAYPOINT_CREATSELECTED); + } + + pathid = atoi((char*)guid_str); + } + + + sLog.outDebug("DEBUG: HandleWpShowCommand: danach"); + + + + std::string show = show_str; + uint32 Maxpoint; + + sLog.outDebug("DEBUG: HandleWpShowCommand: PathID: %u", pathid); + + //PSendSysMessage("wpshow - show: %s", show); + + // Show info for the selected waypoint + if(show == "info") + + { + + // Check if the user did specify a visual waypoint + if( target->GetEntry() != VISUAL_WAYPOINT ) + + { + PSendSysMessage(LANG_WAYPOINT_VP_SELECT); + SetSentErrorMessage(true); + return false; + } + + + QueryResult *result = WorldDatabase.PQuery( "SELECT id, point, delay, move_flag, action, action_chance FROM waypoint_data WHERE wpguid = %u", target->GetGUIDLow()); + + if(!result) + + { + SendSysMessage(LANG_WAYPOINT_NOTFOUNDDBPROBLEM); + return true; + } + + SendSysMessage("|cff00ffffDEBUG: wp show info:|r"); + + do + { + Field *fields = result->Fetch(); + pathid = fields[0].GetUInt32(); + uint32 point = fields[1].GetUInt32(); + uint32 delay = fields[2].GetUInt32(); + uint32 flag = fields[3].GetUInt32(); + uint32 ev_id = fields[4].GetUInt32(); + uint32 ev_chance = fields[5].GetUInt32(); + + PSendSysMessage("|cff00ff00Show info: for current point: |r|cff00ffff%u|r|cff00ff00, Path ID: |r|cff00ffff%u|r", point, pathid); + PSendSysMessage("|cff00ff00Show info: delay: |r|cff00ffff%u|r", delay); + PSendSysMessage("|cff00ff00Show info: Move flag: |r|cff00ffff%u|r", flag); + PSendSysMessage("|cff00ff00Show info: Waypoint event: |r|cff00ffff%u|r", ev_id); + PSendSysMessage("|cff00ff00Show info: Event chance: |r|cff00ffff%u|r", ev_chance); + }while( result->NextRow() ); + + // Cleanup memory + delete result; + return true; + } + + if(show == "on") + { + QueryResult *result = WorldDatabase.PQuery( "SELECT point, position_x,position_y,position_z FROM waypoint_data WHERE id = '%u'", pathid); + + if(!result) + { + SendSysMessage("|cffff33ffPath no found.|r"); + SetSentErrorMessage(true); + return false; + } + + PSendSysMessage("|cff00ff00DEBUG: wp on, PathID: |cff00ffff%u|r", pathid); + + // Delete all visuals for this NPC + QueryResult *result2 = WorldDatabase.PQuery( "SELECT wpguid FROM waypoint_data WHERE id = '%u' and wpguid <> 0", pathid); + + if(result2) + { + bool hasError = false; + do + { + Field *fields = result2->Fetch(); + uint32 wpguid = fields[0].GetUInt32(); + Creature* pCreature = ObjectAccessor::GetCreature(*m_session->GetPlayer(),MAKE_NEW_GUID(wpguid,VISUAL_WAYPOINT,HIGHGUID_UNIT)); + + if(!pCreature) + { + PSendSysMessage(LANG_WAYPOINT_NOTREMOVED, wpguid); + hasError = true; + WorldDatabase.PExecuteLog("DELETE FROM creature WHERE guid = '%u'", wpguid); + } + else + { + pCreature->CombatStop(); + pCreature->DeleteFromDB(); + pCreature->AddObjectToRemoveList(); + } + + }while( result2->NextRow() ); + + delete result2; + + if( hasError ) + { + PSendSysMessage(LANG_WAYPOINT_TOOFAR1); + PSendSysMessage(LANG_WAYPOINT_TOOFAR2); + PSendSysMessage(LANG_WAYPOINT_TOOFAR3); + } + } + + do + { + Field *fields = result->Fetch(); + uint32 point = fields[0].GetUInt32(); + float x = fields[1].GetFloat(); + float y = fields[2].GetFloat(); + float z = fields[3].GetFloat(); + + uint32 id = VISUAL_WAYPOINT; + + Player *chr = m_session->GetPlayer(); + Map *map = chr->GetMap(); + float o = chr->GetOrientation(); + + Creature* wpCreature = new Creature; + if (!wpCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), map, id, 0)) + { + PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, id); + delete wpCreature; + delete result; + return false; + } + + wpCreature->Relocate(x, y, z, o); + + if(!wpCreature->IsPositionValid()) + { + sLog.outError("ERROR: Creature (guidlow %d, entry %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)",wpCreature->GetGUIDLow(),wpCreature->GetEntry(),wpCreature->GetPositionX(),wpCreature->GetPositionY()); + delete wpCreature; + delete result; + return false; + } + + sLog.outDebug("DEBUG: UPDATE waypoint_data SET wpguid = '%u"); + // set "wpguid" column to the visual waypoint + WorldDatabase.PExecuteLog("UPDATE waypoint_data SET wpguid = '%u' WHERE id = '%u' and point = '%u'", wpCreature->GetGUIDLow(), pathid, point); + + wpCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode())); + wpCreature->LoadFromDB(wpCreature->GetDBTableGUIDLow(),map); + map->Add(wpCreature); + + if(target) + { + wpCreature->SetDisplayId(target->GetDisplayId()); + wpCreature->SetFloatValue(OBJECT_FIELD_SCALE_X, 0.5); + } + } + while( result->NextRow() ); + + SendSysMessage("|cff00ff00Showing the current creature's path.|r"); + // Cleanup memory + delete result; + return true; + } + + if(show == "first") + { + PSendSysMessage("|cff00ff00DEBUG: wp first, GUID: %u|r", pathid); + + QueryResult *result = WorldDatabase.PQuery( "SELECT position_x,position_y,position_z FROM waypoint_data WHERE point='1' AND id = '%u'",pathid); + if(!result) + { + PSendSysMessage(LANG_WAYPOINT_NOTFOUND, pathid); + SetSentErrorMessage(true); + return false; + } + + Field *fields = result->Fetch(); + float x = fields[0].GetFloat(); + float y = fields[1].GetFloat(); + float z = fields[2].GetFloat(); + uint32 id = VISUAL_WAYPOINT; + + Player *chr = m_session->GetPlayer(); + float o = chr->GetOrientation(); + Map *map = chr->GetMap(); + + Creature* pCreature = new Creature; + if (!pCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT),map, id, 0)) + { + PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, id); + delete pCreature; + delete result; + return false; + } + + pCreature->Relocate(x, y, z, o); + + if(!pCreature->IsPositionValid()) + { + sLog.outError("ERROR: Creature (guidlow %d, entry %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)",pCreature->GetGUIDLow(),pCreature->GetEntry(),pCreature->GetPositionX(),pCreature->GetPositionY()); + delete pCreature; + delete result; + return false; + } + + pCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode())); + pCreature->LoadFromDB(pCreature->GetDBTableGUIDLow(), map); + map->Add(pCreature); + + if(target) + { + pCreature->SetDisplayId(target->GetDisplayId()); + pCreature->SetFloatValue(OBJECT_FIELD_SCALE_X, 0.5); + } + + // Cleanup memory + delete result; + return true; + } + + if(show == "last") + { + PSendSysMessage("|cff00ff00DEBUG: wp last, PathID: |r|cff00ffff%u|r", pathid); + + QueryResult *result = WorldDatabase.PQuery( "SELECT MAX(point) FROM waypoint_data WHERE id = '%u'",pathid); + if( result ) + { + Maxpoint = (*result)[0].GetUInt32(); + + delete result; + } + else + Maxpoint = 0; + + result = WorldDatabase.PQuery( "SELECT position_x,position_y,position_z FROM waypoint_data WHERE point ='%u' AND id = '%u'",Maxpoint, pathid); + if(!result) + { + PSendSysMessage(LANG_WAYPOINT_NOTFOUNDLAST, pathid); + SetSentErrorMessage(true); + return false; + } + Field *fields = result->Fetch(); + float x = fields[0].GetFloat(); + float y = fields[1].GetFloat(); + float z = fields[2].GetFloat(); + uint32 id = VISUAL_WAYPOINT; + + Player *chr = m_session->GetPlayer(); + float o = chr->GetOrientation(); + Map *map = chr->GetMap(); + + Creature* pCreature = new Creature; + if (!pCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), map, id, 0)) + { + PSendSysMessage(LANG_WAYPOINT_NOTCREATED, id); + delete pCreature; + delete result; + return false; + } + + pCreature->Relocate(x, y, z, o); + + if(!pCreature->IsPositionValid()) + { + sLog.outError("ERROR: Creature (guidlow %d, entry %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)",pCreature->GetGUIDLow(),pCreature->GetEntry(),pCreature->GetPositionX(),pCreature->GetPositionY()); + delete pCreature; + delete result; + return false; + } + + pCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode())); + pCreature->LoadFromDB(pCreature->GetDBTableGUIDLow(), map); + map->Add(pCreature); + + if(target) + { + pCreature->SetDisplayId(target->GetDisplayId()); + pCreature->SetFloatValue(OBJECT_FIELD_SCALE_X, 0.5); + } + + // Cleanup memory + delete result; + return true; + } + + if(show == "off") + { + QueryResult *result = WorldDatabase.PQuery("SELECT guid FROM creature WHERE id = '%u'", 1); + if(!result) + { + SendSysMessage(LANG_WAYPOINT_VP_NOTFOUND); + SetSentErrorMessage(true); + return false; + } + bool hasError = false; + do + { + Field *fields = result->Fetch(); + uint32 guid = fields[0].GetUInt32(); + Creature* pCreature = ObjectAccessor::GetCreature(*m_session->GetPlayer(),MAKE_NEW_GUID(guid,VISUAL_WAYPOINT,HIGHGUID_UNIT)); + + if(!pCreature) + { + PSendSysMessage(LANG_WAYPOINT_NOTREMOVED, guid); + hasError = true; + WorldDatabase.PExecuteLog("DELETE FROM creature WHERE guid = '%u'", guid); + } + else + { + pCreature->CombatStop(); + + pCreature->DeleteFromDB(); + + pCreature->AddObjectToRemoveList(); + } + }while(result->NextRow()); + // set "wpguid" column to "empty" - no visual waypoint spawned + WorldDatabase.PExecuteLog("UPDATE waypoint_data SET wpguid = '0'"); + + if( hasError ) + { + PSendSysMessage(LANG_WAYPOINT_TOOFAR1); + PSendSysMessage(LANG_WAYPOINT_TOOFAR2); + PSendSysMessage(LANG_WAYPOINT_TOOFAR3); + } + + SendSysMessage(LANG_WAYPOINT_VP_ALLREMOVED); + // Cleanup memory + delete result; + + return true; + } + + PSendSysMessage("|cffff33ffDEBUG: wpshow - no valid command found|r"); + + return true; +} + +//////////// WAYPOINT COMMANDS // //rename characters bool ChatHandler::HandleRenameCommand(const char* args) diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index 51b9a092ba3..0ead2940ccb 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -136,7 +136,8 @@ bool ChatHandler::HandleReloadAllScriptsCommand(const char*) HandleReloadSpellScriptsCommand("a"); SendGlobalSysMessage("DB tables `*_scripts` reloaded."); HandleReloadDbScriptStringCommand("a"); - return true; + HandleReloadWpScriptsCommand("a"); + return true; } bool ChatHandler::HandleReloadAllSpellCommand(const char*) @@ -535,8 +536,28 @@ bool ChatHandler::HandleReloadEventScriptsCommand(const char* arg) sLog.outString( "Re-Loading Scripts from `event_scripts`..."); objmgr.LoadEventScripts(); - - if(*arg!='a') + + if(*arg!='a') + SendGlobalSysMessage("DB table `event_scripts` reloaded."); + + return true; +} + +bool ChatHandler::HandleReloadWpScriptsCommand(const char* arg) +{ + if(sWorld.IsScriptScheduled()) + { + SendSysMessage("DB scripts used currently, please attempt reload later."); + SetSentErrorMessage(true); + return false; + } + + if(*arg!='a') + sLog.outString( "Re-Loading Scripts from `event_scripts`..."); + + objmgr.LoadWaypointScripts(); + + if(*arg!='a') SendGlobalSysMessage("DB table `event_scripts` reloaded."); return true; diff --git a/src/game/MotionMaster.cpp b/src/game/MotionMaster.cpp index d3167e180a0..9050c95b651 100644 --- a/src/game/MotionMaster.cpp +++ b/src/game/MotionMaster.cpp @@ -319,6 +319,31 @@ void MotionMaster::Mutate(MovementGenerator *m) push(m); } +void MotionMaster::MovePath(uint32 path_id, bool repeatable) +{ + if(!path_id) + return; + //We set waypoint movement as new default movement generator + // clear ALL movement generators (including default) + while(!empty()) + { + MovementGenerator *curr = top(); + curr->Finalize(*i_owner); + pop(); + if( !isStatic( curr ) ) + delete curr; + } + + sLog.outError("attempting to move"); + //i_owner->GetTypeId()==TYPEID_PLAYER ? + //Mutate(new WaypointMovementGenerator(path_id, repeatable)): + Mutate(new WaypointMovementGenerator(path_id, repeatable)); + + DEBUG_LOG("%s (GUID: %u) start moving over path(Id:%u, repeatable: %s)", + i_owner->GetTypeId()==TYPEID_PLAYER ? "Player" : "Creature", + i_owner->GetGUIDLow(), path_id, repeatable ? "YES" : "NO" ); +} + void MotionMaster::propagateSpeedChange() { Impl::container_type::iterator it = Impl::c.begin(); diff --git a/src/game/MotionMaster.h b/src/game/MotionMaster.h index f6d244db2db..3a17b8e135e 100644 --- a/src/game/MotionMaster.h +++ b/src/game/MotionMaster.h @@ -80,6 +80,7 @@ class TRINITY_DLL_SPEC MotionMaster : private std::stack void MovePoint(uint32 id, float x,float y,float z); void MoveTaxiFlight(uint32 path, uint32 pathnode); void MoveDistract(uint32 time); + void MovePath(uint32 path_id, bool repeatable); MovementGeneratorType GetCurrentMovementGeneratorType() const; diff --git a/src/game/MovementGeneratorImpl.h b/src/game/MovementGeneratorImpl.h index c8270094b52..43c18ac6866 100644 --- a/src/game/MovementGeneratorImpl.h +++ b/src/game/MovementGeneratorImpl.h @@ -27,7 +27,6 @@ template inline MovementGenerator* MovementGeneratorFactory::Create(void *data) const { - Creature* creature = reinterpret_cast(data); - return (new MOVEMENT_GEN(*creature)); + return (new MOVEMENT_GEN()); } #endif diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 36d4317b3ec..b640307c64d 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -54,6 +54,7 @@ ScriptMapMap sQuestStartScripts; ScriptMapMap sSpellScripts; ScriptMapMap sGameObjectScripts; ScriptMapMap sEventScripts; +ScriptMapMap sWaypointScripts; bool normalizePlayerName(std::string& name) { @@ -4110,6 +4111,19 @@ void ObjectMgr::LoadEventScripts() } } +//Load WP Scripts +void ObjectMgr::LoadWaypointScripts() +{ + LoadScripts(sWaypointScripts, "waypoint_scripts"); + + for(ScriptMapMap::const_iterator itr = sWaypointScripts.begin(); itr != sWaypointScripts.end(); ++itr) + { + QueryResult *query = WorldDatabase.PQuery("SELECT * FROM `waypoint_scripts` WHERE `id` = %u", itr->first); + if(!query || !query->GetRowCount()) + sLog.outErrorDb("There is no waypoint which links to the waypoint script %u", itr->first); + } +} + void ObjectMgr::LoadItemTexts() { QueryResult *result = CharacterDatabase.Query("SELECT id, text FROM item_text"); @@ -7481,7 +7495,7 @@ void ObjectMgr::LoadDbScriptStrings() CheckScripts(sGameObjectScripts,ids); CheckScripts(sEventScripts,ids); - WaypointMgr.CheckTextsExistance(ids); + CheckScripts(sWaypointScripts,ids); for(std::set::const_iterator itr = ids.begin(); itr != ids.end(); ++itr) sLog.outErrorDb( "Table `db_script_string` has unused string id %u", *itr); diff --git a/src/game/ObjectMgr.h b/src/game/ObjectMgr.h index 8c7f8728b0b..7dc6c1f8a9f 100644 --- a/src/game/ObjectMgr.h +++ b/src/game/ObjectMgr.h @@ -98,6 +98,7 @@ extern ScriptMapMap sQuestStartScripts; extern ScriptMapMap sSpellScripts; extern ScriptMapMap sGameObjectScripts; extern ScriptMapMap sEventScripts; +extern ScriptMapMap sWaypointScripts; struct AreaTrigger { @@ -531,6 +532,7 @@ class ObjectMgr void LoadQuestStartScripts(); void LoadEventScripts(); void LoadSpellScripts(); + void LoadWaypointScripts(); bool LoadTrinityStrings(DatabaseType& db, char const* table, int32 min_value, int32 max_value); bool LoadTrinityStrings() { return LoadTrinityStrings(WorldDatabase,"trinity_string",MIN_TRINITY_STRING_ID,MAX_TRINITY_STRING_ID); } diff --git a/src/game/RandomMovementGenerator.h b/src/game/RandomMovementGenerator.h index 229761423e6..2825bc306a8 100644 --- a/src/game/RandomMovementGenerator.h +++ b/src/game/RandomMovementGenerator.h @@ -31,7 +31,7 @@ class TRINITY_DLL_SPEC RandomMovementGenerator : public MovementGeneratorMedium< T, RandomMovementGenerator > { public: - RandomMovementGenerator(const Unit &) : i_nextMoveTime(0) {} + RandomMovementGenerator() : i_nextMoveTime(0) {} void _setRandomLocation(T &); void Initialize(T &); diff --git a/src/game/WaypointManager.cpp b/src/game/WaypointManager.cpp index 831f616060b..501a95f6442 100644 --- a/src/game/WaypointManager.cpp +++ b/src/game/WaypointManager.cpp @@ -1,342 +1,152 @@ -/* - * Copyright (C) 2005-2008 MaNGOS - * - * Copyright (C) 2008 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "Database/DatabaseEnv.h" -#include "GridDefines.h" -#include "Policies/SingletonImp.h" -#include "WaypointManager.h" -#include "ProgressBar.h" -#include "MapManager.h" -#include "ObjectMgr.h" - -INSTANTIATE_SINGLETON_1(WaypointManager); - -bool WaypointBehavior::isEmpty() -{ - if (emote || spell || model1 || model2) - return false; - - for(int i = 0; i < MAX_WAYPOINT_TEXT; ++i) - if(textid[i]) - return false; - - return true; -} - -WaypointBehavior::WaypointBehavior(const WaypointBehavior &b) -{ - emote = b.emote; - spell = b.spell; - model1 = b.model1; - model2 = b.model2; - for(int i=0; i < MAX_WAYPOINT_TEXT; ++i) - textid[i] = b.textid[i]; -} - -void WaypointManager::Load() -{ - Cleanup(); - - uint32 total_paths = 0; - uint32 total_nodes = 0; - uint32 total_behaviors = 0; - - QueryResult *result = WorldDatabase.Query("SELECT id, COUNT(point) FROM creature_movement GROUP BY id"); - if(result) - { - total_paths = result->GetRowCount(); - barGoLink bar( total_paths ); - do - { - Field *fields = result->Fetch(); - uint32 id = fields[0].GetUInt32(); - uint32 count = fields[1].GetUInt32(); - m_pathMap[id].resize(count); - - total_nodes += count; - bar.step(); - } while( result->NextRow() ); - delete result; - } - - result = WorldDatabase.Query("SELECT position_x, position_y, position_z, orientation, model1, model2, waittime, emote, spell, textid1, textid2, textid3, textid4, textid5, id, point FROM creature_movement"); - if(result) - { - barGoLink bar( result->GetRowCount() ); - do - { - Field *fields = result->Fetch(); - uint32 point = fields[15].GetUInt32(); - uint32 id = fields[14].GetUInt32(); - - WaypointPath &path = m_pathMap[id]; - // the cleanup queries make sure the following is true - assert(point >= 1 && point <= path.size()); - WaypointNode &node = path[point-1]; - - node.x = fields[0].GetFloat(); - node.y = fields[1].GetFloat(); - node.z = fields[2].GetFloat(); - node.orientation = fields[3].GetFloat(); - node.delay = fields[6].GetUInt16(); - - // prevent using invalid coordinates - if(!Trinity::IsValidMapCoord(node.x, node.y, node.z, node.orientation)) - { - QueryResult *result1 = WorldDatabase.PQuery("SELECT id, map FROM creature WHERE guid = '%u'", id); - if(result1) - sLog.outErrorDb("ERROR: Creature (guidlow %d, entry %d) have invalid coordinates in his waypoint %d (X: %f, Y: %f).", - id, result1->Fetch()[0].GetUInt32(), point, node.x, node.y); - else - sLog.outErrorDb("ERROR: Waypoint path %d, have invalid coordinates in his waypoint %d (X: %f, Y: %f).", - id, point, node.x, node.y); - - Trinity::NormalizeMapCoord(node.x); - Trinity::NormalizeMapCoord(node.y); - if(result1) - { - node.z = MapManager::Instance ().GetBaseMap(result1->Fetch()[1].GetUInt32())->GetHeight(node.x, node.y, node.z); - delete result1; - } - WorldDatabase.PExecute("UPDATE creature_movement SET position_x = '%f', position_y = '%f', position_z = '%f' WHERE id = '%u' AND point = '%u'", node.x, node.y, node.z, id, point); - } - - WaypointBehavior be; - be.model1 = fields[4].GetUInt32(); - be.model2 = fields[5].GetUInt32(); - be.emote = fields[7].GetUInt32(); - be.spell = fields[8].GetUInt32(); - - for(int i = 0; i < MAX_WAYPOINT_TEXT; ++i) - { - be.textid[i] = fields[9+i].GetUInt32(); - if(be.textid[i]) - { - if (be.textid[i] < MIN_DB_SCRIPT_STRING_ID || be.textid[i] >= MAX_DB_SCRIPT_STRING_ID) - { - sLog.outErrorDb( "Table `db_script_string` not have string id %u", be.textid[i]); - continue; - } - } - } - - // save memory by not storing empty behaviors - if(!be.isEmpty()) - { - node.behavior = new WaypointBehavior(be); - ++total_behaviors; - } - else - node.behavior = NULL; - bar.step(); - } while( result->NextRow() ); - delete result; - } - sLog.outString( ">> Loaded %u paths, %u nodes and %u behaviors", total_paths, total_nodes, total_behaviors); -} - -void WaypointManager::Cleanup() -{ - // check if points need to be renumbered and do it - if(QueryResult *result = WorldDatabase.Query("SELECT 1 from creature_movement As T WHERE point <> (SELECT COUNT(*) FROM creature_movement WHERE id = T.id AND point <= T.point) LIMIT 1")) - { - delete result; - WorldDatabase.DirectExecute("CREATE TEMPORARY TABLE temp LIKE creature_movement"); - WorldDatabase.DirectExecute("INSERT INTO temp SELECT * FROM creature_movement"); - WorldDatabase.DirectExecute("ALTER TABLE creature_movement DROP PRIMARY KEY"); - WorldDatabase.DirectExecute("UPDATE creature_movement AS T SET point = (SELECT COUNT(*) FROM temp WHERE id = T.id AND point <= T.point)"); - WorldDatabase.DirectExecute("ALTER TABLE creature_movement ADD PRIMARY KEY (id, point)"); - WorldDatabase.DirectExecute("DROP TABLE temp"); - assert(!(result = WorldDatabase.Query("SELECT 1 from creature_movement As T WHERE point <> (SELECT COUNT(*) FROM creature_movement WHERE id = T.id AND point <= T.point) LIMIT 1"))); - } -} - -void WaypointManager::Unload() -{ - for(WaypointPathMap::iterator itr = m_pathMap.begin(); itr != m_pathMap.end(); ++itr) - _clearPath(itr->second); - m_pathMap.clear(); -} - -void WaypointManager::_clearPath(WaypointPath &path) -{ - for(WaypointPath::iterator itr = path.begin(); itr != path.end(); ++itr) - if(itr->behavior) - delete itr->behavior; - path.clear(); -} - -/// - Insert after the last point -void WaypointManager::AddLastNode(uint32 id, float x, float y, float z, float o, uint32 delay, uint32 wpGuid) -{ - _addNode(id, GetLastPoint(id, 0) + 1, x, y, z, o, delay, wpGuid); -} - -/// - Insert after a certain point -void WaypointManager::AddAfterNode(uint32 id, uint32 point, float x, float y, float z, float o, uint32 delay, uint32 wpGuid) -{ - for(uint32 i = GetLastPoint(id, 0); i > point; i--) - WorldDatabase.PExecuteLog("UPDATE creature_movement SET point=point+1 WHERE id='%u' AND point='%u'", id, i); - - _addNode(id, point + 1, x, y, z, o, delay, wpGuid); -} - -/// - Insert without checking for collision -void WaypointManager::_addNode(uint32 id, uint32 point, float x, float y, float z, float o, uint32 delay, uint32 wpGuid) -{ - if(point == 0) return; // counted from 1 in the DB - WorldDatabase.PExecuteLog("INSERT INTO creature_movement (id,point,position_x,position_y,position_z,orientation,wpguid,waittime) VALUES ('%u','%u','%f', '%f', '%f', '%f', '%d', '%d')", id, point, x, y, z, o, wpGuid, delay); - WaypointPathMap::iterator itr = m_pathMap.find(id); - if(itr == m_pathMap.end()) - itr = m_pathMap.insert(WaypointPathMap::value_type(id, WaypointPath())).first; - itr->second.insert(itr->second.begin() + (point - 1), WaypointNode(x, y, z, o, delay, NULL)); -} - -uint32 WaypointManager::GetLastPoint(uint32 id, uint32 default_notfound) -{ - uint32 point = default_notfound; - /*QueryResult *result = WorldDatabase.PQuery( "SELECT MAX(point) FROM creature_movement WHERE id = '%u'", id); - if( result ) - { - point = (*result)[0].GetUInt32()+1; - delete result; - }*/ - WaypointPathMap::iterator itr = m_pathMap.find(id); - if(itr != m_pathMap.end() && itr->second.size() != 0) - point = itr->second.size(); - return point; -} - -void WaypointManager::DeleteNode(uint32 id, uint32 point) -{ - if(point == 0) return; // counted from 1 in the DB - WorldDatabase.PExecuteLog("DELETE FROM creature_movement WHERE id='%u' AND point='%u'", id, point); - WorldDatabase.PExecuteLog("UPDATE creature_movement SET point=point-1 WHERE id='%u' AND point>'%u'", id, point); - WaypointPathMap::iterator itr = m_pathMap.find(id); - if(itr != m_pathMap.end() && point <= itr->second.size()) - itr->second.erase(itr->second.begin() + (point-1)); -} - -void WaypointManager::DeletePath(uint32 id) -{ - WorldDatabase.PExecuteLog("DELETE FROM creature_movement WHERE id='%u'", id); - WaypointPathMap::iterator itr = m_pathMap.find(id); - if(itr != m_pathMap.end()) - _clearPath(itr->second); - // the path is not removed from the map, just cleared - // WMGs have pointers to the path, so deleting them would crash - // this wastes some memory, but these functions are - // only meant to be called by GM commands -} - -void WaypointManager::SetNodePosition(uint32 id, uint32 point, float x, float y, float z) -{ - if(point == 0) return; // counted from 1 in the DB - WorldDatabase.PExecuteLog("UPDATE creature_movement SET position_x = '%f',position_y = '%f',position_z = '%f' where id = '%u' AND point='%u'", x, y, z, id, point); - WaypointPathMap::iterator itr = m_pathMap.find(id); - if(itr != m_pathMap.end() && point <= itr->second.size()) - { - itr->second[point-1].x = x; - itr->second[point-1].y = y; - itr->second[point-1].z = z; - } -} - -void WaypointManager::SetNodeText(uint32 id, uint32 point, const char *text_field, const char *text) -{ - if(point == 0) return; // counted from 1 in the DB - if(!text_field) return; - std::string field = text_field; - WorldDatabase.escape_string(field); - - if(!text) - { - WorldDatabase.PExecuteLog("UPDATE creature_movement SET %s=NULL WHERE id='%u' AND point='%u'", field.c_str(), id, point); - } - else - { - std::string text2 = text; - WorldDatabase.escape_string(text2); - WorldDatabase.PExecuteLog("UPDATE creature_movement SET %s='%s' WHERE id='%u' AND point='%u'", field.c_str(), text2.c_str(), id, point); - } - - WaypointPathMap::iterator itr = m_pathMap.find(id); - if(itr != m_pathMap.end() && point <= itr->second.size()) - { - WaypointNode &node = itr->second[point-1]; - if(!node.behavior) node.behavior = new WaypointBehavior(); - -// if(field == "text1") node.behavior->text[0] = text ? text : ""; -// if(field == "text2") node.behavior->text[1] = text ? text : ""; -// if(field == "text3") node.behavior->text[2] = text ? text : ""; -// if(field == "text4") node.behavior->text[3] = text ? text : ""; -// if(field == "text5") node.behavior->text[4] = text ? text : ""; - if(field == "emote") node.behavior->emote = text ? atoi(text) : 0; - if(field == "spell") node.behavior->spell = text ? atoi(text) : 0; - if(field == "model1") node.behavior->model1 = text ? atoi(text) : 0; - if(field == "model2") node.behavior->model2 = text ? atoi(text) : 0; - } -} - -void WaypointManager::CheckTextsExistance(std::set& ids) -{ - WaypointPathMap::iterator pmItr = m_pathMap.begin(); - for ( ; pmItr != m_pathMap.end(); ++pmItr) - { - for (int i = 0; i < pmItr->second.size(); ++i) - { - if (!pmItr->second[i].behavior) - continue; - - // Now we check text existence and put all zero texts ids to the end of array - - // Counting leading zeros for futher textid shift - int zeroCount = 0; - for (int j = 0; j < MAX_WAYPOINT_TEXT; ++j) - { - if (!pmItr->second[i].behavior->textid[j]) - { - ++zeroCount; - continue; - } - else - { - if (!objmgr.GetTrinityStringLocale(pmItr->second[i].behavior->textid[j])) - { - sLog.outErrorDb("ERROR: Some waypoint has textid%u with not existing %u text.", j, pmItr->second[i].behavior->textid[j]); - pmItr->second[i].behavior->textid[j] = 0; - ++zeroCount; - continue; - } - else - ids.erase(pmItr->second[i].behavior->textid[j]); - - // Shifting check - if (zeroCount) - { - // Correct textid but some zeros leading, so move it forward. - pmItr->second[i].behavior->textid[j-zeroCount] = pmItr->second[i].behavior->textid[j]; - pmItr->second[i].behavior->textid[j] = 0; - } - } - } - } - } -} +/* + * Copyright (C) 2005-2008 MaNGOS + * + * Copyright (C) 2008 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "Database/DatabaseEnv.h" +#include "GridDefines.h" +#include "WaypointManager.h" +#include "ProgressBar.h" +#include "MapManager.h" + +UNORDERED_MAP waypoint_map; +WaypointStore WaypointMgr; + +void WaypointStore::Free() +{ + waypoint_map.clear(); +} + +void WaypointStore::Load() +{ + QueryResult *result = WorldDatabase.PQuery("SELECT MAX(`id`) FROM `waypoint_data"); + if(!result) + { + sLog.outError(" an error occured while loading the table `waypoint_data` ( maybe it doesn't exist ?)\n"); + exit(1); // Stop server at loading non exited table or not accessable table + } + + records = (*result)[0].GetUInt32(); + delete result; + + + result = WorldDatabase.PQuery("SELECT `id`,`point`,`position_x`,`position_y`,`position_z`,`move_flag`,`delay`,`action`,`action_chance` FROM `waypoint_data` ORDER BY `id`, `point`"); + if(!result) + { + sLog.outErrorDb("The table `creature_addon` is empty or corrupted"); + return; + } + + WaypointPath* path_data; + uint32 total_records = result->GetRowCount(); + + barGoLink bar( total_records); + Field *fields; + uint32 last_id = 0; + + do + { + fields = result->Fetch(); + uint32 id = fields[0].GetUInt32(); + bar.step(); + WaypointData *wp = new WaypointData; + + if(last_id != id) + path_data = new WaypointPath; + + float x,y,z; + x = fields[2].GetFloat(); + y = fields[3].GetFloat(); + z = fields[4].GetFloat(); + + Trinity::NormalizeMapCoord(x); + Trinity::NormalizeMapCoord(y); + + wp->id = fields[1].GetUInt32(); + wp->x = x; + wp->y = y; + wp->z = z; + wp->run = fields[5].GetBool(); + wp->delay = fields[6].GetUInt32(); + wp->event_id = fields[7].GetUInt32(); + wp->event_chance = fields[8].GetUInt8(); + + path_data->push_back(wp); + + if(id != last_id) + waypoint_map[id] = path_data; + + last_id = id; + + } while(result->NextRow()) ; + + + delete result; +} + +void WaypointStore::UpdatePath(uint32 id) +{ + + if(waypoint_map.find(id)!= waypoint_map.end()) + waypoint_map[id]->clear(); + + QueryResult *result; + + result = WorldDatabase.PQuery("SELECT `id`,`point`,`position_x`,`position_y`,`position_z`,`move_flag`,`delay`,`action`,`action_chance` FROM `waypoint_data` WHERE id = %u ORDER BY `point`", id); + + if(!result) + return; + + WaypointPath* path_data; + + path_data = new WaypointPath; + + Field *fields; + + do + { + fields = result->Fetch(); + uint32 id = fields[0].GetUInt32(); + + WaypointData *wp = new WaypointData; + + float x,y,z; + x = fields[2].GetFloat(); + y = fields[3].GetFloat(); + z = fields[4].GetFloat(); + + Trinity::NormalizeMapCoord(x); + Trinity::NormalizeMapCoord(y); + + wp->id = fields[1].GetUInt32(); + wp->x = x; + wp->y = y; + wp->z = z; + wp->run = fields[5].GetBool(); + wp->delay = fields[6].GetUInt32(); + wp->event_id = fields[7].GetUInt32(); + wp->event_chance = fields[8].GetUInt8(); + + path_data->push_back(wp); + + }while (result->NextRow()); + + waypoint_map[id] = path_data; + + delete result; +} diff --git a/src/game/WaypointManager.h b/src/game/WaypointManager.h index 38cf5551d64..fd7f533e0da 100644 --- a/src/game/WaypointManager.h +++ b/src/game/WaypointManager.h @@ -1,93 +1,61 @@ -/* - * Copyright (C) 2005-2008 MaNGOS - * - * Copyright (C) 2008 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef TRINITY_WAYPOINTMANAGER_H -#define TRINITY_WAYPOINTMANAGER_H - -#include -#include -#include "Utilities/UnorderedMap.h" - -#define MAX_WAYPOINT_TEXT 5 -struct WaypointBehavior -{ - uint32 emote; - uint32 spell; - int32 textid[MAX_WAYPOINT_TEXT]; - uint32 model1; - uint32 model2; - - bool isEmpty(); - WaypointBehavior() {} - WaypointBehavior(const WaypointBehavior &b); -}; - -struct WaypointNode -{ - float x; - float y; - float z; - float orientation; - uint32 delay; - WaypointBehavior * behavior; - WaypointNode() {} - WaypointNode(float _x, float _y, float _z, float _o, uint32 _delay, WaypointBehavior * _behavior) - : x(_x), y(_y), z(_z), orientation(_o), delay(_delay), behavior(_behavior) {} -}; - -typedef std::vector WaypointPath; - -class WaypointManager -{ - public: - WaypointManager() {} - ~WaypointManager() { Unload(); } - - void Load(); - void Unload(); - - void Cleanup(); - - WaypointPath *GetPath(uint32 id) - { - WaypointPathMap::iterator itr = m_pathMap.find(id); - return itr != m_pathMap.end() ? &itr->second : NULL; - } - - void AddLastNode(uint32 id, float x, float y, float z, float o, uint32 delay, uint32 wpGuid); - void AddAfterNode(uint32 id, uint32 point, float x, float y, float z, float o, uint32 delay, uint32 wpGuid); - uint32 GetLastPoint(uint32 id, uint32 default_notfound); - void DeleteNode(uint32 id, uint32 point); - void DeletePath(uint32 id); - void SetNodePosition(uint32 id, uint32 point, float x, float y, float z); - void SetNodeText(uint32 id, uint32 point, const char *text_field, const char *text); - void CheckTextsExistance(std::set& ids); - - private: - void _addNode(uint32 id, uint32 point, float x, float y, float z, float o, uint32 delay, uint32 wpGuid); - void _clearPath(WaypointPath &path); - - typedef UNORDERED_MAP WaypointPathMap; - WaypointPathMap m_pathMap; -}; - -#define WaypointMgr Trinity::Singleton::Instance() - -#endif +/* + * Copyright (C) 2005-2008 MaNGOS + * + * Copyright (C) 2008 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef TRINITY_WAYPOINTMANAGER_H +#define TRINITY_WAYPOINTMANAGER_H + +#include + +struct WaypointData +{ + uint32 id; + float x,y,z; + bool run; + uint32 delay; + uint32 event_id; + uint8 event_chance; +}; + +typedef std::vector WaypointPath; +extern UNORDERED_MAP waypoint_map; + +class WaypointStore +{ + private : + uint32 records; + + public: + void UpdatePath(uint32 id); + void Load(); + void Free(); + + WaypointPath* GetPath(uint32 id) + { + if(waypoint_map.find(id) != waypoint_map.end()) + return waypoint_map[id]; + else return 0; + } + + inline uint32 GetRecordsCount() { return records; } +}; + +extern WaypointStore WaypointMgr; + +#endif diff --git a/src/game/WaypointMovementGenerator.cpp b/src/game/WaypointMovementGenerator.cpp index 3dc3ddebf42..31872ce7f98 100644 --- a/src/game/WaypointMovementGenerator.cpp +++ b/src/game/WaypointMovementGenerator.cpp @@ -1,653 +1,629 @@ -/* - * Copyright (C) 2005-2008 MaNGOS - * - * Copyright (C) 2008 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* -creature_movement Table - -alter table creature_movement add `textid1` int(11) NOT NULL default '0'; -alter table creature_movement add `textid2` int(11) NOT NULL default '0'; -alter table creature_movement add `textid3` int(11) NOT NULL default '0'; -alter table creature_movement add `textid4` int(11) NOT NULL default '0'; -alter table creature_movement add `textid5` int(11) NOT NULL default '0'; -alter table creature_movement add `emote` int(10) unsigned default '0'; -alter table creature_movement add `spell` int(5) unsigned default '0'; -alter table creature_movement add `wpguid` int(11) default '0'; - -*/ - -#include - -#include "WaypointMovementGenerator.h" -#include "ObjectMgr.h" -#include "Creature.h" -#include "DestinationHolderImp.h" -#include "CreatureAI.h" -#include "WaypointManager.h" - -#include - -//-----------------------------------------------// -void -WaypointMovementGenerator::LoadPath(Creature &c) -{ - sLog.outDetail("LoadPath: loading waypoint path for creature %d,%d", c.GetGUIDLow(), c.GetDBTableGUIDLow()); - - i_path = WaypointMgr.GetPath(c.GetDBTableGUIDLow()); - if(!i_path) - { - sLog.outErrorDb("WaypointMovementGenerator::LoadPath: creature %s (Entry: %u GUID: %d) doesn't have waypoint path", - c.GetName(), c.GetEntry(), c.GetDBTableGUIDLow()); - return; - } - - uint32 node_count = i_path->size(); - i_hasDone.resize(node_count); - for(uint32 i = 0; i < node_count-1; i++) - i_hasDone[i] = false; - - // to prevent a misbehaviour inside "update" - // update is always called with the next wp - but the wpSys needs the current - // so when the routine is called the first time, wpSys gets the last waypoint - // and this prevents the system from performing text/emote, etc - i_hasDone[node_count - 1] = true; -} - -void -WaypointMovementGenerator::ClearWaypoints() -{ - i_path = NULL; -} - -void -WaypointMovementGenerator::Initialize() -{ -} - -bool -WaypointMovementGenerator::Update(Creature &creature, const uint32 &diff) -{ - if(!&creature) - return true; - - // Waypoint movement can be switched on/off - // This is quite handy for escort quests and other stuff - if(creature.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED)) - return true; - - // prevent a crash at empty waypoint path. - if(!i_path || i_path->empty()) - return true; - - // i_path was modified by chat commands for example - if(i_path->size() != i_hasDone.size()) - i_hasDone.resize(i_path->size()); - if(i_currentNode >= i_path->size()) - i_currentNode = 0; - - CreatureTraveller traveller(creature); - - i_nextMoveTime.Update(diff); - i_destinationHolder.UpdateTraveller(traveller, diff, false, true); - - // creature has been stoped in middle of the waypoint segment - if (!i_destinationHolder.HasArrived() && creature.IsStopped()) - { - if( i_nextMoveTime.Passed()) // Timer has elapsed, meaning this part controlled it - { - SetStopedByPlayer(false); - // Now we re-set destination to same node and start travel - creature.addUnitState(UNIT_STAT_ROAMING); - if (creature.canFly()) - creature.AddUnitMovementFlag(MOVEMENTFLAG_FLYING2); - const WaypointNode &node = i_path->at(i_currentNode); - i_destinationHolder.SetDestination(traveller, node.x, node.y, node.z); - i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime()); - } - else // if( !i_nextMoveTime.Passed()) - { // unexpected end of timer && creature stopped && not at end of segment - if (!IsStopedByPlayer()) - { // Put 30 seconds delay - i_destinationHolder.IncreaseTravelTime(STOP_TIME_FOR_PLAYER); - i_nextMoveTime.Reset(STOP_TIME_FOR_PLAYER); - SetStopedByPlayer(true); // Mark we did it - } - } - return true; // Abort here this update - } - - if( creature.IsStopped()) - { - uint32 idx = i_currentNode > 0 ? i_currentNode-1 : i_path->size()-1; - - if (!i_hasDone[idx]) - { - if (i_path->at(idx).orientation !=100) - creature.SetOrientation(i_path->at(idx).orientation); - - if(WaypointBehavior *behavior = i_path->at(idx).behavior) - { - if(behavior->emote != 0) - creature.SetUInt32Value(UNIT_NPC_EMOTESTATE,behavior->emote); - if(behavior->spell != 0) - creature.CastSpell(&creature,behavior->spell, false); - if(behavior->model1 != 0) - creature.SetDisplayId(behavior->model1); - if(behavior->textid[0]) - { - // Not only one text is set - if( behavior->textid[1] ) - { - // Select one from max 5 texts (0 and 1 already checked) - int i = 2; - for( ; i < MAX_WAYPOINT_TEXT; ++i ) - if( !behavior->textid[i] ) - break; - - creature.Say(behavior->textid[rand() % i], 0, 0); - } - else - creature.Say(behavior->textid[0], 0, 0); - } - } // wpBehaviour found - i_hasDone[idx] = true; - MovementInform(creature); - } // HasDone == false - } // i_creature.IsStopped() - - if( i_nextMoveTime.Passed() ) // This is at the end of waypoint segment or has been stopped by player - { - if( creature.IsStopped() ) // If stopped then begin a new move segment - { - creature.addUnitState(UNIT_STAT_ROAMING); - if (creature.canFly()) - creature.AddUnitMovementFlag(MOVEMENTFLAG_FLYING2); - const WaypointNode &node = i_path->at(i_currentNode); - i_destinationHolder.SetDestination(traveller, node.x, node.y, node.z); - i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime()); - uint32 idx = i_currentNode > 0 ? i_currentNode-1 : i_path->size()-1; - - if (i_path->at(idx).orientation !=100) - creature.SetOrientation(i_path->at(idx).orientation); - - if(WaypointBehavior *behavior = i_path->at(idx).behavior ) - { - i_hasDone[idx] = false; - if(behavior->model2 != 0) - creature.SetDisplayId(behavior->model2); - - creature.SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); - } - } - else // If not stopped then stop it and set the reset of TimeTracker to waittime - { - creature.StopMoving(); - SetStopedByPlayer(false); - i_nextMoveTime.Reset(i_path->at(i_currentNode).delay); - ++i_currentNode; - if( i_currentNode >= i_path->size() ) - i_currentNode = 0; - } - } - return true; -} - -void WaypointMovementGenerator::MovementInform(Creature &unit) -{ - if(unit.AI()) - unit.AI()->MovementInform(WAYPOINT_MOTION_TYPE, i_currentNode); -} - -//----------------------------------------------------// -void -FlightPathMovementGenerator::LoadPath(Player &) -{ - objmgr.GetTaxiPathNodes(i_pathId, i_path,i_mapIds); -} - -uint32 -FlightPathMovementGenerator::GetPathAtMapEnd() const -{ - if(i_currentNode >= i_mapIds.size()) - return i_mapIds.size(); - - uint32 curMapId = i_mapIds[i_currentNode]; - for(uint32 i = i_currentNode; i < i_mapIds.size(); ++i) - { - if(i_mapIds[i] != curMapId) - return i; - } - - return i_mapIds.size(); -} - -void -FlightPathMovementGenerator::Initialize(Player &player) -{ - player.getHostilRefManager().setOnlineOfflineState(false); - player.addUnitState(UNIT_STAT_IN_FLIGHT); - player.SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT); - LoadPath(player); - Traveller traveller(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); -} - -void FlightPathMovementGenerator::Finalize(Player & player) -{ - - float x, y, z; - i_destinationHolder.GetLocationNow(player.GetMapId(), x, y, z); - player.SetPosition(x, y, z, player.GetOrientation()); - - player.clearUnitState(UNIT_STAT_IN_FLIGHT); - player.Unmount(); - player.RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT); - - if(player.m_taxi.empty()) - { - player.getHostilRefManager().setOnlineOfflineState(true); - if(player.pvpInfo.inHostileArea) - player.CastSpell(&player, 2479, true); - - player.SetUnitMovementFlags(MOVEMENTFLAG_WALK_MODE); - player.StopMoving(); - } -} - -bool -FlightPathMovementGenerator::Update(Player &player, const uint32 &diff) -{ - if( MovementInProgress() ) - { - Traveller traveller(player); - if( i_destinationHolder.UpdateTraveller(traveller, diff, false) ) - { - i_destinationHolder.ResetUpdate(FLIGHT_TRAVEL_UPDATE); - if( i_destinationHolder.HasArrived() ) - { - uint32 curMap = i_mapIds[i_currentNode]; - ++i_currentNode; - if( MovementInProgress() ) - { - DEBUG_LOG("loading node %u for player %s", i_currentNode, player.GetName()); - if(i_mapIds[i_currentNode]==curMap) - { - // 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); - } - return true; - } - //else HasArrived() - } - else - return true; - } - else - return true; - } - - // we have arrived at the end of the path - return false; -} - -void -FlightPathMovementGenerator::SetCurrentNodeAfterTeleport() -{ - if(i_mapIds.empty()) - return; - - uint32 map0 = i_mapIds[0]; - for(int i = 1; i < i_mapIds.size(); ++i) - { - if(i_mapIds[i]!=map0) - { - i_currentNode = i; - return; - } - } -} - -// -// Unique1's ASTAR Pathfinding Code... For future use & reference... -// - -#ifdef __PATHFINDING__ - -int GetFCost(int to, int num, int parentNum, float *gcost); // Below... - -int ShortenASTARRoute(short int *pathlist, int number) -{ // Wrote this to make the routes a little smarter (shorter)... No point looping back to the same places... Unique1 - short int temppathlist[MAX_PATHLIST_NODES]; - int count = 0; - // int count2 = 0; - int temp, temp2; - int link; - int upto = 0; - - for (temp = number; temp >= 0; temp--) - { - qboolean shortened = qfalse; - - for (temp2 = 0; temp2 < temp; temp2++) - { - for (link = 0; link < nodes[pathlist[temp]].enodenum; link++) - { - if (nodes[pathlist[temp]].links[link].flags & PATH_BLOCKED) - continue; - - //if ((bot->client->ps.eFlags & EF_TANK) && nodes[bot->current_node].links[link].flags & PATH_NOTANKS) //if this path is blocked, skip it - // continue; - - //if (nodes[nodes[pathlist[temp]].links[link].targetNode].origin[2] > nodes[pathlist[temp]].origin[2] + 32) - // continue; - - if (nodes[pathlist[temp]].links[link].targetNode == pathlist[temp2]) - { // Found a shorter route... - //if (OrgVisible(nodes[pathlist[temp2]].origin, nodes[pathlist[temp]].origin, -1)) - { - temppathlist[count] = pathlist[temp2]; - temp = temp2; - ++count; - shortened = qtrue; - } - } - } - } - - if (!shortened) - { - temppathlist[count] = pathlist[temp]; - ++count; - } - } - - upto = count; - - for (temp = 0; temp < count; temp++) - { - pathlist[temp] = temppathlist[upto]; - --upto; - } - - G_Printf("ShortenASTARRoute: Path size reduced from %i to %i nodes...n", number, count); - return count; -} - -/* -=========================================================================== -CreatePathAStar -This function uses the A* pathfinding algorithm to determine the -shortest path between any two nodes. -It's fairly complex, so I'm not really going to explain it much. -Look up A* and binary heaps for more info. -pathlist stores the ideal path between the nodes, in reverse order, -and the return value is the number of nodes in that path -=========================================================================== -*/ -int CreatePathAStar(gentity_t *bot, int from, int to, short int *pathlist) -{ - //all the data we have to hold...since we can't do dynamic allocation, has to be MAX_NODES - //we can probably lower this later - eg, the open list should never have more than at most a few dozen items on it - short int openlist[MAX_NODES+1]; //add 1 because it's a binary heap, and they don't use 0 - 1 is the first used index - float gcost[MAX_NODES]; - int fcost[MAX_NODES]; - char list[MAX_NODES]; //0 is neither, 1 is open, 2 is closed - char because it's the smallest data type - short int parent[MAX_NODES]; - - short int numOpen = 0; - short int atNode, temp, newnode=-1; - qboolean found = qfalse; - int count = -1; - float gc; - int i, u, v, m; - vec3_t vec; - - //clear out all the arrays - memset(openlist, 0, sizeof(short int)*(MAX_NODES+1)); - memset(fcost, 0, sizeof(int)*MAX_NODES); - memset(list, 0, sizeof(char)*MAX_NODES); - memset(parent, 0, sizeof(short int)*MAX_NODES); - memset(gcost, -1, sizeof(float)*MAX_NODES); - - //make sure we have valid data before calculating everything - if ((from == NODE_INVALID) || (to == NODE_INVALID) || (from >= MAX_NODES) || (to >= MAX_NODES) || (from == to)) - return -1; - - openlist[1] = from; //add the starting node to the open list - ++numOpen; - gcost[from] = 0; //its f and g costs are obviously 0 - fcost[from] = 0; - - while (1) - { - if (numOpen != 0) //if there are still items in the open list - { - //pop the top item off of the list - atNode = openlist[1]; - list[atNode] = 2; //put the node on the closed list so we don't check it again - --numOpen; - - openlist[1] = openlist[numOpen+1]; //move the last item in the list to the top position - v = 1; - - //this while loop reorders the list so that the new lowest fcost is at the top again - while (1) - { - u = v; - if ((2*u+1) < numOpen) //if both children exist - { - if (fcost[openlist[u]] >= fcost[openlist[2*u]]) - v = 2*u; - if (fcost[openlist[v]] >= fcost[openlist[2*u+1]]) - v = 2*u+1; - } - else - { - if ((2*u) < numOpen) //if only one child exists - { - if (fcost[openlist[u]] >= fcost[openlist[2*u]]) - v = 2*u; - } - } - - if (u != v) //if they're out of order, swap this item with its parent - { - temp = openlist[u]; - openlist[u] = openlist[v]; - openlist[v] = temp; - } - else - break; - } - - for (i = 0; i < nodes[atNode].enodenum; i++) //loop through all the links for this node - { - newnode = nodes[atNode].links[i].targetNode; - - //if this path is blocked, skip it - if (nodes[atNode].links[i].flags & PATH_BLOCKED) - continue; - //if this path is blocked, skip it - if (bot->client && (bot->client->ps.eFlags & EF_TANK) && nodes[atNode].links[i].flags & PATH_NOTANKS) - continue; - //skip any unreachable nodes - if (bot->client && (nodes[newnode].type & NODE_ALLY_UNREACHABLE) && (bot->client->sess.sessionTeam == TEAM_ALLIES)) - continue; - if (bot->client && (nodes[newnode].type & NODE_AXIS_UNREACHABLE) && (bot->client->sess.sessionTeam == TEAM_AXIS)) - continue; - - if (list[newnode] == 2) //if this node is on the closed list, skip it - continue; - - if (list[newnode] != 1) //if this node is not already on the open list - { - openlist[++numOpen] = newnode; //add the new node to the open list - list[newnode] = 1; - parent[newnode] = atNode; //record the node's parent - - if (newnode == to) //if we've found the goal, don't keep computing paths! - break; //this will break the 'for' and go all the way to 'if (list[to] == 1)' - - //store it's f cost value - fcost[newnode] = GetFCost(to, newnode, parent[newnode], gcost); - - //this loop re-orders the heap so that the lowest fcost is at the top - m = numOpen; - while (m != 1) //while this item isn't at the top of the heap already - { - //if it has a lower fcost than its parent - if (fcost[openlist[m]] <= fcost[openlist[m/2]]) - { - temp = openlist[m/2]; - openlist[m/2] = openlist[m]; - openlist[m] = temp; //swap them - m /= 2; - } - else - break; - } - } - else //if this node is already on the open list - { - gc = gcost[atNode]; - VectorSubtract(nodes[newnode].origin, nodes[atNode].origin, vec); - gc += VectorLength(vec); //calculate what the gcost would be if we reached this node along the current path - - if (gc < gcost[newnode]) //if the new gcost is less (ie, this path is shorter than what we had before) - { - parent[newnode] = atNode; //set the new parent for this node - gcost[newnode] = gc; //and the new g cost - - for (i = 1; i < numOpen; i++) //loop through all the items on the open list - { - if (openlist[i] == newnode) //find this node in the list - { - //calculate the new fcost and store it - fcost[newnode] = GetFCost(to, newnode, parent[newnode], gcost); - - //reorder the list again, with the lowest fcost item on top - m = i; - while (m != 1) - { - //if the item has a lower fcost than it's parent - if (fcost[openlist[m]] < fcost[openlist[m/2]]) - { - temp = openlist[m/2]; - openlist[m/2] = openlist[m]; - openlist[m] = temp; //swap them - m /= 2; - } - else - break; - } - break; //exit the 'for' loop because we already changed this node - } //if - } //for - } //if (gc < gcost[newnode]) - } //if (list[newnode] != 1) --> else - } //for (loop through links) - } //if (numOpen != 0) - else - { - found = qfalse; //there is no path between these nodes - break; - } - - if (list[to] == 1) //if the destination node is on the open list, we're done - { - found = qtrue; - break; - } - } //while (1) - - if (found == qtrue) //if we found a path - { - //G_Printf("%s - path found!n", bot->client->pers.netname); - count = 0; - - temp = to; //start at the end point - while (temp != from) //travel along the path (backwards) until we reach the starting point - { - pathlist[count++] = temp; //add the node to the pathlist and increment the count - temp = parent[temp]; //move to the parent of this node to continue the path - } - - pathlist[count++] = from; //add the beginning node to the end of the pathlist - - #ifdef __BOT_SHORTEN_ROUTING__ - count = ShortenASTARRoute(pathlist, count); // This isn't working... Dunno why.. Unique1 - #endif //__BOT_SHORTEN_ROUTING__ - } - else - { - //G_Printf("^1*** ^4BOT DEBUG^5: (CreatePathAStar) There is no route between node ^7%i^5 and node ^7%i^5.n", from, to); - count = CreateDumbRoute(from, to, pathlist); - - if (count > 0) - { - #ifdef __BOT_SHORTEN_ROUTING__ - count = ShortenASTARRoute(pathlist, count); // This isn't working... Dunno why.. Unique1 - #endif //__BOT_SHORTEN_ROUTING__ - return count; - } - } - - return count; //return the number of nodes in the path, -1 if not found -} - -/* -=========================================================================== -GetFCost -Utility function used by A* pathfinding to calculate the -cost to move between nodes towards a goal. Using the A* -algorithm F = G + H, G here is the distance along the node -paths the bot must travel, and H is the straight-line distance -to the goal node. -Returned as an int because more precision is unnecessary and it -will slightly speed up heap access -=========================================================================== -*/ -int GetFCost(int to, int num, int parentNum, float *gcost) -{ - float gc = 0; - float hc = 0; - vec3_t v; - - if (gcost[num] == -1) - { - if (parentNum != -1) - { - gc = gcost[parentNum]; - VectorSubtract(nodes[num].origin, nodes[parentNum].origin, v); - gc += VectorLength(v); - } - gcost[num] = gc; - } - else - gc = gcost[num]; - - VectorSubtract(nodes[to].origin, nodes[num].origin, v); - hc = VectorLength(v); - - return (int)(gc + hc); -} -#endif //__PATHFINDING__ +/* + * Copyright (C) 2005-2008 MaNGOS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +//Basic header +#include + +#include "WaypointMovementGenerator.h" +//Accessors +#include "Database/DatabaseEnv.h" +#include "ObjectMgr.h" +#include "World.h" +//Creature-specific headers +#include "Creature.h" +#include "CreatureAI.h" +//Player-Specific +#include "Player.h" +//Visual +#include "ProgressBar.h" +#include "MapManager.h" + +template +void +WaypointMovementGenerator::Initialize(T &u){} + +template<> +void +WaypointMovementGenerator::Initialize(Creature &u) +{ + i_currentNode = -1; + u.StopMoving(); + if(!path_id) + path_id = u.GetWaypointPath(); + waypoints = WaypointMgr.GetPath(path_id); +} + +template<> +void +WaypointMovementGenerator::Finalize(Creature &u){} + +template<> +void +WaypointMovementGenerator::Finalize(Player &u){} + +template +void +WaypointMovementGenerator::MovementInform(T &unit){} + +template<> +void WaypointMovementGenerator::MovementInform(Creature &unit) +{ + unit.AI()->MovementInform(WAYPOINT_MOTION_TYPE, i_currentNode); +} + +template<> +void WaypointMovementGenerator::Reset(Creature &unit){} + +template<> +void WaypointMovementGenerator::Reset(Player &unit){} + +template<> +void WaypointMovementGenerator::InitTraveller(Creature &unit, const WaypointData &node) +{ + node.run ? unit.RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE): unit.AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + + unit.SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); + unit.SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + + if(unit.canFly()) + unit.AddUnitMovementFlag(MOVEMENTFLAG_FLYING2); + + unit.addUnitState(UNIT_STAT_ROAMING); +} + +template<> +void WaypointMovementGenerator::InitTraveller(Player &unit, const WaypointData &node){} + +template +bool +WaypointMovementGenerator::Update(T &unit, const uint32 &diff) +{ + return false; +} + +template<> +bool +WaypointMovementGenerator::Update(Creature &unit, const uint32 &diff) +{ + if(!&unit) + return true; + + if(!path_id) + return false; + + // Waypoint movement can be switched on/off + // This is quite handy for escort quests and other stuff + if(unit.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED)) + return true; + + // Clear the generator if the path doesn't exist + if(!waypoints || !waypoints->size()) + return false; + + Traveller traveller(unit); + + i_nextMoveTime.Update(diff); + i_destinationHolder.UpdateTraveller(traveller, diff, false, true); + + if(i_nextMoveTime.Passed()) + { + if(unit.IsStopped()) + { + if(StopedByPlayer) + { + InitTraveller(unit,node); + i_destinationHolder.SetDestination(traveller, node.x, node.y, node.z); + i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime()); + StopedByPlayer = false; + return true; + } + + if(i_currentNode == waypoints->size() - 1) //If that's our last waypoint + { + if(repeating) //If the movement is repeating + i_currentNode = 0; //Start moving all over again + else + { + unit.GetMotionMaster()->Initialize(); + return false; //Clear the waypoint movement + } + } + else + i_currentNode++; + + node = *(waypoints->at(i_currentNode)); + InitTraveller(unit,node); + i_destinationHolder.SetDestination(traveller, node.x, node.y, node.z); + i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime()); + } + else + { + //Determine waittime + if(node.delay) + i_nextMoveTime.Reset(node.delay); + else + i_nextMoveTime.Reset(100); //Prevents some lag + + if(node.event_id && rand()%100 < node.event_chance && !ExecuteScript) + { + sWorld.ScriptsStart(sWaypointScripts, node.event_id, &unit, NULL); + ExecuteScript = true; + } + + MovementInform(unit); + unit.UpdateWaypointID(i_currentNode); + traveller.Relocation(node.x, node.y, node.z); + unit.clearUnitState(UNIT_STAT_MOVING); + } + } + else + { + if(unit.IsStopped() && !i_destinationHolder.HasArrived()) + { + if(!StopedByPlayer) + { + i_destinationHolder.IncreaseTravelTime(STOP_TIME_FOR_PLAYER); + i_nextMoveTime.Reset(STOP_TIME_FOR_PLAYER); + StopedByPlayer = true; + } + } + } + return true; +} + +template void WaypointMovementGenerator::Initialize(Player &); +template bool WaypointMovementGenerator::Update(Player &, const uint32 &); +template void WaypointMovementGenerator::MovementInform(Player &); + +//----------------------------------------------------// +void +FlightPathMovementGenerator::LoadPath(Player &) +{ + objmgr.GetTaxiPathNodes(i_pathId, i_path,i_mapIds); +} + +uint32 +FlightPathMovementGenerator::GetPathAtMapEnd() const +{ + if(i_currentNode >= i_mapIds.size()) + return i_mapIds.size(); + + uint32 curMapId = i_mapIds[i_currentNode]; + for(uint32 i = i_currentNode; i < i_mapIds.size(); ++i) + { + if(i_mapIds[i] != curMapId) + return i; + } + + return i_mapIds.size(); +} + +void +FlightPathMovementGenerator::Initialize(Player &player) +{ + player.getHostilRefManager().setOnlineOfflineState(false); + player.addUnitState(UNIT_STAT_IN_FLIGHT); + player.SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT); + LoadPath(player); + Traveller traveller(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); +} + +void FlightPathMovementGenerator::Finalize(Player & player) +{ + + float x, y, z; + i_destinationHolder.GetLocationNow(player.GetMapId(), x, y, z); + player.SetPosition(x, y, z, player.GetOrientation()); + + player.clearUnitState(UNIT_STAT_IN_FLIGHT); + player.Unmount(); + player.RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT); + + if(player.m_taxi.empty()) + { + player.getHostilRefManager().setOnlineOfflineState(true); + if(player.pvpInfo.inHostileArea) + player.CastSpell(&player, 2479, true); + + player.SetUnitMovementFlags(MOVEMENTFLAG_WALK_MODE); + player.StopMoving(); + } +} + +bool +FlightPathMovementGenerator::Update(Player &player, const uint32 &diff) +{ + if( MovementInProgress() ) + { + Traveller traveller(player); + if( i_destinationHolder.UpdateTraveller(traveller, diff, false) ) + { + i_destinationHolder.ResetUpdate(FLIGHT_TRAVEL_UPDATE); + if( i_destinationHolder.HasArrived() ) + { + uint32 curMap = i_mapIds[i_currentNode]; + ++i_currentNode; + if( MovementInProgress() ) + { + DEBUG_LOG("loading node %u for player %s", i_currentNode, player.GetName()); + if(i_mapIds[i_currentNode]==curMap) + { + // 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); + } + return true; + } + //else HasArrived() + } + else + return true; + } + else + return true; + } + + // we have arrived at the end of the path + return false; +} + +void +FlightPathMovementGenerator::SetCurrentNodeAfterTeleport() +{ + if(i_mapIds.empty()) + return; + + uint32 map0 = i_mapIds[0]; + for(int i = 1; i < i_mapIds.size(); ++i) + { + if(i_mapIds[i]!=map0) + { + i_currentNode = i; + return; + } + } +} + +// +// Unique1's ASTAR Pathfinding Code... For future use & reference... +// + +#ifdef __PATHFINDING__ + +int GetFCost(int to, int num, int parentNum, float *gcost); // Below... + +int ShortenASTARRoute(short int *pathlist, int number) +{ // Wrote this to make the routes a little smarter (shorter)... No point looping back to the same places... Unique1 + short int temppathlist[MAX_PATHLIST_NODES]; + int count = 0; + // int count2 = 0; + int temp, temp2; + int link; + int upto = 0; + + for (temp = number; temp >= 0; temp--) + { + qboolean shortened = qfalse; + + for (temp2 = 0; temp2 < temp; temp2++) + { + for (link = 0; link < nodes[pathlist[temp]].enodenum; link++) + { + if (nodes[pathlist[temp]].links[link].flags & PATH_BLOCKED) + continue; + + //if ((bot->client->ps.eFlags & EF_TANK) && nodes[bot->current_node].links[link].flags & PATH_NOTANKS) //if this path is blocked, skip it + // continue; + + //if (nodes[nodes[pathlist[temp]].links[link].targetNode].origin[2] > nodes[pathlist[temp]].origin[2] + 32) + // continue; + + if (nodes[pathlist[temp]].links[link].targetNode == pathlist[temp2]) + { // Found a shorter route... + //if (OrgVisible(nodes[pathlist[temp2]].origin, nodes[pathlist[temp]].origin, -1)) + { + temppathlist[count] = pathlist[temp2]; + temp = temp2; + ++count; + shortened = qtrue; + } + } + } + } + + if (!shortened) + { + temppathlist[count] = pathlist[temp]; + ++count; + } + } + + upto = count; + + for (temp = 0; temp < count; temp++) + { + pathlist[temp] = temppathlist[upto]; + --upto; + } + + G_Printf("ShortenASTARRoute: Path size reduced from %i to %i nodes...n", number, count); + return count; +} + +/* +=========================================================================== +CreatePathAStar +This function uses the A* pathfinding algorithm to determine the +shortest path between any two nodes. +It's fairly complex, so I'm not really going to explain it much. +Look up A* and binary heaps for more info. +pathlist stores the ideal path between the nodes, in reverse order, +and the return value is the number of nodes in that path +=========================================================================== +*/ +int CreatePathAStar(gentity_t *bot, int from, int to, short int *pathlist) +{ + //all the data we have to hold...since we can't do dynamic allocation, has to be MAX_NODES + //we can probably lower this later - eg, the open list should never have more than at most a few dozen items on it + short int openlist[MAX_NODES+1]; //add 1 because it's a binary heap, and they don't use 0 - 1 is the first used index + float gcost[MAX_NODES]; + int fcost[MAX_NODES]; + char list[MAX_NODES]; //0 is neither, 1 is open, 2 is closed - char because it's the smallest data type + short int parent[MAX_NODES]; + + short int numOpen = 0; + short int atNode, temp, newnode=-1; + qboolean found = qfalse; + int count = -1; + float gc; + int i, u, v, m; + vec3_t vec; + + //clear out all the arrays + memset(openlist, 0, sizeof(short int)*(MAX_NODES+1)); + memset(fcost, 0, sizeof(int)*MAX_NODES); + memset(list, 0, sizeof(char)*MAX_NODES); + memset(parent, 0, sizeof(short int)*MAX_NODES); + memset(gcost, -1, sizeof(float)*MAX_NODES); + + //make sure we have valid data before calculating everything + if ((from == NODE_INVALID) || (to == NODE_INVALID) || (from >= MAX_NODES) || (to >= MAX_NODES) || (from == to)) + return -1; + + openlist[1] = from; //add the starting node to the open list + ++numOpen; + gcost[from] = 0; //its f and g costs are obviously 0 + fcost[from] = 0; + + while (1) + { + if (numOpen != 0) //if there are still items in the open list + { + //pop the top item off of the list + atNode = openlist[1]; + list[atNode] = 2; //put the node on the closed list so we don't check it again + --numOpen; + + openlist[1] = openlist[numOpen+1]; //move the last item in the list to the top position + v = 1; + + //this while loop reorders the list so that the new lowest fcost is at the top again + while (1) + { + u = v; + if ((2*u+1) < numOpen) //if both children exist + { + if (fcost[openlist[u]] >= fcost[openlist[2*u]]) + v = 2*u; + if (fcost[openlist[v]] >= fcost[openlist[2*u+1]]) + v = 2*u+1; + } + else + { + if ((2*u) < numOpen) //if only one child exists + { + if (fcost[openlist[u]] >= fcost[openlist[2*u]]) + v = 2*u; + } + } + + if (u != v) //if they're out of order, swap this item with its parent + { + temp = openlist[u]; + openlist[u] = openlist[v]; + openlist[v] = temp; + } + else + break; + } + + for (i = 0; i < nodes[atNode].enodenum; i++) //loop through all the links for this node + { + newnode = nodes[atNode].links[i].targetNode; + + //if this path is blocked, skip it + if (nodes[atNode].links[i].flags & PATH_BLOCKED) + continue; + //if this path is blocked, skip it + if (bot->client && (bot->client->ps.eFlags & EF_TANK) && nodes[atNode].links[i].flags & PATH_NOTANKS) + continue; + //skip any unreachable nodes + if (bot->client && (nodes[newnode].type & NODE_ALLY_UNREACHABLE) && (bot->client->sess.sessionTeam == TEAM_ALLIES)) + continue; + if (bot->client && (nodes[newnode].type & NODE_AXIS_UNREACHABLE) && (bot->client->sess.sessionTeam == TEAM_AXIS)) + continue; + + if (list[newnode] == 2) //if this node is on the closed list, skip it + continue; + + if (list[newnode] != 1) //if this node is not already on the open list + { + openlist[++numOpen] = newnode; //add the new node to the open list + list[newnode] = 1; + parent[newnode] = atNode; //record the node's parent + + if (newnode == to) //if we've found the goal, don't keep computing paths! + break; //this will break the 'for' and go all the way to 'if (list[to] == 1)' + + //store it's f cost value + fcost[newnode] = GetFCost(to, newnode, parent[newnode], gcost); + + //this loop re-orders the heap so that the lowest fcost is at the top + m = numOpen; + while (m != 1) //while this item isn't at the top of the heap already + { + //if it has a lower fcost than its parent + if (fcost[openlist[m]] <= fcost[openlist[m/2]]) + { + temp = openlist[m/2]; + openlist[m/2] = openlist[m]; + openlist[m] = temp; //swap them + m /= 2; + } + else + break; + } + } + else //if this node is already on the open list + { + gc = gcost[atNode]; + VectorSubtract(nodes[newnode].origin, nodes[atNode].origin, vec); + gc += VectorLength(vec); //calculate what the gcost would be if we reached this node along the current path + + if (gc < gcost[newnode]) //if the new gcost is less (ie, this path is shorter than what we had before) + { + parent[newnode] = atNode; //set the new parent for this node + gcost[newnode] = gc; //and the new g cost + + for (i = 1; i < numOpen; i++) //loop through all the items on the open list + { + if (openlist[i] == newnode) //find this node in the list + { + //calculate the new fcost and store it + fcost[newnode] = GetFCost(to, newnode, parent[newnode], gcost); + + //reorder the list again, with the lowest fcost item on top + m = i; + while (m != 1) + { + //if the item has a lower fcost than it's parent + if (fcost[openlist[m]] < fcost[openlist[m/2]]) + { + temp = openlist[m/2]; + openlist[m/2] = openlist[m]; + openlist[m] = temp; //swap them + m /= 2; + } + else + break; + } + break; //exit the 'for' loop because we already changed this node + } //if + } //for + } //if (gc < gcost[newnode]) + } //if (list[newnode] != 1) --> else + } //for (loop through links) + } //if (numOpen != 0) + else + { + found = qfalse; //there is no path between these nodes + break; + } + + if (list[to] == 1) //if the destination node is on the open list, we're done + { + found = qtrue; + break; + } + } //while (1) + + if (found == qtrue) //if we found a path + { + //G_Printf("%s - path found!n", bot->client->pers.netname); + count = 0; + + temp = to; //start at the end point + while (temp != from) //travel along the path (backwards) until we reach the starting point + { + pathlist[count++] = temp; //add the node to the pathlist and increment the count + temp = parent[temp]; //move to the parent of this node to continue the path + } + + pathlist[count++] = from; //add the beginning node to the end of the pathlist + + #ifdef __BOT_SHORTEN_ROUTING__ + count = ShortenASTARRoute(pathlist, count); // This isn't working... Dunno why.. Unique1 + #endif //__BOT_SHORTEN_ROUTING__ + } + else + { + //G_Printf("^1*** ^4BOT DEBUG^5: (CreatePathAStar) There is no route between node ^7%i^5 and node ^7%i^5.n", from, to); + count = CreateDumbRoute(from, to, pathlist); + + if (count > 0) + { + #ifdef __BOT_SHORTEN_ROUTING__ + count = ShortenASTARRoute(pathlist, count); // This isn't working... Dunno why.. Unique1 + #endif //__BOT_SHORTEN_ROUTING__ + return count; + } + } + + return count; //return the number of nodes in the path, -1 if not found +} + +/* +=========================================================================== +GetFCost +Utility function used by A* pathfinding to calculate the +cost to move between nodes towards a goal. Using the A* +algorithm F = G + H, G here is the distance along the node +paths the bot must travel, and H is the straight-line distance +to the goal node. +Returned as an int because more precision is unnecessary and it +will slightly speed up heap access +=========================================================================== +*/ +int GetFCost(int to, int num, int parentNum, float *gcost) +{ + float gc = 0; + float hc = 0; + vec3_t v; + + if (gcost[num] == -1) + { + if (parentNum != -1) + { + gc = gcost[parentNum]; + VectorSubtract(nodes[num].origin, nodes[parentNum].origin, v); + gc += VectorLength(v); + } + gcost[num] = gc; + } + else + gc = gcost[num]; + + VectorSubtract(nodes[to].origin, nodes[num].origin, v); + hc = VectorLength(v); + + return (int)(gc + hc); +} +#endif //__PATHFINDING__ diff --git a/src/game/WaypointMovementGenerator.h b/src/game/WaypointMovementGenerator.h index 86e1b0beea3..5d86154a3d9 100644 --- a/src/game/WaypointMovementGenerator.h +++ b/src/game/WaypointMovementGenerator.h @@ -1,140 +1,118 @@ -/* - * Copyright (C) 2005-2008 MaNGOS - * - * Copyright (C) 2008 Trinity - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef TRINITY_WAYPOINTMOVEMENTGENERATOR_H -#define TRINITY_WAYPOINTMOVEMENTGENERATOR_H - -/** @page PathMovementGenerator is used to generate movements - * of waypoints and flight paths. Each serves the purpose - * of generate activities so that it generates updated - * packets for the players. - */ - -#include "MovementGenerator.h" -#include "DestinationHolder.h" -#include "WaypointManager.h" -#include "Path.h" -#include "Traveller.h" - -#include "Player.h" - -#include -#include - -#define FLIGHT_TRAVEL_UPDATE 100 -#define STOP_TIME_FOR_PLAYER 3 * 60 * 1000 // 3 Minutes - -template -class TRINITY_DLL_SPEC PathMovementBase -{ - public: - PathMovementBase() : i_currentNode(0) {} - virtual ~PathMovementBase() {}; - - inline bool MovementInProgress(void) const { return i_currentNode < i_path.Size(); } - - // template pattern, not defined .. override required - void LoadPath(T &); - void ReloadPath(T &); - uint32 GetCurrentNode() const { return i_currentNode; } - - protected: - uint32 i_currentNode; - DestinationHolder< Traveller > i_destinationHolder; - P i_path; -}; - -/** WaypointMovementGenerator loads a series of way points - * from the DB and apply it to the creature's movement generator. - * Hence, the creature will move according to its predefined way points. - */ - -template -class TRINITY_DLL_SPEC WaypointMovementGenerator; - -template<> -class TRINITY_DLL_SPEC WaypointMovementGenerator -: public MovementGeneratorMedium< Creature, WaypointMovementGenerator >, -public PathMovementBase -{ - TimeTrackerSmall i_nextMoveTime; - std::vector i_hasDone; - public: - WaypointMovementGenerator(Creature &) : i_nextMoveTime(0) {} - ~WaypointMovementGenerator() { ClearWaypoints(); } - void Initialize(Creature &u) - { - i_nextMoveTime.Reset(0); // TODO: check the lower bound (0 is probably too small) - u.StopMoving(); - LoadPath(u); - } - void Finalize(Creature &) {} - void Reset(Creature &u) { ReloadPath(u); } - bool Update(Creature &u, const uint32 &diff); - - void MovementInform(Creature &); - - MovementGeneratorType GetMovementGeneratorType() { return WAYPOINT_MOTION_TYPE; } - - // now path movement implmementation - void LoadPath(Creature &c); - void ReloadPath(Creature &c) { ClearWaypoints(); LoadPath(c); } - - // Player stoping creature - bool IsStopedByPlayer() { return b_StopedByPlayer; } - void SetStopedByPlayer(bool val) { b_StopedByPlayer = val; } - - // statics - static void Initialize(void); - - bool GetDestination(float& x, float& y, float& z) const { i_destinationHolder.GetDestination(x,y,z); return true; } - private: - void ClearWaypoints(); - bool b_StopedByPlayer; -}; - -/** FlightPathMovementGenerator generates movement of the player for the paths - * and hence generates ground and activities for the player. - */ -class TRINITY_DLL_SPEC FlightPathMovementGenerator -: public MovementGeneratorMedium< Player, FlightPathMovementGenerator >, -public PathMovementBase -{ - uint32 i_pathId; - std::vector i_mapIds; - public: - explicit FlightPathMovementGenerator(uint32 id, uint32 startNode = 0) : i_pathId(id) { i_currentNode = startNode; } - void Initialize(Player &); - void Finalize(Player &); - void Reset(Player &) {} - bool Update(Player &, const uint32 &); - MovementGeneratorType GetMovementGeneratorType() { return FLIGHT_MOTION_TYPE; } - - void LoadPath(Player &); - void ReloadPath(Player &) { /* don't reload flight path */ } - - Path& GetPath() { return i_path; } - uint32 GetPathAtMapEnd() const; - inline bool HasArrived() const { return (i_currentNode >= i_path.Size()); } - void SetCurrentNodeAfterTeleport(); - void SkipCurrentNode() { ++i_currentNode; } - bool GetDestination(float& x, float& y, float& z) const { i_destinationHolder.GetDestination(x,y,z); return true; } -}; -#endif +/* + * Copyright (C) 2005-2008 MaNGOS + * + * Copyright (C) 2008 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef TRINITY_WAYPOINTMOVEMENTGENERATOR_H +#define TRINITY_WAYPOINTMOVEMENTGENERATOR_H + +/** @page PathMovementGenerator is used to generate movements + * of waypoints and flight paths. Each serves the purpose + * of generate activities so that it generates updated + * packets for the players. + */ + +#include "MovementGenerator.h" +#include "DestinationHolder.h" +#include "WaypointManager.h" +#include "Path.h" +#include "Traveller.h" + +#include "Player.h" + +#include +#include + +#define FLIGHT_TRAVEL_UPDATE 100 +#define STOP_TIME_FOR_PLAYER 3 * 60 * 1000 // 3 Minutes + +template +class TRINITY_DLL_SPEC PathMovementBase +{ + public: + PathMovementBase() : i_currentNode(0) {} + virtual ~PathMovementBase() {}; + + inline bool MovementInProgress(void) const { return i_currentNode < i_path.Size(); } + + void LoadPath(T &); + void ReloadPath(T &); + uint32 GetCurrentNode() const { return i_currentNode; } + + protected: + uint32 i_currentNode; + DestinationHolder< Traveller > i_destinationHolder; + P i_path; +}; + +template + +class TRINITY_DLL_SPEC WaypointMovementGenerator + : public MovementGeneratorMedium< T, WaypointMovementGenerator >, public PathMovementBase +{ + public: + WaypointMovementGenerator(uint32 _path_id = 0, bool _repeating = true) : + i_nextMoveTime(0), path_id(_path_id), repeating(_repeating), StopedByPlayer(false){} + + void Initialize(T &); + void Finalize(T &); + void MovementInform(T &); + void InitTraveller(T &, const WaypointData &); + void GeneratePathId(T &); + void Reset(T &unit); + bool Update(T &, const uint32 &); + bool GetDestination(float &x, float &y, float &z) const{if(i_destinationHolder.HasArrived())return false; i_destinationHolder.GetDestination(x, y, z); return true;} + MovementGeneratorType GetMovementGeneratorType() { return WAYPOINT_MOTION_TYPE; } + + private: + WaypointData node; + uint32 i_currentNode, path_id; + TimeTrackerSmall i_nextMoveTime; + WaypointPath *waypoints; + bool repeating, custom_path, ExecuteScript, StopedByPlayer; +}; + +/** FlightPathMovementGenerator generates movement of the player for the paths + * and hence generates ground and activities for the player. + */ +class TRINITY_DLL_SPEC FlightPathMovementGenerator +: public MovementGeneratorMedium< Player, FlightPathMovementGenerator >, +public PathMovementBase +{ + uint32 i_pathId; + std::vector i_mapIds; + public: + explicit FlightPathMovementGenerator(uint32 id, uint32 startNode = 0) : i_pathId(id) { i_currentNode = startNode; } + void Initialize(Player &); + void Finalize(Player &); + void Reset(Player &) {} + bool Update(Player &, const uint32 &); + MovementGeneratorType GetMovementGeneratorType() { return FLIGHT_MOTION_TYPE; } + + void LoadPath(Player &); + void ReloadPath(Player &) { /* don't reload flight path */ } + + Path& GetPath() { return i_path; } + uint32 GetPathAtMapEnd() const; + inline bool HasArrived() const { return (i_currentNode >= i_path.Size()); } + void SetCurrentNodeAfterTeleport(); + void SkipCurrentNode() { ++i_currentNode; } + bool GetDestination(float& x, float& y, float& z) const { i_destinationHolder.GetDestination(x,y,z); return true; } + +}; +#endif diff --git a/src/game/World.cpp b/src/game/World.cpp index 04b3a1004c9..8cf6147842b 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -1271,6 +1271,7 @@ void World::SetInitialWorldSettings() objmgr.LoadSpellScripts(); // must be after load Creature/Gameobject(Template/Data) objmgr.LoadGameObjectScripts(); // must be after load Creature/Gameobject(Template/Data) objmgr.LoadEventScripts(); // must be after load Creature/Gameobject(Template/Data) + objmgr.LoadWaypointScripts(); sLog.outString( "Loading Scripts text locales..." ); // must be after Load*Scripts calls objmgr.LoadDbScriptStrings(); @@ -1313,7 +1314,6 @@ void World::SetInitialWorldSettings() ///- Initilize static helper structures AIRegistry::Initialize(); - WaypointMovementGenerator::Initialize(); Player::InitVisibleBits(); ///- Initialize MapManager @@ -2203,8 +2203,32 @@ void World::ScriptsProcess() break; } - - default: + + case SCRIPT_COMMAND_LOAD_PATH: + { + if(!source) + { + sLog.outError("SCRIPT_COMMAND_START_MOVE is tried to apply to NON-existing unit."); + break; + } + + if(!source->isType(TYPEMASK_UNIT)) + { + sLog.outError("SCRIPT_COMMAND_START_MOVE source mover isn't unit (TypeId: %u), skipping.",source->GetTypeId()); + break; + } + + if(!WaypointMgr.GetPath(step.script->datalong)) + { + sLog.outError("SCRIPT_COMMAND_START_MOVE source mover has an invallid path, skipping.", step.script->datalong2); + break; + } + + dynamic_cast(source)->GetMotionMaster()->MovePath(step.script->datalong, step.script->datalong2); + break; + } + + default: sLog.outError("Unknown script command %u called.",step.script->command); break; } diff --git a/src/game/World.h b/src/game/World.h index fc11301f883..885047e6685 100644 --- a/src/game/World.h +++ b/src/game/World.h @@ -326,6 +326,7 @@ enum RealmZone #define SCRIPT_COMMAND_ACTIVATE_OBJECT 13 // source = unit, target=GO #define SCRIPT_COMMAND_REMOVE_AURA 14 // source (datalong2!=0) or target (datalong==0) unit, datalong = spell_id #define SCRIPT_COMMAND_CAST_SPELL 15 // source (datalong2!=0) or target (datalong==0) unit, datalong = spell_id +#define SCRIPT_COMMAND_LOAD_PATH 16 // source = unit, path = datalong, repeatable datalong2 /// Storage class for commands issued for delayed execution struct CliCommandHolder diff --git a/src/shared/Database/SQLStorage.cpp b/src/shared/Database/SQLStorage.cpp index 720e6e3e683..4845841b6d6 100644 --- a/src/shared/Database/SQLStorage.cpp +++ b/src/shared/Database/SQLStorage.cpp @@ -29,9 +29,9 @@ extern DatabaseMysql WorldDatabase; const char CreatureInfosrcfmt[]="iiiiiisssiiiiiiiiiiffiffiiiiiiiiiiiffiiiiiiiiiiiiiiiiiiisiilliiis"; const char CreatureInfodstfmt[]="iiiiiisssiiiiiiiiiiffiffiiiiiiiiiiiffiiiiiiiiiiiiiiiiiiisiilliiii"; -const char CreatureDataAddonInfofmt[]="iiiiiiis"; +const char CreatureDataAddonInfofmt[]="iiiiiiiis"; const char CreatureModelfmt[]="iffbi"; -const char CreatureInfoAddonInfofmt[]="iiiiiiis"; +const char CreatureInfoAddonInfofmt[]="iiiiiiiis"; const char EquipmentInfofmt[]="iiiiiiiiii"; const char GameObjectInfosrcfmt[]="iiissiifiiiiiiiiiiiiiiiiiiiiiiiis"; const char GameObjectInfodstfmt[]="iiissiifiiiiiiiiiiiiiiiiiiiiiiiii"; -- cgit v1.2.3 From 36af87fc72594b3b6e3b91e91cd29a00e1a36480 Mon Sep 17 00:00:00 2001 From: megamage Date: Tue, 9 Dec 2008 23:02:17 -0600 Subject: *Recommit four files because of eol issue. --HG-- branch : trunk --- src/game/WaypointManager.cpp | 406 +++++++++------------------------ src/game/WaypointManager.h | 82 ++----- src/game/WaypointMovementGenerator.cpp | 306 ++++++++++++------------- src/game/WaypointMovementGenerator.h | 72 ++---- 4 files changed, 299 insertions(+), 567 deletions(-) (limited to 'src') diff --git a/src/game/WaypointManager.cpp b/src/game/WaypointManager.cpp index 831f616060b..c18c09bcc17 100644 --- a/src/game/WaypointManager.cpp +++ b/src/game/WaypointManager.cpp @@ -10,333 +10,143 @@ * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "Database/DatabaseEnv.h" #include "GridDefines.h" -#include "Policies/SingletonImp.h" #include "WaypointManager.h" #include "ProgressBar.h" #include "MapManager.h" -#include "ObjectMgr.h" -INSTANTIATE_SINGLETON_1(WaypointManager); +UNORDERED_MAP waypoint_map; +WaypointStore WaypointMgr; -bool WaypointBehavior::isEmpty() +void WaypointStore::Free() { - if (emote || spell || model1 || model2) - return false; - - for(int i = 0; i < MAX_WAYPOINT_TEXT; ++i) - if(textid[i]) - return false; - - return true; -} - -WaypointBehavior::WaypointBehavior(const WaypointBehavior &b) -{ - emote = b.emote; - spell = b.spell; - model1 = b.model1; - model2 = b.model2; - for(int i=0; i < MAX_WAYPOINT_TEXT; ++i) - textid[i] = b.textid[i]; + waypoint_map.clear(); } -void WaypointManager::Load() +void WaypointStore::Load() { - Cleanup(); - - uint32 total_paths = 0; - uint32 total_nodes = 0; - uint32 total_behaviors = 0; - - QueryResult *result = WorldDatabase.Query("SELECT id, COUNT(point) FROM creature_movement GROUP BY id"); - if(result) + QueryResult *result = WorldDatabase.PQuery("SELECT MAX(`id`) FROM `waypoint_data"); + if(!result) { - total_paths = result->GetRowCount(); - barGoLink bar( total_paths ); - do - { - Field *fields = result->Fetch(); - uint32 id = fields[0].GetUInt32(); - uint32 count = fields[1].GetUInt32(); - m_pathMap[id].resize(count); - - total_nodes += count; - bar.step(); - } while( result->NextRow() ); - delete result; + sLog.outError(" an error occured while loading the table `waypoint_data` ( maybe it doesn't exist ?)\n"); + exit(1); // Stop server at loading non exited table or not accessable table } - result = WorldDatabase.Query("SELECT position_x, position_y, position_z, orientation, model1, model2, waittime, emote, spell, textid1, textid2, textid3, textid4, textid5, id, point FROM creature_movement"); - if(result) - { - barGoLink bar( result->GetRowCount() ); - do - { - Field *fields = result->Fetch(); - uint32 point = fields[15].GetUInt32(); - uint32 id = fields[14].GetUInt32(); - - WaypointPath &path = m_pathMap[id]; - // the cleanup queries make sure the following is true - assert(point >= 1 && point <= path.size()); - WaypointNode &node = path[point-1]; - - node.x = fields[0].GetFloat(); - node.y = fields[1].GetFloat(); - node.z = fields[2].GetFloat(); - node.orientation = fields[3].GetFloat(); - node.delay = fields[6].GetUInt16(); - - // prevent using invalid coordinates - if(!Trinity::IsValidMapCoord(node.x, node.y, node.z, node.orientation)) - { - QueryResult *result1 = WorldDatabase.PQuery("SELECT id, map FROM creature WHERE guid = '%u'", id); - if(result1) - sLog.outErrorDb("ERROR: Creature (guidlow %d, entry %d) have invalid coordinates in his waypoint %d (X: %f, Y: %f).", - id, result1->Fetch()[0].GetUInt32(), point, node.x, node.y); - else - sLog.outErrorDb("ERROR: Waypoint path %d, have invalid coordinates in his waypoint %d (X: %f, Y: %f).", - id, point, node.x, node.y); - - Trinity::NormalizeMapCoord(node.x); - Trinity::NormalizeMapCoord(node.y); - if(result1) - { - node.z = MapManager::Instance ().GetBaseMap(result1->Fetch()[1].GetUInt32())->GetHeight(node.x, node.y, node.z); - delete result1; - } - WorldDatabase.PExecute("UPDATE creature_movement SET position_x = '%f', position_y = '%f', position_z = '%f' WHERE id = '%u' AND point = '%u'", node.x, node.y, node.z, id, point); - } - - WaypointBehavior be; - be.model1 = fields[4].GetUInt32(); - be.model2 = fields[5].GetUInt32(); - be.emote = fields[7].GetUInt32(); - be.spell = fields[8].GetUInt32(); - - for(int i = 0; i < MAX_WAYPOINT_TEXT; ++i) - { - be.textid[i] = fields[9+i].GetUInt32(); - if(be.textid[i]) - { - if (be.textid[i] < MIN_DB_SCRIPT_STRING_ID || be.textid[i] >= MAX_DB_SCRIPT_STRING_ID) - { - sLog.outErrorDb( "Table `db_script_string` not have string id %u", be.textid[i]); - continue; - } - } - } - - // save memory by not storing empty behaviors - if(!be.isEmpty()) - { - node.behavior = new WaypointBehavior(be); - ++total_behaviors; - } - else - node.behavior = NULL; - bar.step(); - } while( result->NextRow() ); - delete result; - } - sLog.outString( ">> Loaded %u paths, %u nodes and %u behaviors", total_paths, total_nodes, total_behaviors); -} - -void WaypointManager::Cleanup() -{ - // check if points need to be renumbered and do it - if(QueryResult *result = WorldDatabase.Query("SELECT 1 from creature_movement As T WHERE point <> (SELECT COUNT(*) FROM creature_movement WHERE id = T.id AND point <= T.point) LIMIT 1")) - { - delete result; - WorldDatabase.DirectExecute("CREATE TEMPORARY TABLE temp LIKE creature_movement"); - WorldDatabase.DirectExecute("INSERT INTO temp SELECT * FROM creature_movement"); - WorldDatabase.DirectExecute("ALTER TABLE creature_movement DROP PRIMARY KEY"); - WorldDatabase.DirectExecute("UPDATE creature_movement AS T SET point = (SELECT COUNT(*) FROM temp WHERE id = T.id AND point <= T.point)"); - WorldDatabase.DirectExecute("ALTER TABLE creature_movement ADD PRIMARY KEY (id, point)"); - WorldDatabase.DirectExecute("DROP TABLE temp"); - assert(!(result = WorldDatabase.Query("SELECT 1 from creature_movement As T WHERE point <> (SELECT COUNT(*) FROM creature_movement WHERE id = T.id AND point <= T.point) LIMIT 1"))); - } -} - -void WaypointManager::Unload() -{ - for(WaypointPathMap::iterator itr = m_pathMap.begin(); itr != m_pathMap.end(); ++itr) - _clearPath(itr->second); - m_pathMap.clear(); -} - -void WaypointManager::_clearPath(WaypointPath &path) -{ - for(WaypointPath::iterator itr = path.begin(); itr != path.end(); ++itr) - if(itr->behavior) - delete itr->behavior; - path.clear(); -} - -/// - Insert after the last point -void WaypointManager::AddLastNode(uint32 id, float x, float y, float z, float o, uint32 delay, uint32 wpGuid) -{ - _addNode(id, GetLastPoint(id, 0) + 1, x, y, z, o, delay, wpGuid); -} - -/// - Insert after a certain point -void WaypointManager::AddAfterNode(uint32 id, uint32 point, float x, float y, float z, float o, uint32 delay, uint32 wpGuid) -{ - for(uint32 i = GetLastPoint(id, 0); i > point; i--) - WorldDatabase.PExecuteLog("UPDATE creature_movement SET point=point+1 WHERE id='%u' AND point='%u'", id, i); - - _addNode(id, point + 1, x, y, z, o, delay, wpGuid); -} + records = (*result)[0].GetUInt32(); + delete result; -/// - Insert without checking for collision -void WaypointManager::_addNode(uint32 id, uint32 point, float x, float y, float z, float o, uint32 delay, uint32 wpGuid) -{ - if(point == 0) return; // counted from 1 in the DB - WorldDatabase.PExecuteLog("INSERT INTO creature_movement (id,point,position_x,position_y,position_z,orientation,wpguid,waittime) VALUES ('%u','%u','%f', '%f', '%f', '%f', '%d', '%d')", id, point, x, y, z, o, wpGuid, delay); - WaypointPathMap::iterator itr = m_pathMap.find(id); - if(itr == m_pathMap.end()) - itr = m_pathMap.insert(WaypointPathMap::value_type(id, WaypointPath())).first; - itr->second.insert(itr->second.begin() + (point - 1), WaypointNode(x, y, z, o, delay, NULL)); -} -uint32 WaypointManager::GetLastPoint(uint32 id, uint32 default_notfound) -{ - uint32 point = default_notfound; - /*QueryResult *result = WorldDatabase.PQuery( "SELECT MAX(point) FROM creature_movement WHERE id = '%u'", id); - if( result ) + result = WorldDatabase.PQuery("SELECT `id`,`point`,`position_x`,`position_y`,`position_z`,`move_flag`,`delay`,`action`,`action_chance` FROM `waypoint_data` ORDER BY `id`, `point`"); + if(!result) { - point = (*result)[0].GetUInt32()+1; - delete result; - }*/ - WaypointPathMap::iterator itr = m_pathMap.find(id); - if(itr != m_pathMap.end() && itr->second.size() != 0) - point = itr->second.size(); - return point; -} - -void WaypointManager::DeleteNode(uint32 id, uint32 point) -{ - if(point == 0) return; // counted from 1 in the DB - WorldDatabase.PExecuteLog("DELETE FROM creature_movement WHERE id='%u' AND point='%u'", id, point); - WorldDatabase.PExecuteLog("UPDATE creature_movement SET point=point-1 WHERE id='%u' AND point>'%u'", id, point); - WaypointPathMap::iterator itr = m_pathMap.find(id); - if(itr != m_pathMap.end() && point <= itr->second.size()) - itr->second.erase(itr->second.begin() + (point-1)); -} - -void WaypointManager::DeletePath(uint32 id) -{ - WorldDatabase.PExecuteLog("DELETE FROM creature_movement WHERE id='%u'", id); - WaypointPathMap::iterator itr = m_pathMap.find(id); - if(itr != m_pathMap.end()) - _clearPath(itr->second); - // the path is not removed from the map, just cleared - // WMGs have pointers to the path, so deleting them would crash - // this wastes some memory, but these functions are - // only meant to be called by GM commands -} - -void WaypointManager::SetNodePosition(uint32 id, uint32 point, float x, float y, float z) -{ - if(point == 0) return; // counted from 1 in the DB - WorldDatabase.PExecuteLog("UPDATE creature_movement SET position_x = '%f',position_y = '%f',position_z = '%f' where id = '%u' AND point='%u'", x, y, z, id, point); - WaypointPathMap::iterator itr = m_pathMap.find(id); - if(itr != m_pathMap.end() && point <= itr->second.size()) - { - itr->second[point-1].x = x; - itr->second[point-1].y = y; - itr->second[point-1].z = z; + sLog.outErrorDb("The table `creature_addon` is empty or corrupted"); + return; } -} -void WaypointManager::SetNodeText(uint32 id, uint32 point, const char *text_field, const char *text) -{ - if(point == 0) return; // counted from 1 in the DB - if(!text_field) return; - std::string field = text_field; - WorldDatabase.escape_string(field); + WaypointPath* path_data; + uint32 total_records = result->GetRowCount(); - if(!text) + barGoLink bar( total_records); + Field *fields; + uint32 last_id = 0; + + do { - WorldDatabase.PExecuteLog("UPDATE creature_movement SET %s=NULL WHERE id='%u' AND point='%u'", field.c_str(), id, point); - } - else - { - std::string text2 = text; - WorldDatabase.escape_string(text2); - WorldDatabase.PExecuteLog("UPDATE creature_movement SET %s='%s' WHERE id='%u' AND point='%u'", field.c_str(), text2.c_str(), id, point); - } - - WaypointPathMap::iterator itr = m_pathMap.find(id); - if(itr != m_pathMap.end() && point <= itr->second.size()) - { - WaypointNode &node = itr->second[point-1]; - if(!node.behavior) node.behavior = new WaypointBehavior(); - -// if(field == "text1") node.behavior->text[0] = text ? text : ""; -// if(field == "text2") node.behavior->text[1] = text ? text : ""; -// if(field == "text3") node.behavior->text[2] = text ? text : ""; -// if(field == "text4") node.behavior->text[3] = text ? text : ""; -// if(field == "text5") node.behavior->text[4] = text ? text : ""; - if(field == "emote") node.behavior->emote = text ? atoi(text) : 0; - if(field == "spell") node.behavior->spell = text ? atoi(text) : 0; - if(field == "model1") node.behavior->model1 = text ? atoi(text) : 0; - if(field == "model2") node.behavior->model2 = text ? atoi(text) : 0; - } + fields = result->Fetch(); + uint32 id = fields[0].GetUInt32(); + bar.step(); + WaypointData *wp = new WaypointData; + + if(last_id != id) + path_data = new WaypointPath; + + float x,y,z; + x = fields[2].GetFloat(); + y = fields[3].GetFloat(); + z = fields[4].GetFloat(); + + Trinity::NormalizeMapCoord(x); + Trinity::NormalizeMapCoord(y); + + wp->id = fields[1].GetUInt32(); + wp->x = x; + wp->y = y; + wp->z = z; + wp->run = fields[5].GetBool(); + wp->delay = fields[6].GetUInt32(); + wp->event_id = fields[7].GetUInt32(); + wp->event_chance = fields[8].GetUInt8(); + + path_data->push_back(wp); + + if(id != last_id) + waypoint_map[id] = path_data; + + last_id = id; + + } while(result->NextRow()) ; + + + delete result; } -void WaypointManager::CheckTextsExistance(std::set& ids) +void WaypointStore::UpdatePath(uint32 id) { - WaypointPathMap::iterator pmItr = m_pathMap.begin(); - for ( ; pmItr != m_pathMap.end(); ++pmItr) + + if(waypoint_map.find(id)!= waypoint_map.end()) + waypoint_map[id]->clear(); + + QueryResult *result; + + result = WorldDatabase.PQuery("SELECT `id`,`point`,`position_x`,`position_y`,`position_z`,`move_flag`,`delay`,`action`,`action_chance` FROM `waypoint_data` WHERE id = %u ORDER BY `point`", id); + + if(!result) + return; + + WaypointPath* path_data; + + path_data = new WaypointPath; + + Field *fields; + + do { - for (int i = 0; i < pmItr->second.size(); ++i) - { - if (!pmItr->second[i].behavior) - continue; - - // Now we check text existence and put all zero texts ids to the end of array - - // Counting leading zeros for futher textid shift - int zeroCount = 0; - for (int j = 0; j < MAX_WAYPOINT_TEXT; ++j) - { - if (!pmItr->second[i].behavior->textid[j]) - { - ++zeroCount; - continue; - } - else - { - if (!objmgr.GetTrinityStringLocale(pmItr->second[i].behavior->textid[j])) - { - sLog.outErrorDb("ERROR: Some waypoint has textid%u with not existing %u text.", j, pmItr->second[i].behavior->textid[j]); - pmItr->second[i].behavior->textid[j] = 0; - ++zeroCount; - continue; - } - else - ids.erase(pmItr->second[i].behavior->textid[j]); - - // Shifting check - if (zeroCount) - { - // Correct textid but some zeros leading, so move it forward. - pmItr->second[i].behavior->textid[j-zeroCount] = pmItr->second[i].behavior->textid[j]; - pmItr->second[i].behavior->textid[j] = 0; - } - } - } - } - } + fields = result->Fetch(); + uint32 id = fields[0].GetUInt32(); + + WaypointData *wp = new WaypointData; + + float x,y,z; + x = fields[2].GetFloat(); + y = fields[3].GetFloat(); + z = fields[4].GetFloat(); + + Trinity::NormalizeMapCoord(x); + Trinity::NormalizeMapCoord(y); + + wp->id = fields[1].GetUInt32(); + wp->x = x; + wp->y = y; + wp->z = z; + wp->run = fields[5].GetBool(); + wp->delay = fields[6].GetUInt32(); + wp->event_id = fields[7].GetUInt32(); + wp->event_chance = fields[8].GetUInt8(); + + path_data->push_back(wp); + + }while (result->NextRow()); + + waypoint_map[id] = path_data; + + delete result; } diff --git a/src/game/WaypointManager.h b/src/game/WaypointManager.h index 38cf5551d64..ec6d46c3b31 100644 --- a/src/game/WaypointManager.h +++ b/src/game/WaypointManager.h @@ -22,72 +22,40 @@ #define TRINITY_WAYPOINTMANAGER_H #include -#include -#include "Utilities/UnorderedMap.h" -#define MAX_WAYPOINT_TEXT 5 -struct WaypointBehavior +struct WaypointData { - uint32 emote; - uint32 spell; - int32 textid[MAX_WAYPOINT_TEXT]; - uint32 model1; - uint32 model2; - - bool isEmpty(); - WaypointBehavior() {} - WaypointBehavior(const WaypointBehavior &b); -}; - -struct WaypointNode -{ - float x; - float y; - float z; - float orientation; + uint32 id; + float x,y,z; + bool run; uint32 delay; - WaypointBehavior * behavior; - WaypointNode() {} - WaypointNode(float _x, float _y, float _z, float _o, uint32 _delay, WaypointBehavior * _behavior) - : x(_x), y(_y), z(_z), orientation(_o), delay(_delay), behavior(_behavior) {} + uint32 event_id; + uint8 event_chance; }; -typedef std::vector WaypointPath; +typedef std::vector WaypointPath; +extern UNORDERED_MAP waypoint_map; -class WaypointManager +class WaypointStore { - public: - WaypointManager() {} - ~WaypointManager() { Unload(); } - - void Load(); - void Unload(); - - void Cleanup(); - - WaypointPath *GetPath(uint32 id) + private : + uint32 records; + + public: + void UpdatePath(uint32 id); + void Load(); + void Free(); + + WaypointPath* GetPath(uint32 id) { - WaypointPathMap::iterator itr = m_pathMap.find(id); - return itr != m_pathMap.end() ? &itr->second : NULL; - } - - void AddLastNode(uint32 id, float x, float y, float z, float o, uint32 delay, uint32 wpGuid); - void AddAfterNode(uint32 id, uint32 point, float x, float y, float z, float o, uint32 delay, uint32 wpGuid); - uint32 GetLastPoint(uint32 id, uint32 default_notfound); - void DeleteNode(uint32 id, uint32 point); - void DeletePath(uint32 id); - void SetNodePosition(uint32 id, uint32 point, float x, float y, float z); - void SetNodeText(uint32 id, uint32 point, const char *text_field, const char *text); - void CheckTextsExistance(std::set& ids); - - private: - void _addNode(uint32 id, uint32 point, float x, float y, float z, float o, uint32 delay, uint32 wpGuid); - void _clearPath(WaypointPath &path); - - typedef UNORDERED_MAP WaypointPathMap; - WaypointPathMap m_pathMap; + if(waypoint_map.find(id) != waypoint_map.end()) + return waypoint_map[id]; + else return 0; + } + + inline uint32 GetRecordsCount() { return records; } }; -#define WaypointMgr Trinity::Singleton::Instance() +extern WaypointStore WaypointMgr; #endif diff --git a/src/game/WaypointMovementGenerator.cpp b/src/game/WaypointMovementGenerator.cpp index 3dc3ddebf42..84f121eb9b3 100644 --- a/src/game/WaypointMovementGenerator.cpp +++ b/src/game/WaypointMovementGenerator.cpp @@ -1,8 +1,6 @@ /* * Copyright (C) 2005-2008 MaNGOS * - * Copyright (C) 2008 Trinity - * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -10,209 +8,187 @@ * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* -creature_movement Table - -alter table creature_movement add `textid1` int(11) NOT NULL default '0'; -alter table creature_movement add `textid2` int(11) NOT NULL default '0'; -alter table creature_movement add `textid3` int(11) NOT NULL default '0'; -alter table creature_movement add `textid4` int(11) NOT NULL default '0'; -alter table creature_movement add `textid5` int(11) NOT NULL default '0'; -alter table creature_movement add `emote` int(10) unsigned default '0'; -alter table creature_movement add `spell` int(5) unsigned default '0'; -alter table creature_movement add `wpguid` int(11) default '0'; - -*/ - +//Basic header #include #include "WaypointMovementGenerator.h" +//Accessors +#include "Database/DatabaseEnv.h" #include "ObjectMgr.h" +#include "World.h" +//Creature-specific headers #include "Creature.h" -#include "DestinationHolderImp.h" #include "CreatureAI.h" -#include "WaypointManager.h" +//Player-Specific +#include "Player.h" +//Visual +#include "ProgressBar.h" +#include "MapManager.h" -#include +template +void +WaypointMovementGenerator::Initialize(T &u){} -//-----------------------------------------------// +template<> void -WaypointMovementGenerator::LoadPath(Creature &c) +WaypointMovementGenerator::Initialize(Creature &u) { - sLog.outDetail("LoadPath: loading waypoint path for creature %d,%d", c.GetGUIDLow(), c.GetDBTableGUIDLow()); + i_currentNode = -1; + u.StopMoving(); + if(!path_id) + path_id = u.GetWaypointPath(); + waypoints = WaypointMgr.GetPath(path_id); +} - i_path = WaypointMgr.GetPath(c.GetDBTableGUIDLow()); - if(!i_path) - { - sLog.outErrorDb("WaypointMovementGenerator::LoadPath: creature %s (Entry: %u GUID: %d) doesn't have waypoint path", - c.GetName(), c.GetEntry(), c.GetDBTableGUIDLow()); - return; - } +template<> +void +WaypointMovementGenerator::Finalize(Creature &u){} + +template<> +void +WaypointMovementGenerator::Finalize(Player &u){} - uint32 node_count = i_path->size(); - i_hasDone.resize(node_count); - for(uint32 i = 0; i < node_count-1; i++) - i_hasDone[i] = false; +template +void +WaypointMovementGenerator::MovementInform(T &unit){} - // to prevent a misbehaviour inside "update" - // update is always called with the next wp - but the wpSys needs the current - // so when the routine is called the first time, wpSys gets the last waypoint - // and this prevents the system from performing text/emote, etc - i_hasDone[node_count - 1] = true; +template<> +void WaypointMovementGenerator::MovementInform(Creature &unit) +{ + unit.AI()->MovementInform(WAYPOINT_MOTION_TYPE, i_currentNode); } -void -WaypointMovementGenerator::ClearWaypoints() +template<> +void WaypointMovementGenerator::Reset(Creature &unit){} + +template<> +void WaypointMovementGenerator::Reset(Player &unit){} + +template<> +void WaypointMovementGenerator::InitTraveller(Creature &unit, const WaypointData &node) { - i_path = NULL; + node.run ? unit.RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE): unit.AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + + unit.SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); + unit.SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + + if(unit.canFly()) + unit.AddUnitMovementFlag(MOVEMENTFLAG_FLYING2); + + unit.addUnitState(UNIT_STAT_ROAMING); } -void -WaypointMovementGenerator::Initialize() +template<> +void WaypointMovementGenerator::InitTraveller(Player &unit, const WaypointData &node){} + +template +bool +WaypointMovementGenerator::Update(T &unit, const uint32 &diff) { + return false; } +template<> bool -WaypointMovementGenerator::Update(Creature &creature, const uint32 &diff) +WaypointMovementGenerator::Update(Creature &unit, const uint32 &diff) { - if(!&creature) + if(!&unit) return true; - // Waypoint movement can be switched on/off + if(!path_id) + return false; + + // Waypoint movement can be switched on/off // This is quite handy for escort quests and other stuff - if(creature.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED)) - return true; + if(unit.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED)) + return true; - // prevent a crash at empty waypoint path. - if(!i_path || i_path->empty()) - return true; + // Clear the generator if the path doesn't exist + if(!waypoints || !waypoints->size()) + return false; - // i_path was modified by chat commands for example - if(i_path->size() != i_hasDone.size()) - i_hasDone.resize(i_path->size()); - if(i_currentNode >= i_path->size()) - i_currentNode = 0; + Traveller traveller(unit); - CreatureTraveller traveller(creature); - - i_nextMoveTime.Update(diff); + i_nextMoveTime.Update(diff); i_destinationHolder.UpdateTraveller(traveller, diff, false, true); - // creature has been stoped in middle of the waypoint segment - if (!i_destinationHolder.HasArrived() && creature.IsStopped()) - { - if( i_nextMoveTime.Passed()) // Timer has elapsed, meaning this part controlled it - { - SetStopedByPlayer(false); - // Now we re-set destination to same node and start travel - creature.addUnitState(UNIT_STAT_ROAMING); - if (creature.canFly()) - creature.AddUnitMovementFlag(MOVEMENTFLAG_FLYING2); - const WaypointNode &node = i_path->at(i_currentNode); - i_destinationHolder.SetDestination(traveller, node.x, node.y, node.z); - i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime()); - } - else // if( !i_nextMoveTime.Passed()) - { // unexpected end of timer && creature stopped && not at end of segment - if (!IsStopedByPlayer()) - { // Put 30 seconds delay - i_destinationHolder.IncreaseTravelTime(STOP_TIME_FOR_PLAYER); - i_nextMoveTime.Reset(STOP_TIME_FOR_PLAYER); - SetStopedByPlayer(true); // Mark we did it - } - } - return true; // Abort here this update + if(i_nextMoveTime.Passed()) + { + if(unit.IsStopped()) + { + if(StopedByPlayer) + { + InitTraveller(unit,node); + i_destinationHolder.SetDestination(traveller, node.x, node.y, node.z); + i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime()); + StopedByPlayer = false; + return true; + } + + if(i_currentNode == waypoints->size() - 1) //If that's our last waypoint + { + if(repeating) //If the movement is repeating + i_currentNode = 0; //Start moving all over again + else + { + unit.GetMotionMaster()->Initialize(); + return false; //Clear the waypoint movement + } + } + else + i_currentNode++; + + node = *(waypoints->at(i_currentNode)); + InitTraveller(unit,node); + i_destinationHolder.SetDestination(traveller, node.x, node.y, node.z); + i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime()); + } + else + { + //Determine waittime + if(node.delay) + i_nextMoveTime.Reset(node.delay); + else + i_nextMoveTime.Reset(100); //Prevents some lag + + if(node.event_id && rand()%100 < node.event_chance && !ExecuteScript) + { + sWorld.ScriptsStart(sWaypointScripts, node.event_id, &unit, NULL); + ExecuteScript = true; + } + + MovementInform(unit); + unit.UpdateWaypointID(i_currentNode); + traveller.Relocation(node.x, node.y, node.z); + unit.clearUnitState(UNIT_STAT_MOVING); + } } - - if( creature.IsStopped()) - { - uint32 idx = i_currentNode > 0 ? i_currentNode-1 : i_path->size()-1; - - if (!i_hasDone[idx]) - { - if (i_path->at(idx).orientation !=100) - creature.SetOrientation(i_path->at(idx).orientation); - - if(WaypointBehavior *behavior = i_path->at(idx).behavior) - { - if(behavior->emote != 0) - creature.SetUInt32Value(UNIT_NPC_EMOTESTATE,behavior->emote); - if(behavior->spell != 0) - creature.CastSpell(&creature,behavior->spell, false); - if(behavior->model1 != 0) - creature.SetDisplayId(behavior->model1); - if(behavior->textid[0]) - { - // Not only one text is set - if( behavior->textid[1] ) - { - // Select one from max 5 texts (0 and 1 already checked) - int i = 2; - for( ; i < MAX_WAYPOINT_TEXT; ++i ) - if( !behavior->textid[i] ) - break; - - creature.Say(behavior->textid[rand() % i], 0, 0); - } - else - creature.Say(behavior->textid[0], 0, 0); - } - } // wpBehaviour found - i_hasDone[idx] = true; - MovementInform(creature); - } // HasDone == false - } // i_creature.IsStopped() - - if( i_nextMoveTime.Passed() ) // This is at the end of waypoint segment or has been stopped by player - { - if( creature.IsStopped() ) // If stopped then begin a new move segment - { - creature.addUnitState(UNIT_STAT_ROAMING); - if (creature.canFly()) - creature.AddUnitMovementFlag(MOVEMENTFLAG_FLYING2); - const WaypointNode &node = i_path->at(i_currentNode); - i_destinationHolder.SetDestination(traveller, node.x, node.y, node.z); - i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime()); - uint32 idx = i_currentNode > 0 ? i_currentNode-1 : i_path->size()-1; - - if (i_path->at(idx).orientation !=100) - creature.SetOrientation(i_path->at(idx).orientation); - - if(WaypointBehavior *behavior = i_path->at(idx).behavior ) - { - i_hasDone[idx] = false; - if(behavior->model2 != 0) - creature.SetDisplayId(behavior->model2); - - creature.SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); - } - } - else // If not stopped then stop it and set the reset of TimeTracker to waittime - { - creature.StopMoving(); - SetStopedByPlayer(false); - i_nextMoveTime.Reset(i_path->at(i_currentNode).delay); - ++i_currentNode; - if( i_currentNode >= i_path->size() ) - i_currentNode = 0; - } - } - return true; + else + { + if(unit.IsStopped() && !i_destinationHolder.HasArrived()) + { + if(!StopedByPlayer) + { + i_destinationHolder.IncreaseTravelTime(STOP_TIME_FOR_PLAYER); + i_nextMoveTime.Reset(STOP_TIME_FOR_PLAYER); + StopedByPlayer = true; + } + } + } + return true; } -void WaypointMovementGenerator::MovementInform(Creature &unit) -{ - if(unit.AI()) - unit.AI()->MovementInform(WAYPOINT_MOTION_TYPE, i_currentNode); -} +template void WaypointMovementGenerator::Initialize(Player &); +template bool WaypointMovementGenerator::Update(Player &, const uint32 &); +template void WaypointMovementGenerator::MovementInform(Player &); //----------------------------------------------------// void diff --git a/src/game/WaypointMovementGenerator.h b/src/game/WaypointMovementGenerator.h index 86e1b0beea3..78752c771f0 100644 --- a/src/game/WaypointMovementGenerator.h +++ b/src/game/WaypointMovementGenerator.h @@ -50,64 +50,41 @@ class TRINITY_DLL_SPEC PathMovementBase inline bool MovementInProgress(void) const { return i_currentNode < i_path.Size(); } - // template pattern, not defined .. override required void LoadPath(T &); void ReloadPath(T &); uint32 GetCurrentNode() const { return i_currentNode; } - + protected: uint32 i_currentNode; DestinationHolder< Traveller > i_destinationHolder; P i_path; }; -/** WaypointMovementGenerator loads a series of way points - * from the DB and apply it to the creature's movement generator. - * Hence, the creature will move according to its predefined way points. - */ - template -class TRINITY_DLL_SPEC WaypointMovementGenerator; -template<> -class TRINITY_DLL_SPEC WaypointMovementGenerator -: public MovementGeneratorMedium< Creature, WaypointMovementGenerator >, -public PathMovementBase +class TRINITY_DLL_SPEC WaypointMovementGenerator + : public MovementGeneratorMedium< T, WaypointMovementGenerator >, public PathMovementBase { - TimeTrackerSmall i_nextMoveTime; - std::vector i_hasDone; - public: - WaypointMovementGenerator(Creature &) : i_nextMoveTime(0) {} - ~WaypointMovementGenerator() { ClearWaypoints(); } - void Initialize(Creature &u) - { - i_nextMoveTime.Reset(0); // TODO: check the lower bound (0 is probably too small) - u.StopMoving(); - LoadPath(u); - } - void Finalize(Creature &) {} - void Reset(Creature &u) { ReloadPath(u); } - bool Update(Creature &u, const uint32 &diff); - - void MovementInform(Creature &); - - MovementGeneratorType GetMovementGeneratorType() { return WAYPOINT_MOTION_TYPE; } - - // now path movement implmementation - void LoadPath(Creature &c); - void ReloadPath(Creature &c) { ClearWaypoints(); LoadPath(c); } - - // Player stoping creature - bool IsStopedByPlayer() { return b_StopedByPlayer; } - void SetStopedByPlayer(bool val) { b_StopedByPlayer = val; } - - // statics - static void Initialize(void); - - bool GetDestination(float& x, float& y, float& z) const { i_destinationHolder.GetDestination(x,y,z); return true; } - private: - void ClearWaypoints(); - bool b_StopedByPlayer; + public: + WaypointMovementGenerator(uint32 _path_id = 0, bool _repeating = true) : + i_nextMoveTime(0), path_id(_path_id), repeating(_repeating), StopedByPlayer(false){} + + void Initialize(T &); + void Finalize(T &); + void MovementInform(T &); + void InitTraveller(T &, const WaypointData &); + void GeneratePathId(T &); + void Reset(T &unit); + bool Update(T &, const uint32 &); + bool GetDestination(float &x, float &y, float &z) const{if(i_destinationHolder.HasArrived())return false; i_destinationHolder.GetDestination(x, y, z); return true;} + MovementGeneratorType GetMovementGeneratorType() { return WAYPOINT_MOTION_TYPE; } + + private: + WaypointData node; + uint32 i_currentNode, path_id; + TimeTrackerSmall i_nextMoveTime; + WaypointPath *waypoints; + bool repeating, custom_path, ExecuteScript, StopedByPlayer; }; /** FlightPathMovementGenerator generates movement of the player for the paths @@ -135,6 +112,7 @@ public PathMovementBase inline bool HasArrived() const { return (i_currentNode >= i_path.Size()); } void SetCurrentNodeAfterTeleport(); void SkipCurrentNode() { ++i_currentNode; } - bool GetDestination(float& x, float& y, float& z) const { i_destinationHolder.GetDestination(x,y,z); return true; } + bool GetDestination(float& x, float& y, float& z) const { i_destinationHolder.GetDestination(x,y,z); return true; } + }; #endif -- cgit v1.2.3 From c2b217a1c1d4b3153fdf796141719415a39b9df6 Mon Sep 17 00:00:00 2001 From: megamage Date: Tue, 9 Dec 2008 23:17:02 -0600 Subject: *Fix a typo in my previous commit. --HG-- branch : trunk --- src/game/SpellMgr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index b8cf06ea5e8..3ebd9a4d1ac 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -1834,9 +1834,9 @@ void SpellMgr::LoadSpellCustomAttr() if(!tempSpell) continue; - for(uint32 i = 0; i < 3; ++i) + for(uint32 j = 0; j < 3; ++j) { - switch(tempSpell->EffectApplyAuraName[i]) + switch(tempSpell->EffectApplyAuraName[j]) { case SPELL_AURA_PERIODIC_DAMAGE: case SPELL_AURA_PERIODIC_DAMAGE_PERCENT: -- cgit v1.2.3 From 9be484f8c89d5e388fcba4b7b099131092c2ce40 Mon Sep 17 00:00:00 2001 From: MeanMachine Date: Wed, 10 Dec 2008 07:41:01 +0200 Subject: Small structural change to fix an error on some compilers. --HG-- branch : trunk --- src/game/WaypointMovementGenerator.cpp | 12 ++++++++++++ src/game/WaypointMovementGenerator.h | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/game/WaypointMovementGenerator.cpp b/src/game/WaypointMovementGenerator.cpp index 84f121eb9b3..47119aa007c 100644 --- a/src/game/WaypointMovementGenerator.cpp +++ b/src/game/WaypointMovementGenerator.cpp @@ -66,6 +66,18 @@ void WaypointMovementGenerator::MovementInform(Creature &unit) unit.AI()->MovementInform(WAYPOINT_MOTION_TYPE, i_currentNode); } +template +bool WaypointMovementGenerator::GetDestination(float &x, float &y, float &z) const +{ + if(i_destinationHolder.HasArrived()) + return false; + + i_destinationHolder.GetDestination(x, y, z); + return true; +} +template bool WaypointMovementGenerator::GetDestination(float &x, float &y, float &z) const; +template bool WaypointMovementGenerator::GetDestination(float &x, float &y, float &z) const; + template<> void WaypointMovementGenerator::Reset(Creature &unit){} diff --git a/src/game/WaypointMovementGenerator.h b/src/game/WaypointMovementGenerator.h index 78752c771f0..5995188ac8d 100644 --- a/src/game/WaypointMovementGenerator.h +++ b/src/game/WaypointMovementGenerator.h @@ -76,7 +76,7 @@ class TRINITY_DLL_SPEC WaypointMovementGenerator void GeneratePathId(T &); void Reset(T &unit); bool Update(T &, const uint32 &); - bool GetDestination(float &x, float &y, float &z) const{if(i_destinationHolder.HasArrived())return false; i_destinationHolder.GetDestination(x, y, z); return true;} + bool GetDestination(float &x, float &y, float &z) const; MovementGeneratorType GetMovementGeneratorType() { return WAYPOINT_MOTION_TYPE; } private: -- cgit v1.2.3 From ac822bb616645f75b0fee1572e83fd4ca30b9c71 Mon Sep 17 00:00:00 2001 From: megamage Date: Wed, 10 Dec 2008 11:19:50 -0600 Subject: *Use another way to kill magnet totem. --HG-- branch : trunk --- src/game/SharedDefines.h | 1 + src/game/Spell.cpp | 33 ++++++++++++++++++--------------- src/game/Spell.h | 1 - 3 files changed, 19 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index 0d40b4c50dc..3f04e510b20 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -908,6 +908,7 @@ enum SpellMissInfo SPELL_MISS_DEFLECT = 9, SPELL_MISS_ABSORB = 10, SPELL_MISS_REFLECT = 11, + SPELL_MISS_KILL = 12, // kill grounding totem }; enum SpellHitType diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 199e6386b32..916bc984883 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -286,8 +286,6 @@ Spell::Spell( Unit* Caster, SpellEntry const *info, bool triggered, uint64 origi m_caster = Caster; m_selfContainer = NULL; m_triggeringContainer = triggeringContainer; - m_magnetPair.first = false; - m_magnetPair.second = NULL; m_referencedFromCurrentSpell = false; m_executedCurrently = false; m_delayAtDamageCount = 0; @@ -1037,6 +1035,12 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target) if (target->reflectResult == SPELL_MISS_NONE) // If reflected spell hit caster -> do all effect on him DoSpellHitOnUnit(m_caster, mask); } + else if (missInfo == SPELL_MISS_KILL) + { + // remove spell_magnet aura after first spell redirect and destroy target if its totem + if(unit->GetTypeId() == TYPEID_UNIT && ((Creature*)unit)->isTotem()) + unit->Kill(unit); + } else //TODO: This is a hack. need fix { uint32 tempMask = 0; @@ -1169,14 +1173,6 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask) if(!unit || !effectMask) return; - // remove spell_magnet aura after first spell redirect and destroy target if its totem - if(m_magnetPair.first && m_magnetPair.second && m_magnetPair.second == unit) - { - if(unit->GetTypeId() == TYPEID_UNIT && ((Creature*)unit)->isTotem()) - unit->DealDamage(unit,unit->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - return; - } - // Recheck immune (only for delayed spells) if( m_spellInfo->speed && !(m_spellInfo->Attributes & SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY) @@ -5310,7 +5306,7 @@ CurrentSpellTypes Spell::GetCurrentContainer() bool Spell::CheckTarget( Unit* target, uint32 eff, bool hitPhase ) { // Check targets for creature type mask and remove not appropriate (skip explicit self target case, maybe need other explicit targets) - if(m_spellInfo->EffectImplicitTargetA[eff]!=TARGET_SELF && !m_magnetPair.first) + if(m_spellInfo->EffectImplicitTargetA[eff]!=TARGET_SELF) { if (!CheckTargetCreatureType(target)) return false; @@ -5391,14 +5387,21 @@ Unit* Spell::SelectMagnetTarget() { if(Unit* magnet = (*itr)->GetCaster()) { - if((*itr)->m_procCharges>0 && magnet->IsWithinLOSInMap(m_caster)) + if((*itr)->m_procCharges>0) { (*itr)->SetAuraProcCharges((*itr)->m_procCharges-1); - m_magnetPair.first = true; - m_magnetPair.second = magnet; - target = magnet; m_targets.setUnitTarget(target); + AddUnitTarget(target, 0); + uint64 targetGUID = target->GetGUID(); + for(std::list::iterator ihit= m_UniqueTargetInfo.begin();ihit != m_UniqueTargetInfo.end();++ihit) + { + if (targetGUID == ihit->targetGUID) // Found in list + { + (*ihit).missCondition = SPELL_MISS_KILL; + break; + } + } break; } } diff --git a/src/game/Spell.h b/src/game/Spell.h index 1bdb7154177..79cfe0a2a62 100644 --- a/src/game/Spell.h +++ b/src/game/Spell.h @@ -364,7 +364,6 @@ class Spell void SetTargetMap(uint32 i,uint32 cur,std::list &TagUnitMap); Unit* SelectMagnetTarget(); - std::pair m_magnetPair; bool CheckTarget( Unit* target, uint32 eff, bool hitPhase ); void SendCastResult(uint8 result); -- cgit v1.2.3 From bcb39b263d65a52c7b21f372d92668a0504f8475 Mon Sep 17 00:00:00 2001 From: megamage Date: Wed, 10 Dec 2008 15:14:49 -0600 Subject: *Allow pets to cast devour magic on both friends and enemies. --HG-- branch : trunk --- src/game/SharedDefines.h | 8 ++++---- src/game/Spell.cpp | 51 +++++++++++++++++++++++++++++------------------- src/game/Spell.h | 2 ++ src/game/Unit.cpp | 22 ++++++++++++++++++++- src/game/Unit.h | 4 +++- 5 files changed, 61 insertions(+), 26 deletions(-) (limited to 'src') diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index 3f04e510b20..3edc724b7a8 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -788,7 +788,7 @@ enum Targets TARGET_PET = 5, //TARGET_UNIT_PET TARGET_CHAIN_DAMAGE = 6, - //TARGET_UNIT_TARGET_ENEMY + TARGET_UNIT_TARGET_ENEMY = 6, TARGET_UNIT_AREA_ENTRY = 7, TARGET_AREAEFFECT_CUSTOM = 8, //TARGET_UNIT_AREA_ENTRY_GROUND @@ -806,7 +806,7 @@ enum Targets TARGET_ALL_PARTY_AROUND_CASTER = 20, //TARGET_UNIT_PARTY_CASTER TARGET_SINGLE_FRIEND = 21, - //TARGET_UNIT_TARGET_ALLY + TARGET_UNIT_TARGET_ALLY = 21, TARGET_ALL_AROUND_CASTER = 22, // used only in TargetA, target selection dependent from TargetB //TARGET_DEST_CASTER TARGET_GAMEOBJECT = 23, @@ -833,7 +833,7 @@ enum Targets TARGET_ALL_PARTY_AROUND_CASTER_2 = 34, // used in Tranquility //TARGET_UNIT_AREA_PARTY_GROUND TARGET_SINGLE_PARTY = 35, - //TARGET_UNIT_TARGET_PARTY + TARGET_UNIT_TARGET_PARTY = 35, TARGET_DEST_CASTER_RANDOM_UNKNOWN = 36, //unknown TARGET_AREAEFFECT_PARTY = 37, //TARGET_UNIT_PARTY_TARGET @@ -864,7 +864,7 @@ enum Targets TARGET_RANDOM_RAID_MEMBER = 56, //TARGET_UNIT_AREA_RAID TARGET_SINGLE_FRIEND_2 = 57, - //TARGET_UNIT_TARGET_RAID + TARGET_UNIT_TARGET_RAID = 57, TARGET_UNIT_CONE_ALLY = 59, TARGET_UNIT_AREA_SCRIPT = 60, TARGET_AREAEFFECT_PARTY_AND_CLASS = 61, diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 916bc984883..53009674d9d 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -4496,26 +4496,8 @@ int16 Spell::PetCanCast(Unit* target) if(!_target->isAlive()) return SPELL_FAILED_BAD_TARGETS; - if(IsPositiveSpell(m_spellInfo->Id)) - { - if(m_caster->IsHostileTo(_target)) - return SPELL_FAILED_BAD_TARGETS; - } - else - { - bool duelvsplayertar = false; - for(int j=0;j<3;j++) - { - //TARGET_DUELVSPLAYER is positive AND negative - duelvsplayertar |= (m_spellInfo->EffectImplicitTargetA[j] == TARGET_DUELVSPLAYER); - } - // AoE spells have the caster as their target - // AOE spells should not have target - if(m_caster->IsFriendlyTo(target) /*&& m_caster != target*/ && !duelvsplayertar) - { - return SPELL_FAILED_BAD_TARGETS; - } - } + if(!IsValidSingleTargetSpell(_target)) + return SPELL_FAILED_BAD_TARGETS; } //cooldown if(((Creature*)m_caster)->HasSpellCooldown(m_spellInfo->Id)) @@ -5553,3 +5535,32 @@ bool SpellEvent::IsDeletable() const { return m_Spell->IsDeletable(); } + +bool Spell::IsValidSingleTargetEffect(Unit const* target, Targets type) const +{ + switch(type) + { + case TARGET_UNIT_TARGET_ENEMY: + return !m_caster->IsFriendlyTo(target); + case TARGET_UNIT_TARGET_ALLY: + return m_caster->IsFriendlyTo(target); + case TARGET_UNIT_TARGET_PARTY: + return m_caster->IsInPartyWith(target); + case TARGET_UNIT_TARGET_RAID: + return m_caster->IsInRaidWith(target); + } + return true; +} + +bool Spell::IsValidSingleTargetSpell(Unit const* target) const +{ + for(int i = 0; i < 3; ++i) + { + if(!IsValidSingleTargetEffect(target, Targets(m_spellInfo->EffectImplicitTargetA[i]))) + return false; + // Need to check B? + //if(!IsValidSingleTargetEffect(m_spellInfo->EffectImplicitTargetB[i], target) + // return false; + } + return true; +} \ No newline at end of file diff --git a/src/game/Spell.h b/src/game/Spell.h index 79cfe0a2a62..3d9494f8a36 100644 --- a/src/game/Spell.h +++ b/src/game/Spell.h @@ -537,6 +537,8 @@ class Spell SpellTargets TargetType, uint32 entry = 0); Unit* SearchNearbyTarget(float radius, SpellTargets TargetType, uint32 entry = 0); void SearchChainTarget(std::list &data, Unit* pUnitTarget, float max_range, uint32 unMaxTargets); + bool IsValidSingleTargetEffect(Unit const* target, Targets type) const; + bool IsValidSingleTargetSpell(Unit const* target) const; // ------------------------------------------- //List For Triggered Spells diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 51fb5262855..ec3f687f0e6 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -8303,7 +8303,7 @@ Unit *Unit::GetCharmer() const return NULL; } -Player* Unit::GetCharmerOrOwnerPlayerOrPlayerItself() +Player* Unit::GetCharmerOrOwnerPlayerOrPlayerItself() const { uint64 guid = GetCharmerOrOwnerGUID(); if(IS_PLAYER_GUID(guid)) @@ -12834,4 +12834,24 @@ void Unit::SetConfused(bool apply) if(GetTypeId() == TYPEID_PLAYER) ((Player*)this)->SetClientControl(this, !apply); +} + +bool Unit::IsInPartyWith(Unit const *unit) const +{ + const Player *p1 = GetCharmerOrOwnerPlayerOrPlayerItself(); + const Player *p2 = unit->GetCharmerOrOwnerPlayerOrPlayerItself(); + if(p1 && p2) + return p1->IsInSameGroupWith(p2); + else + return false; +} + +bool Unit::IsInRaidWith(Unit const *unit) const +{ + const Player *p1 = GetCharmerOrOwnerPlayerOrPlayerItself(); + const Player *p2 = unit->GetCharmerOrOwnerPlayerOrPlayerItself(); + if(p1 && p2) + return p1->IsInSameRaidWith(p2); + else + return false; } \ No newline at end of file diff --git a/src/game/Unit.h b/src/game/Unit.h index 9113ed7bae0..258c4f0ffd7 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -871,6 +871,8 @@ class TRINITY_DLL_SPEC Unit : public WorldObject bool IsHostileToPlayers() const; bool IsFriendlyTo(Unit const* unit) const; bool IsNeutralToAll() const; + bool IsInPartyWith(Unit const* unit) const; + bool IsInRaidWith(Unit const* unit) const; bool IsContestedGuard() const { if(FactionTemplateEntry const* entry = getFactionTemplateEntry()) @@ -1055,7 +1057,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject return this; } - Player* GetCharmerOrOwnerPlayerOrPlayerItself(); + Player* GetCharmerOrOwnerPlayerOrPlayerItself() const; void SetPet(Pet* pet); void SetCharm(Unit* pet); -- cgit v1.2.3 From 22c7db127886c9c24c7eef0ce1640c323b01ef35 Mon Sep 17 00:00:00 2001 From: megamage Date: Wed, 10 Dec 2008 15:54:54 -0600 Subject: *Fix a bug that makes creatures stunned/rooted forever. --HG-- branch : trunk --- src/game/Unit.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index ec3f687f0e6..81e6fa521b0 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -12678,13 +12678,13 @@ void Unit::SetControlled(bool apply, UnitState state) switch(state) { case UNIT_STAT_STUNNED: if(HasAuraType(SPELL_AURA_MOD_STUN)) return; - else(SetStunned(false)); + else SetStunned(false); break; case UNIT_STAT_ROOT: if(HasAuraType(SPELL_AURA_MOD_ROOT)) return; - else(SetRooted(false)); + else SetRooted(false); break; case UNIT_STAT_CONFUSED:if(HasAuraType(SPELL_AURA_MOD_CONFUSE)) return; - else(SetConfused(false)); + else SetConfused(false); break; case UNIT_STAT_FLEEING: if(HasAuraType(SPELL_AURA_MOD_FEAR)) return; - else(SetFeared(false)); + else SetFeared(false); break; default: return; } -- cgit v1.2.3 From 0029017e17b9a2fded77e1680cef9dbc3aebacff Mon Sep 17 00:00:00 2001 From: "shadowu@mail.bg" Date: Thu, 11 Dec 2008 02:47:15 +0200 Subject: WaypointMovementGenerator - linux compile fix --HG-- branch : trunk --- src/game/WaypointMovementGenerator.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/game/WaypointMovementGenerator.cpp b/src/game/WaypointMovementGenerator.cpp index 47119aa007c..576c1f0d26e 100644 --- a/src/game/WaypointMovementGenerator.cpp +++ b/src/game/WaypointMovementGenerator.cpp @@ -66,8 +66,8 @@ void WaypointMovementGenerator::MovementInform(Creature &unit) unit.AI()->MovementInform(WAYPOINT_MOTION_TYPE, i_currentNode); } -template -bool WaypointMovementGenerator::GetDestination(float &x, float &y, float &z) const +template<> +bool WaypointMovementGenerator::GetDestination(float &x, float &y, float &z) const { if(i_destinationHolder.HasArrived()) return false; @@ -75,8 +75,9 @@ bool WaypointMovementGenerator::GetDestination(float &x, float &y, float &z) i_destinationHolder.GetDestination(x, y, z); return true; } -template bool WaypointMovementGenerator::GetDestination(float &x, float &y, float &z) const; -template bool WaypointMovementGenerator::GetDestination(float &x, float &y, float &z) const; + +template<> +bool WaypointMovementGenerator::GetDestination(float &x, float &y, float &z) const {} template<> void WaypointMovementGenerator::Reset(Creature &unit){} -- cgit v1.2.3 From 39083f4ff837d23cc886338fc9bc74df90fe9613 Mon Sep 17 00:00:00 2001 From: megamage Date: Wed, 10 Dec 2008 20:25:47 -0600 Subject: *Add function SummonTrigger and allow to override its AI. *Remove some trigger scripts. Use default trigger AI and db data instead. *Small fix on eagle boss' electrical storm. --HG-- branch : trunk --- sql/updates/455_world.sql | 14 ++++ sql/updates/full/world_script.sql | 1 - src/bindings/scripts/include/sc_creature.cpp | 4 +- src/bindings/scripts/include/sc_creature.h | 8 +-- .../scripts/zone/black_temple/boss_illidan.cpp | 83 ++-------------------- .../blood_furnace/boss_broggok.cpp | 38 ---------- .../scripts/scripts/zone/zulaman/boss_akilzon.cpp | 12 ++-- .../scripts/scripts/zone/zulaman/boss_janalai.cpp | 13 ++-- .../scripts/scripts/zone/zulaman/boss_zuljin.cpp | 34 +-------- src/game/Creature.cpp | 8 +-- src/game/Creature.h | 3 +- src/game/GameObject.cpp | 2 +- src/game/Object.cpp | 19 +++++ src/game/Object.h | 2 + src/game/SpellAuras.cpp | 7 ++ src/game/Unit.h | 2 + 16 files changed, 73 insertions(+), 177 deletions(-) create mode 100644 sql/updates/455_world.sql (limited to 'src') diff --git a/sql/updates/455_world.sql b/sql/updates/455_world.sql new file mode 100644 index 00000000000..74c52f164b0 --- /dev/null +++ b/sql/updates/455_world.sql @@ -0,0 +1,14 @@ +-- demon fire +update creature_template set spell1 = 40029, flags_extra = 128, scriptname = '' where entry = 23069; +-- pillar of fire +update creature_template set spell1 = 43218, flags_extra = 128, scriptname = '' where entry = 24187; +-- Broggok Poison Cloud +update creature_template set spell1 = 30914, flags_extra = 128, scriptname = '' where entry = 17662; + + +INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (43468, 44007, 1, 'Storm Eye Safe Zone'); +INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (43658, 43653, 0, 'Electrical Arc Visual'); +INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (43658, 43654, 0, 'Electrical Arc Visual'); +INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (43658, 43655, 0, 'Electrical Arc Visual'); +INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (43658, 43656, 0, 'Electrical Arc Visual'); +INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (43658, 43659, 0, 'Electrical Arc Visual'); \ No newline at end of file diff --git a/sql/updates/full/world_script.sql b/sql/updates/full/world_script.sql index e1bd272425a..278ed085a65 100644 --- a/sql/updates/full/world_script.sql +++ b/sql/updates/full/world_script.sql @@ -19,7 +19,6 @@ UPDATE `creature_template` SET `ScriptName` = 'boss_fenstalker' WHERE `entry` =2 UPDATE `creature_template` SET `ScriptName` = 'boss_darkheart' WHERE `entry` =24246; UPDATE `creature_template` SET `ScriptName` = 'boss_koragg' WHERE `entry` =24247; UPDATE `creature_template` SET `ScriptName` = 'boss_zuljin' WHERE `entry` =23863; -UPDATE `creature_template` SET `ScriptName` = 'do_nothing' WHERE `entry` = '24187'; UPDATE `creature_template` SET `ScriptName` = 'mob_zuljin_vortex' WHERE `entry` = '24136'; UPDATE `creature_template` SET `ScriptName` = 'npc_zulaman_hostage' WHERE `entry` IN (23790, 23999, 24024, 24001); diff --git a/src/bindings/scripts/include/sc_creature.cpp b/src/bindings/scripts/include/sc_creature.cpp index a3c185391cc..e3bcc2129cc 100644 --- a/src/bindings/scripts/include/sc_creature.cpp +++ b/src/bindings/scripts/include/sc_creature.cpp @@ -220,10 +220,10 @@ void ScriptedAI::DoStopAttack() void ScriptedAI::DoCast(Unit* victim, uint32 spellId, bool triggered) { - if (!victim || m_creature->IsNonMeleeSpellCasted(false)) + if (!victim || m_creature->hasUnitState(UNIT_STAT_CASTING)) return; - m_creature->StopMoving(); + //m_creature->StopMoving(); m_creature->CastSpell(victim, spellId, triggered); } diff --git a/src/bindings/scripts/include/sc_creature.h b/src/bindings/scripts/include/sc_creature.h index 01f5df473c1..c0c09d70e34 100644 --- a/src/bindings/scripts/include/sc_creature.h +++ b/src/bindings/scripts/include/sc_creature.h @@ -183,13 +183,13 @@ struct TRINITY_DLL_DECL Scripted_NoMovementAI : public ScriptedAI void AttackStart(Unit *); }; -struct TRINITY_DLL_DECL NullCreatureAI : public CreatureAI +struct TRINITY_DLL_DECL NullCreatureAI : public ScriptedAI { - NullCreatureAI(Creature* c) : m_creature(c) {} + NullCreatureAI(Creature* c) : ScriptedAI(c) {} ~NullCreatureAI() {} - Creature *m_creature; - + void Reset() {} + void Aggro(Unit*) {} void MoveInLineOfSight(Unit *) {} void AttackStart(Unit *) {} void EnterEvadeMode() {} 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 272bd0bd2b0..46a05fcf0cc 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp @@ -1780,73 +1780,9 @@ struct TRINITY_DLL_DECL mob_parasitic_shadowfiendAI : public ScriptedAI } }; -struct TRINITY_DLL_DECL demonfireAI : public ScriptedAI +struct TRINITY_DLL_DECL blade_of_azzinothAI : public NullCreatureAI { - demonfireAI(Creature *c) : ScriptedAI(c) - { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); - Reset(); - } - - ScriptedInstance* pInstance; - uint64 IllidanGUID; - bool IsTrigger; - bool DemonFire; - uint32 CheckTimer; - uint32 DespawnTimer; - - void Reset() - { - if(pInstance) - IllidanGUID = pInstance->GetData64(DATA_ILLIDANSTORMRAGE); - else - IllidanGUID = 0; - - IsTrigger = false; - DemonFire = false; - - CheckTimer = 5000; - DespawnTimer = 78000; //spell duration, core bug, cannot despawn self - } - - void Aggro(Unit *who) {} - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit *who){} - - void UpdateAI(const uint32 diff) - { - if(IsTrigger) - return; - - if(!DemonFire) - DoCast(m_creature, SPELL_DEMON_FIRE); //duration 60s - - if(CheckTimer < diff) - { - GETUNIT(Illidan, IllidanGUID); - if(!Illidan || !Illidan->HasUnitMovementFlag(MOVEMENTFLAG_LEVITATING)) - { - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->setDeathState(JUST_DIED); - return; - }else CheckTimer = 5000; - }else CheckTimer -= diff; - - if(DespawnTimer < diff) - { - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->setDeathState(JUST_DIED); - }else DespawnTimer -= diff; - } -}; - -struct TRINITY_DLL_DECL blade_of_azzinothAI : public ScriptedAI -{ - blade_of_azzinothAI(Creature* c) : ScriptedAI(c) {} - void Reset() {} - void Aggro(Unit *who) {} - void AttackStart(Unit* who) { } - void MoveInLineOfSight(Unit* who) { } + blade_of_azzinothAI(Creature* c) : NullCreatureAI(c) {} void SpellHit(Unit *caster, const SpellEntry *spell) { @@ -2060,15 +1996,14 @@ void boss_illidan_stormrageAI::CastEyeBlast() final.x = 2 * final.x - initial.x; final.y = 2 * final.y - initial.y; - Creature* Trigger = m_creature->SummonCreature(DEMON_FIRE, initial.x, initial.y, initial.z, 0, TEMPSUMMON_TIMED_DESPAWN, 13000); + Creature* Trigger = m_creature->SummonTrigger(initial.x, initial.y, initial.z, 0, 13000); if(!Trigger) return; - ((demonfireAI*)Trigger->AI())->IsTrigger = true; Trigger->SetSpeed(MOVE_WALK, 3); Trigger->SetUnitMovementFlags(MOVEMENTFLAG_WALK_MODE); Trigger->GetMotionMaster()->MovePoint(0, final.x, final.y, final.z); - Trigger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + //Trigger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); m_creature->SetUInt64Value(UNIT_FIELD_TARGET, Trigger->GetGUID()); DoCast(Trigger, SPELL_EYE_BLAST); } @@ -2225,11 +2160,6 @@ CreatureAI* GetAI_shadow_demon(Creature *_Creature) return new shadow_demonAI (_Creature); } -CreatureAI* GetAI_demonfire(Creature *_Creature) -{ - return new demonfireAI (_Creature); -} - CreatureAI* GetAI_blade_of_azzinoth(Creature *_Creature) { return new blade_of_azzinothAI (_Creature); @@ -2286,11 +2216,6 @@ void AddSC_boss_illidan() newscript->GetAI = GetAI_shadow_demon; newscript->RegisterSelf(); - newscript = new Script; - newscript->Name="mob_demon_fire"; - newscript->GetAI = GetAI_demonfire; - newscript->RegisterSelf(); - newscript = new Script; newscript->Name = "mob_parasitic_shadowfiend"; newscript->GetAI = GetAI_parasitic_shadowfiend; diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_broggok.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_broggok.cpp index 1431be7dd51..e8797184fbc 100644 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_broggok.cpp +++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_broggok.cpp @@ -79,44 +79,11 @@ struct TRINITY_DLL_DECL boss_broggokAI : public ScriptedAI } }; -struct TRINITY_DLL_DECL mob_broggok_poisoncloudAI : public ScriptedAI -{ - mob_broggok_poisoncloudAI(Creature *c) : ScriptedAI(c) {Reset();} - - bool Start; - - void Reset() - { - Start = false; - } - - void Aggro(Unit* who) - { - } - - void UpdateAI(const uint32 diff) - { - if(!Start) - { - m_creature->SetUInt32Value(UNIT_NPC_FLAGS,0); - m_creature->setFaction(45); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - Start = true; - DoCast(m_creature,SPELL_POISON); - } - } -}; - CreatureAI* GetAI_boss_broggokAI(Creature *_Creature) { return new boss_broggokAI (_Creature); } -CreatureAI* GetAI_mob_broggok_poisoncloudAI(Creature *_Creature) -{ - return new mob_broggok_poisoncloudAI (_Creature); -} - void AddSC_boss_broggok() { Script *newscript; @@ -124,9 +91,4 @@ void AddSC_boss_broggok() newscript->Name="boss_broggok"; newscript->GetAI = GetAI_boss_broggokAI; newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_broggok_poisoncloud"; - newscript->GetAI = GetAI_mob_broggok_poisoncloudAI; - newscript->RegisterSelf(); } diff --git a/src/bindings/scripts/scripts/zone/zulaman/boss_akilzon.cpp b/src/bindings/scripts/scripts/zone/zulaman/boss_akilzon.cpp index 8f4b4b8d942..0833cf0dfec 100644 --- a/src/bindings/scripts/scripts/zone/zulaman/boss_akilzon.cpp +++ b/src/bindings/scripts/scripts/zone/zulaman/boss_akilzon.cpp @@ -25,7 +25,6 @@ EndScriptData */ #include "precompiled.h" #include "def_zulaman.h" -#include "Spell.h" #include "Weather.h" #define SPELL_STATIC_DISRUPTION 43622 @@ -34,6 +33,7 @@ EndScriptData */ #define SPELL_GUST_OF_WIND 43621 #define SPELL_ELECTRICAL_STORM 43648 #define SPELL_BERSERK 45078 +#define SPELL_ELECTRICAL_DAMAGE 43657 #define SPELL_ELECTRICAL_OVERLOAD 43658 #define SPELL_EAGLE_SWOOP 44732 @@ -57,15 +57,13 @@ EndScriptData */ #define SE_LOC_Y_MAX 1435 #define SE_LOC_Y_MIN 1370 -#define MOB_TEMP_TRIGGER 23920 - struct TRINITY_DLL_DECL boss_akilzonAI : public ScriptedAI { boss_akilzonAI(Creature *c) : ScriptedAI(c) { - SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_ELECTRICAL_STORM); + SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_ELECTRICAL_DAMAGE); if(TempSpell) - TempSpell->Effect[1] = 0;//disable bugged lightning until fixed in core + TempSpell->EffectBasePoints[1] = 49;//disable bugged lightning until fixed in core pInstance = ((ScriptedInstance*)c->GetInstanceData()); Reset(); } @@ -214,7 +212,7 @@ struct TRINITY_DLL_DECL boss_akilzonAI : public ScriptedAI { x = 343+rand()%60; y = 1380+rand()%60; - if(Unit *trigger = m_creature->SummonCreature(MOB_TEMP_TRIGGER, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN, 2000)) + if(Unit *trigger = m_creature->SummonTrigger(x, y, z, 0, 2000)) { trigger->setFaction(35); trigger->SetMaxHealth(100000); @@ -315,7 +313,7 @@ struct TRINITY_DLL_DECL boss_akilzonAI : public ScriptedAI target->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); target->SendMonsterMove(x,y,m_creature->GetPositionZ()+15,0,0,0); } - Unit *Cloud = m_creature->SummonCreature(MOB_TEMP_TRIGGER, x, y, m_creature->GetPositionZ()+16, 0, TEMPSUMMON_TIMED_DESPAWN, 15000); + Unit *Cloud = m_creature->SummonTrigger(x, y, m_creature->GetPositionZ()+16, 0, 15000); if(Cloud) { CloudGUID = Cloud->GetGUID(); diff --git a/src/bindings/scripts/scripts/zone/zulaman/boss_janalai.cpp b/src/bindings/scripts/scripts/zone/zulaman/boss_janalai.cpp index cc176127282..7b0feb4e265 100644 --- a/src/bindings/scripts/scripts/zone/zulaman/boss_janalai.cpp +++ b/src/bindings/scripts/scripts/zone/zulaman/boss_janalai.cpp @@ -226,9 +226,9 @@ struct TRINITY_DLL_DECL boss_janalaiAI : public ScriptedAI for(uint8 j = 0; j < WallNum; j++) { if(WallNum == 3) - wall = m_creature->SummonCreature(MOB_FIRE_BOMB, FireWallCoords[i][0],FireWallCoords[i][1]+5*(j-1),FireWallCoords[i][2],FireWallCoords[i][3],TEMPSUMMON_TIMED_DESPAWN,15000); + wall = m_creature->SummonTrigger(FireWallCoords[i][0],FireWallCoords[i][1]+5*(j-1),FireWallCoords[i][2],FireWallCoords[i][3],15000); else - wall = m_creature->SummonCreature(MOB_FIRE_BOMB, FireWallCoords[i][0]-2+4*j,FireWallCoords[i][1],FireWallCoords[i][2],FireWallCoords[i][3],TEMPSUMMON_TIMED_DESPAWN,15000); + wall = m_creature->SummonTrigger(FireWallCoords[i][0]-2+4*j,FireWallCoords[i][1],FireWallCoords[i][2],FireWallCoords[i][3],15000); if(wall) wall->CastSpell(wall, SPELL_FIRE_WALL, true); } } @@ -683,14 +683,9 @@ CreatureAI* GetAI_mob_hatchlingAI(Creature *_Creature) return new mob_hatchlingAI(_Creature); } -struct TRINITY_DLL_DECL mob_eggAI : public ScriptedAI +struct TRINITY_DLL_DECL mob_eggAI : public NullCreatureAI { - mob_eggAI(Creature *c) : ScriptedAI(c){} - void Reset() {} - void Aggro(Unit* who) {} - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) {} + mob_eggAI(Creature *c) : NullCreatureAI(c){} void SpellHit(Unit *caster, const SpellEntry *spell) { diff --git a/src/bindings/scripts/scripts/zone/zulaman/boss_zuljin.cpp b/src/bindings/scripts/scripts/zone/zulaman/boss_zuljin.cpp index 2313af09831..ade7af821f5 100644 --- a/src/bindings/scripts/scripts/zone/zulaman/boss_zuljin.cpp +++ b/src/bindings/scripts/scripts/zone/zulaman/boss_zuljin.cpp @@ -546,23 +546,15 @@ struct TRINITY_DLL_DECL boss_zuljinAI : public ScriptedAI if(Pillar_Of_Fire_Timer < diff) { if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - float x, y, z; - target->GetPosition(x, y, z); - Creature* Pillar = m_creature->SummonCreature(CREATURE_COLUMN_OF_FIRE, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN, 30000); - if(Pillar) - { - Pillar->CastSpell(Pillar, SPELL_PILLAR_TRIGGER, true); - Pillar->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - } + DoCast(target, SPELL_SUMMON_PILLAR); Pillar_Of_Fire_Timer = 10000; }else Pillar_Of_Fire_Timer -= diff; if(Flame_Breath_Timer < diff) { if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - m_creature->CastSpell(m_creature, SPELL_FLAME_BREATH, false); + m_creature->SetInFront(target); + DoCast(m_creature, SPELL_FLAME_BREATH); Flame_Breath_Timer = 10000; }else Flame_Breath_Timer -= diff; break; @@ -581,21 +573,6 @@ CreatureAI* GetAI_boss_zuljin(Creature *_Creature) return new boss_zuljinAI (_Creature); } -struct TRINITY_DLL_DECL do_nothingAI : public ScriptedAI -{ - do_nothingAI(Creature *c) : ScriptedAI(c) {} - void Reset() {} - void Aggro(Unit* who) {} - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) {} -}; - -CreatureAI* GetAI_do_nothing(Creature *_Creature) -{ - return new do_nothingAI (_Creature); -} - struct TRINITY_DLL_DECL feather_vortexAI : public ScriptedAI { feather_vortexAI(Creature *c) : ScriptedAI(c) {} @@ -631,11 +608,6 @@ void AddSC_boss_zuljin() newscript->GetAI = GetAI_boss_zuljin; newscript->RegisterSelf(); - newscript = new Script; - newscript->Name="do_nothing"; - newscript->GetAI = GetAI_do_nothing; - newscript->RegisterSelf(); - newscript = new Script; newscript->Name="mob_zuljin_vortex"; newscript->GetAI = GetAI_feather_vortexAI; diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index 3e2a6e72dfd..3afc23c3ba4 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -347,10 +347,10 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData *data ) m_spells[3] = GetCreatureInfo()->spell4; // HACK: trigger creature is always not selectable - if(GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_TRIGGER) + if(isTrigger()) SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - if(isTotem() || GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_TRIGGER + if(isTotem() || isTrigger() || GetCreatureType() == CREATURE_TYPE_CRITTER) SetReactState(REACT_PASSIVE); else if(isCivilian()) @@ -563,7 +563,7 @@ void Creature::RegenerateHealth() ModifyHealth(addvalue); } -bool Creature::AIM_Initialize() +bool Creature::AIM_Initialize(CreatureAI* ai) { // make sure nothing can change the AI during AI update if(m_AI_locked) @@ -578,7 +578,7 @@ bool Creature::AIM_Initialize() CreatureAI * oldAI = i_AI; i_motionMaster.Initialize(); - i_AI = FactorySelector::selectAI(this); + i_AI = ai ? ai : FactorySelector::selectAI(this); if (oldAI) delete oldAI; return true; diff --git a/src/game/Creature.h b/src/game/Creature.h index 457e88cc3e3..9a76b293266 100644 --- a/src/game/Creature.h +++ b/src/game/Creature.h @@ -426,6 +426,7 @@ class TRINITY_DLL_SPEC Creature : public Unit bool isTotem() const { return m_isTotem; } bool isRacialLeader() const { return GetCreatureInfo()->RacialLeader; } bool isCivilian() const { return GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_CIVILIAN; } + bool isTrigger() const { return GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_TRIGGER; } bool canWalk() const { return GetCreatureInfo()->InhabitType & INHABIT_GROUND; } bool canSwim() const { return GetCreatureInfo()->InhabitType & INHABIT_WATER; } bool canFly() const { return GetCreatureInfo()->InhabitType & INHABIT_AIR; } @@ -462,7 +463,7 @@ class TRINITY_DLL_SPEC Creature : public Unit bool IsInEvadeMode() const; - bool AIM_Initialize(); + bool AIM_Initialize(CreatureAI* ai = NULL); void InitPossessedAI(); void DisablePossessedAI(); diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp index 7008798b806..e43b703d3cb 100644 --- a/src/game/GameObject.cpp +++ b/src/game/GameObject.cpp @@ -1277,7 +1277,7 @@ void GameObject::Use(Unit* user) void GameObject::CastSpell(Unit* target, uint32 spell) { //summon world trigger - Creature *trigger = SummonCreature(12999, GetPositionX(), GetPositionY(), GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 1); + Creature *trigger = SummonTrigger(GetPositionX(), GetPositionY(), GetPositionZ(), 0, 1); if(!trigger) return; trigger->SetVisibility(VISIBILITY_OFF); //should this be true? diff --git a/src/game/Object.cpp b/src/game/Object.cpp index 35a021ac7c7..2872f29cdaf 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -1534,6 +1534,25 @@ GameObject* WorldObject::SummonGameObject(uint32 entry, float x, float y, float return go; } +Creature* WorldObject::SummonTrigger(float x, float y, float z, float ang, uint32 duration, CreatureAI* (*GetAI)(Creature*)) +{ + TempSummonType summonType = (duration == 0) ? TEMPSUMMON_DEAD_DESPAWN : TEMPSUMMON_TIMED_DESPAWN; + Creature* summon = SummonCreature(WORLD_TRIGGER, x, y, z, ang, summonType, 0); + if(!summon) + return NULL; + + //summon->SetName(GetName()); + if(GetTypeId()==TYPEID_PLAYER || GetTypeId()==TYPEID_UNIT) + { + summon->setFaction(((Unit*)this)->getFaction()); + summon->SetLevel(((Unit*)this)->getLevel()); + } + + if(GetAI) + summon->AIM_Initialize(GetAI(summon)); + return summon; +} + void WorldObject::GetNearPoint2D(float &x, float &y, float distance2d, float absAngle ) const { x = GetPositionX() + (GetObjectSize() + distance2d) * cos(absAngle); diff --git a/src/game/Object.h b/src/game/Object.h index 2fcd6692288..a63458e6133 100644 --- a/src/game/Object.h +++ b/src/game/Object.h @@ -28,6 +28,7 @@ #include "GameSystem/GridReference.h" #include "ObjectDefines.h" #include "GridDefines.h" +#include "CreatureAI.h" #include #include @@ -457,6 +458,7 @@ class TRINITY_DLL_SPEC WorldObject : public Object Map const* GetBaseMap() const; Creature* SummonCreature(uint32 id, float x, float y, float z, float ang,TempSummonType spwtype,uint32 despwtime); GameObject* SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime); + Creature* SummonTrigger(float x, float y, float z, float ang, uint32 dur, CreatureAI* (*GetAI)(Creature*) = NULL); bool isActive() const { return m_isActive; } void setActive(bool isActive); protected: diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index cca1b80a53c..9f8323c735c 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -2079,6 +2079,13 @@ void Aura::HandleAuraDummy(bool apply, bool Real) } return; } + + // electrical storm safe zone + if (GetId() == 44007) + { + m_target->ApplySpellImmune(44007, IMMUNITY_ID, 43657, apply); + return; + } break; } case SPELLFAMILY_MAGE: diff --git a/src/game/Unit.h b/src/game/Unit.h index 258c4f0ffd7..8f06d09029f 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -37,6 +37,8 @@ #include "Database/DBCStructure.h" #include +#define WORLD_TRIGGER 12999 + enum SpellInterruptFlags { SPELL_INTERRUPT_FLAG_MOVEMENT = 0x01, // why need this for instant? -- cgit v1.2.3 From 66de4c5358ccb868d18e64418bfd156999a173bf Mon Sep 17 00:00:00 2001 From: "shadowu@mail.bg" Date: Thu, 11 Dec 2008 05:50:31 +0200 Subject: *Waypoint Movement Generator - fixed typo --HG-- branch : trunk --- src/game/WaypointMovementGenerator.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/game/WaypointMovementGenerator.cpp b/src/game/WaypointMovementGenerator.cpp index 576c1f0d26e..e1ce805aa0b 100644 --- a/src/game/WaypointMovementGenerator.cpp +++ b/src/game/WaypointMovementGenerator.cpp @@ -77,7 +77,10 @@ bool WaypointMovementGenerator::GetDestination(float &x, float &y, flo } template<> -bool WaypointMovementGenerator::GetDestination(float &x, float &y, float &z) const {} +bool WaypointMovementGenerator::GetDestination(float &x, float &y, float &z) const +{ + return false; +} template<> void WaypointMovementGenerator::Reset(Creature &unit){} -- cgit v1.2.3 From 415cccfed98df0b9b1c088ae95c579a125514c37 Mon Sep 17 00:00:00 2001 From: megamage Date: Thu, 11 Dec 2008 11:37:58 -0600 Subject: *First step of dynamic cell visit. Hope nothing is broken. --HG-- branch : trunk --- src/game/Cell.h | 1 + src/game/CellImpl.h | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ src/game/GridDefines.h | 12 ++++++++++++ src/game/Spell.cpp | 7 ++++--- 4 files changed, 65 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/game/Cell.h b/src/game/Cell.h index 719bfc3aaa5..35bcdbeea8a 100644 --- a/src/game/Cell.h +++ b/src/game/Cell.h @@ -142,6 +142,7 @@ struct TRINITY_DLL_DECL Cell } data; template void Visit(const CellLock &, TypeContainerVisitor &visitor, Map &) const; + template void Visit(const CellLock &, TypeContainerVisitor &visitor, Map &, float radius, float x_off, float y_off) const; }; template diff --git a/src/game/CellImpl.h b/src/game/CellImpl.h index ce5f6ed2ece..08182068af9 100644 --- a/src/game/CellImpl.h +++ b/src/game/CellImpl.h @@ -129,4 +129,52 @@ Cell::Visit(const CellLock &l, TypeContainerVisitor &vi } } } + +template +inline void +Cell::Visit(const CellLock &l, TypeContainerVisitor &visitor, Map &m, float radius, float x_off, float y_off) const +{ + const CellPair &standing_cell = l.i_cellPair; + if (standing_cell.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || standing_cell.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP) + return; + + int left = 0, right = 0, upper = 0, lower = 0; + + // Origin = (CENTER_GRID_CELL_OFFSET, CENTER_GRID_CELL_OFFSET) + if(CENTER_GRID_CELL_OFFSET - x_off < radius) + ++right; + if(CENTER_GRID_CELL_OFFSET + x_off < radius) + ++left; + if(CENTER_GRID_CELL_OFFSET - y_off < radius) + ++upper; + if(CENTER_GRID_CELL_OFFSET + y_off < radius) + ++lower; + + if(!left && !right && !upper && !lower) + { + m.Visit(l, visitor); + return; + } + + CellPair begin_cell = standing_cell; + CellPair end_cell = standing_cell; + + begin_cell << left; //note: need change << if left > 1 + begin_cell -= lower; + end_cell >> right; + end_cell += upper; + + // loop the cell range + for(uint32 x = begin_cell.x_coord; x <= end_cell.x_coord; x++) + { + for(uint32 y = begin_cell.y_coord; y <= end_cell.y_coord; y++) + { + CellPair cell_pair(x,y); + Cell r_zone(cell_pair); + r_zone.data.Part.nocreate = l->data.Part.nocreate; + CellLock lock(r_zone, cell_pair); + m.Visit(lock, visitor); + } + } +} #endif diff --git a/src/game/GridDefines.h b/src/game/GridDefines.h index 6001e366212..26168651d8a 100644 --- a/src/game/GridDefines.h +++ b/src/game/GridDefines.h @@ -150,6 +150,18 @@ namespace Trinity return Compute(x, y, CENTER_GRID_CELL_OFFSET, SIZE_OF_GRID_CELL); } + inline CellPair ComputeCellPair(float x, float y, float &x_off, float &y_off) + { + double x_offset = (double(x) - CENTER_GRID_CELL_OFFSET)/SIZE_OF_GRID_CELL; + double y_offset = (double(y) - CENTER_GRID_CELL_OFFSET)/SIZE_OF_GRID_CELL; + + int x_val = int(x_offset + 0.5); + int y_val = int(y_offset + 0.5); + x_off = (float(x_offset) - x_val) * SIZE_OF_GRID_CELL; + y_off = (float(y_offset) - y_val) * SIZE_OF_GRID_CELL; + return CellPair(x_val + CENTER_GRID_CELL_ID, y_val + CENTER_GRID_CELL_ID); + } + inline void NormalizeMapCoord(float &c) { if(c > MAP_HALFSIZE - 0.5) diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 53009674d9d..78809841e3a 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -1470,7 +1470,8 @@ void Spell::SearchAreaTarget(std::list &TagUnitMap, float radius, const u y = m_caster->GetPositionY(); } - CellPair p(Trinity::ComputeCellPair(x, y)); + float x_off, y_off; + CellPair p(Trinity::ComputeCellPair(x, y, x_off, y_off)); Cell cell(p); cell.data.Part.reserved = ALL_DISTRICT; cell.SetNoCreate(); @@ -1481,12 +1482,12 @@ void Spell::SearchAreaTarget(std::list &TagUnitMap, float radius, const u //if(TargetType != SPELL_TARGETS_ENTRY) { TypeContainerVisitor world_object_notifier(notifier); - cell_lock->Visit(cell_lock, world_object_notifier, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster)); + cell_lock->Visit(cell_lock, world_object_notifier, *m_caster->GetMap(), radius, x_off, y_off); } if(!(m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_PLAYERS_ONLY)) { TypeContainerVisitor grid_object_notifier(notifier); - cell_lock->Visit(cell_lock, grid_object_notifier, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster)); + cell_lock->Visit(cell_lock, grid_object_notifier, *m_caster->GetMap(), radius, x_off, y_off); } } -- cgit v1.2.3 From f2028e1583bf935fc3d096748d5b07428cdcaa00 Mon Sep 17 00:00:00 2001 From: megamage Date: Thu, 11 Dec 2008 12:58:43 -0600 Subject: *Fix compile in Linux. --HG-- branch : trunk --- src/game/WaypointMovementGenerator.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/game/WaypointMovementGenerator.cpp b/src/game/WaypointMovementGenerator.cpp index e1ce805aa0b..68c63827883 100644 --- a/src/game/WaypointMovementGenerator.cpp +++ b/src/game/WaypointMovementGenerator.cpp @@ -20,6 +20,7 @@ #include #include "WaypointMovementGenerator.h" +#include "DestinationHolderImp.h" //Accessors #include "Database/DatabaseEnv.h" #include "ObjectMgr.h" -- cgit v1.2.3