diff options
-rw-r--r-- | sql/world.sql | 5 | ||||
-rw-r--r-- | src/game/Creature.cpp | 7 | ||||
-rw-r--r-- | src/game/Creature.h | 3 | ||||
-rw-r--r-- | src/game/Unit.cpp | 8 | ||||
-rw-r--r-- | src/scripts/northrend/ulduar/halls_of_lightning/boss_ionar.cpp | 6 | ||||
-rw-r--r-- | src/shared/Database/SQLStorage.cpp | 4 |
6 files changed, 20 insertions, 13 deletions
diff --git a/sql/world.sql b/sql/world.sql index c51fe8297dc..55257a3713a 100644 --- a/sql/world.sql +++ b/sql/world.sql @@ -1570,7 +1570,8 @@ CREATE TABLE `creature_template` ( `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', + `speed_walk` float NOT NULL default '1' COMMENT 'Result of 2.5/2.5, most common value', + `speed_run` float NOT NULL default '1.14286' COMMENT 'Result of 8.0/7.0, most common value', `scale` float NOT NULL DEFAULT '1', `rank` tinyint(3) unsigned NOT NULL DEFAULT '0', `mindmg` float NOT NULL DEFAULT '0', @@ -1645,7 +1646,7 @@ CREATE TABLE `creature_template` ( LOCK TABLES `creature_template` WRITE; /*!40000 ALTER TABLE `creature_template` DISABLE KEYS */; -INSERT INTO `creature_template` (`entry`,`difficulty_entry_1`,`difficulty_entry_2`,`difficulty_entry_3`,`KillCredit1`,`KillCredit2`,`modelid1`,`modelid2`,`modelid3`,`modelid4`,`name`,`subname`,`IconName`,`gossip_menu_id`,`minlevel`,`maxlevel`,`exp`,`faction_A`,`faction_H`,`npcflag`,`speed`,`scale`,`rank`,`mindmg`,`maxdmg`,`dmgschool`,`attackpower`,`dmg_multiplier`,`baseattacktime`,`rangeattacktime`,`unit_class`,`unit_flags`,`dynamicflags`,`family`,`trainer_type`,`trainer_spell`,`trainer_class`,`trainer_race`,`minrangedmg`,`maxrangedmg`,`rangedattackpower`,`type`,`type_flags`,`lootid`,`pickpocketloot`,`skinloot`,`resistance1`,`resistance2`,`resistance3`,`resistance4`,`resistance5`,`resistance6`,`spell1`,`spell2`,`spell3`,`spell4`,`spell5`,`spell6`,`spell7`,`spell8`,`PetSpellDataId`,`VehicleId`,`mingold`,`maxgold`,`AIName`,`MovementType`,`InhabitType`,`Health_mod`,`Mana_mod`,`Armor_mod`,`RacialLeader`,`questItem1`,`questItem2`,`questItem3`,`questItem4`,`questItem5`,`questItem6`,`movementId`,`RegenHealth`,`equipment_id`,`mechanic_immune_mask`,`flags_extra`,`ScriptName`) VALUES (1,0,0,0,0,0,10045,0,0,0,'Waypoint (Only GM can see it)','Visual',NULL,0,1,80,0,35,35,0,0.91,1,0,7,7,0,3,1,2000,2200,1,4096,0,0,0,0,0,0,1.76,2.42,100,8,5242886,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'',0,7,0.0125,1,1,0,0,0,0,0,0,0,0,1,0,0,130,''); +INSERT INTO `creature_template` (`entry`,`difficulty_entry_1`,`difficulty_entry_2`,`difficulty_entry_3`,`KillCredit1`,`KillCredit2`,`modelid1`,`modelid2`,`modelid3`,`modelid4`,`name`,`subname`,`IconName`,`gossip_menu_id`,`minlevel`,`maxlevel`,`exp`,`faction_A`,`faction_H`,`npcflag`,`speed_walk`,`scale`,`rank`,`mindmg`,`maxdmg`,`dmgschool`,`attackpower`,`dmg_multiplier`,`baseattacktime`,`rangeattacktime`,`unit_class`,`unit_flags`,`dynamicflags`,`family`,`trainer_type`,`trainer_spell`,`trainer_class`,`trainer_race`,`minrangedmg`,`maxrangedmg`,`rangedattackpower`,`type`,`type_flags`,`lootid`,`pickpocketloot`,`skinloot`,`resistance1`,`resistance2`,`resistance3`,`resistance4`,`resistance5`,`resistance6`,`spell1`,`spell2`,`spell3`,`spell4`,`spell5`,`spell6`,`spell7`,`spell8`,`PetSpellDataId`,`VehicleId`,`mingold`,`maxgold`,`AIName`,`MovementType`,`InhabitType`,`Health_mod`,`Mana_mod`,`Armor_mod`,`RacialLeader`,`questItem1`,`questItem2`,`questItem3`,`questItem4`,`questItem5`,`questItem6`,`movementId`,`RegenHealth`,`equipment_id`,`mechanic_immune_mask`,`flags_extra`,`ScriptName`) VALUES (1,0,0,0,0,0,10045,0,0,0,'Waypoint (Only GM can see it)','Visual',NULL,0,1,80,0,35,35,0,0.91,1,0,7,7,0,3,1,2000,2200,1,4096,0,0,0,0,0,0,1.76,2.42,100,8,5242886,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'',0,7,0.0125,1,1,0,0,0,0,0,0,0,0,1,0,0,130,''); /*!40000 ALTER TABLE `creature_template` ENABLE KEYS */; UNLOCK TABLES; diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index 8404702f748..e4f3e2e7b89 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -341,9 +341,10 @@ bool Creature::InitEntry(uint32 Entry, uint32 team, const CreatureData *data ) SetFloatValue(UNIT_MOD_CAST_SPEED, 1.0f); - SetSpeed(MOVE_WALK, cinfo->speed ); - SetSpeed(MOVE_RUN, cinfo->speed ); - SetSpeed(MOVE_SWIM, cinfo->speed ); + SetSpeed(MOVE_WALK, cinfo->speed_walk ); + SetSpeed(MOVE_RUN, cinfo->speed_run ); + SetSpeed(MOVE_SWIM, 1.0f); // using 1.0 rate + SetSpeed(MOVE_FLIGHT, 1.0f); // using 1.0 rate SetFloatValue(OBJECT_FIELD_SCALE_X, cinfo->scale); diff --git a/src/game/Creature.h b/src/game/Creature.h index cef677edc29..4d74e03d60f 100644 --- a/src/game/Creature.h +++ b/src/game/Creature.h @@ -88,7 +88,8 @@ struct CreatureInfo uint32 faction_A; uint32 faction_H; uint32 npcflag; - float speed; + float speed_walk; + float speed_run; float scale; uint32 rank; float mindmg; diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 3d63555ab0b..4f97861c9a1 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -292,6 +292,7 @@ void Unit::SendMonsterMoveWithSpeedToCurrentDestination(Player* player) SendMonsterMoveWithSpeed(x, y, z, 0, player); } + void Unit::SendMonsterMoveWithSpeed(float x, float y, float z, uint32 transitTime, Player* player) { if (!transitTime) @@ -421,8 +422,9 @@ void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 M data << uint32(MovementFlags); - if (MovementFlags & MONSTER_MOVE_WALK) - moveTime *= 1.05f; + //enable me if things goes wrong or looks ugly, it is however an old hack + //if (MovementFlags & MONSTER_MOVE_WALK) + //moveTime *= 1.05f; data << uint32(moveTime); // Time in between points data << uint32(1); // 1 single waypoint @@ -11744,7 +11746,7 @@ void Unit::UpdateSpeed(UnitMoveType mtype, bool forced) { // Set creature speed rate from CreatureInfo if (GetTypeId() == TYPEID_UNIT) - speed *= this->ToCreature()->GetCreatureInfo()->speed; + speed *= this->ToCreature()->GetCreatureInfo()->speed_walk; // Normalize speed by 191 aura SPELL_AURA_USE_NORMAL_MOVEMENT_SPEED if need // TODO: possible affect only on MOVE_RUN diff --git a/src/scripts/northrend/ulduar/halls_of_lightning/boss_ionar.cpp b/src/scripts/northrend/ulduar/halls_of_lightning/boss_ionar.cpp index 5a90bbd54a8..0c025eaaa0e 100644 --- a/src/scripts/northrend/ulduar/halls_of_lightning/boss_ionar.cpp +++ b/src/scripts/northrend/ulduar/halls_of_lightning/boss_ionar.cpp @@ -185,7 +185,8 @@ struct boss_ionarAI : public ScriptedAI if (pSpark->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE) pSpark->GetMotionMaster()->MovementExpired(); - pSpark->SetSpeed(MOVE_RUN, pSpark->GetCreatureInfo()->speed * 2); + //now handle by db + //pSpark->SetSpeed(MOVE_RUN, pSpark->GetCreatureInfo()->speed * 2); pSpark->GetMotionMaster()->MovePoint(POINT_CALLBACK, pos); } } @@ -430,7 +431,8 @@ struct mob_spark_of_ionarAI : public ScriptedAI if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE) m_creature->GetMotionMaster()->MovementExpired(); - m_creature->SetSpeed(MOVE_RUN, m_creature->GetCreatureInfo()->speed * 2); + //now handle by db + //m_creature->SetSpeed(MOVE_RUN, m_creature->GetCreatureInfo()->speed * 2); m_creature->GetMotionMaster()->MovePoint(POINT_CALLBACK, pos); } } diff --git a/src/shared/Database/SQLStorage.cpp b/src/shared/Database/SQLStorage.cpp index a5c4a6523e2..d3029c858b2 100644 --- a/src/shared/Database/SQLStorage.cpp +++ b/src/shared/Database/SQLStorage.cpp @@ -27,8 +27,8 @@ extern DatabasePostgre WorldDatabase; extern DatabaseMysql WorldDatabase; #endif -const char CreatureInfosrcfmt[]="iiiiiiiiiisssiiiiiiiffiffiifiiiiiiiiiiffiiiiiiiiiiiiiiiiiiiiiiiisiifffliiiiiiiliiisi"; -const char CreatureInfodstfmt[]="iiiiiiiiiisssibbiiiiffiffiifiiiiiiiiiiffiiiiiiiiiiiiiiiiiiiiiiiisiifffliiiiiiiliiiii"; +const char CreatureInfosrcfmt[]="iiiiiiiiiisssiiiiiiifffiffiifiiiiiiiiiiffiiiiiiiiiiiiiiiiiiiiiiiisiifffliiiiiiiliiisi"; +const char CreatureInfodstfmt[]="iiiiiiiiiisssibbiiiifffiffiifiiiiiiiiiiffiiiiiiiiiiiiiiiiiiiiiiiisiifffliiiiiiiliiiii"; const char CreatureDataAddonInfofmt[]="iiiiiis"; const char CreatureModelfmt[]="iffbi"; const char CreatureInfoAddonInfofmt[]="iiiiiis"; |