fix(DB/Core) Fix the CLS damage system and update creature_classlevelstats (#4749)
* Fix the CLS dmg system Thanks to TC: https://github.com/TrinityCore/TrinityCore/commit/ccfa82e7d516c9d280fc7214fcf3672397c741ff
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -65,7 +65,7 @@ void WorldDatabaseConnection::DoPrepareStatements()
|
|||||||
PrepareStatement(WORLD_SEL_WAYPOINT_SCRIPT_ID_BY_GUID, "SELECT id FROM waypoint_scripts WHERE guid = ?", CONNECTION_SYNCH);
|
PrepareStatement(WORLD_SEL_WAYPOINT_SCRIPT_ID_BY_GUID, "SELECT id FROM waypoint_scripts WHERE guid = ?", CONNECTION_SYNCH);
|
||||||
PrepareStatement(WORLD_DEL_CREATURE, "DELETE FROM creature WHERE guid = ?", CONNECTION_ASYNC);
|
PrepareStatement(WORLD_DEL_CREATURE, "DELETE FROM creature WHERE guid = ?", CONNECTION_ASYNC);
|
||||||
PrepareStatement(WORLD_SEL_COMMANDS, "SELECT name, security, help FROM command", CONNECTION_SYNCH);
|
PrepareStatement(WORLD_SEL_COMMANDS, "SELECT name, security, help FROM command", CONNECTION_SYNCH);
|
||||||
PrepareStatement(WORLD_SEL_CREATURE_TEMPLATE, "SELECT 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, npcflag, speed_walk, speed_run, scale, `rank`, mindmg, maxdmg, dmgschool, attackpower, DamageModifier, BaseAttackTime, RangeAttackTime, unit_class, unit_flags, unit_flags2, 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, HoverHeight, HealthModifier, ManaModifier, ArmorModifier, RacialLeader, movementId, RegenHealth, mechanic_immune_mask, spell_school_immune_mask, flags_extra, ScriptName FROM creature_template WHERE entry = ?", CONNECTION_SYNCH);
|
PrepareStatement(WORLD_SEL_CREATURE_TEMPLATE, "SELECT 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, npcflag, speed_walk, speed_run, scale, `rank`, dmgschool, DamageModifier, BaseAttackTime, RangeAttackTime, BaseVariance, RangeVariance, unit_class, unit_flags, unit_flags2, dynamicflags, family, trainer_type, trainer_spell, trainer_class, trainer_race, 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, HoverHeight, HealthModifier, ManaModifier, ArmorModifier, RacialLeader, movementId, RegenHealth, mechanic_immune_mask, spell_school_immune_mask, flags_extra, ScriptName FROM creature_template WHERE entry = ?", CONNECTION_SYNCH);
|
||||||
PrepareStatement(WORLD_SEL_WAYPOINT_SCRIPT_BY_ID, "SELECT guid, delay, command, datalong, datalong2, dataint, x, y, z, o FROM waypoint_scripts WHERE id = ?", CONNECTION_SYNCH);
|
PrepareStatement(WORLD_SEL_WAYPOINT_SCRIPT_BY_ID, "SELECT guid, delay, command, datalong, datalong2, dataint, x, y, z, o FROM waypoint_scripts WHERE id = ?", CONNECTION_SYNCH);
|
||||||
PrepareStatement(WORLD_SEL_ITEM_TEMPLATE_BY_NAME, "SELECT entry FROM item_template WHERE name = ?", CONNECTION_SYNCH);
|
PrepareStatement(WORLD_SEL_ITEM_TEMPLATE_BY_NAME, "SELECT entry FROM item_template WHERE name = ?", CONNECTION_SYNCH);
|
||||||
PrepareStatement(WORLD_SEL_CREATURE_BY_ID, "SELECT guid FROM creature WHERE id = ?", CONNECTION_SYNCH);
|
PrepareStatement(WORLD_SEL_CREATURE_BY_ID, "SELECT guid FROM creature WHERE id = ?", CONNECTION_SYNCH);
|
||||||
|
|||||||
@@ -1249,8 +1249,7 @@ void Creature::SelectLevel(bool changelevel)
|
|||||||
|
|
||||||
// damage
|
// damage
|
||||||
|
|
||||||
// pussywizard: disabled until it's fixed
|
float basedamage = stats->GenerateBaseDamage(cInfo);
|
||||||
/*float basedamage = stats->GenerateBaseDamage(cInfo);
|
|
||||||
|
|
||||||
float weaponBaseMinDamage = basedamage;
|
float weaponBaseMinDamage = basedamage;
|
||||||
float weaponBaseMaxDamage = basedamage * 1.5;
|
float weaponBaseMaxDamage = basedamage * 1.5;
|
||||||
@@ -1265,19 +1264,7 @@ void Creature::SelectLevel(bool changelevel)
|
|||||||
SetBaseWeaponDamage(RANGED_ATTACK, MAXDAMAGE, weaponBaseMaxDamage);
|
SetBaseWeaponDamage(RANGED_ATTACK, MAXDAMAGE, weaponBaseMaxDamage);
|
||||||
|
|
||||||
SetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE, stats->AttackPower);
|
SetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE, stats->AttackPower);
|
||||||
SetModifierValue(UNIT_MOD_ATTACK_POWER_RANGED, BASE_VALUE, stats->RangedAttackPower);*/
|
SetModifierValue(UNIT_MOD_ATTACK_POWER_RANGED, BASE_VALUE, stats->RangedAttackPower);
|
||||||
|
|
||||||
SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, cInfo->mindmg);
|
|
||||||
SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, cInfo->maxdmg);
|
|
||||||
|
|
||||||
SetBaseWeaponDamage(OFF_ATTACK, MINDAMAGE, cInfo->mindmg);
|
|
||||||
SetBaseWeaponDamage(OFF_ATTACK, MAXDAMAGE, cInfo->maxdmg);
|
|
||||||
|
|
||||||
SetBaseWeaponDamage(RANGED_ATTACK, MINDAMAGE, cInfo->minrangedmg);
|
|
||||||
SetBaseWeaponDamage(RANGED_ATTACK, MAXDAMAGE, cInfo->maxrangedmg);
|
|
||||||
|
|
||||||
SetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE, cInfo->attackpower);
|
|
||||||
SetModifierValue(UNIT_MOD_ATTACK_POWER_RANGED, BASE_VALUE, cInfo->rangedattackpower);
|
|
||||||
|
|
||||||
sScriptMgr->Creature_SelectLevel(cInfo, this);
|
sScriptMgr->Creature_SelectLevel(cInfo, this);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,13 +99,12 @@ struct CreatureTemplate
|
|||||||
float speed_run;
|
float speed_run;
|
||||||
float scale;
|
float scale;
|
||||||
uint32 rank;
|
uint32 rank;
|
||||||
float mindmg;
|
|
||||||
float maxdmg;
|
|
||||||
uint32 dmgschool;
|
uint32 dmgschool;
|
||||||
uint32 attackpower;
|
|
||||||
float DamageModifier;
|
float DamageModifier;
|
||||||
uint32 BaseAttackTime;
|
uint32 BaseAttackTime;
|
||||||
uint32 RangeAttackTime;
|
uint32 RangeAttackTime;
|
||||||
|
float BaseVariance;
|
||||||
|
float RangeVariance;
|
||||||
uint32 unit_class; // enum Classes. Note only 4 classes are known for creatures.
|
uint32 unit_class; // enum Classes. Note only 4 classes are known for creatures.
|
||||||
uint32 unit_flags; // enum UnitFlags mask values
|
uint32 unit_flags; // enum UnitFlags mask values
|
||||||
uint32 unit_flags2; // enum UnitFlags2 mask values
|
uint32 unit_flags2; // enum UnitFlags2 mask values
|
||||||
@@ -115,9 +114,6 @@ struct CreatureTemplate
|
|||||||
uint32 trainer_spell;
|
uint32 trainer_spell;
|
||||||
uint32 trainer_class;
|
uint32 trainer_class;
|
||||||
uint32 trainer_race;
|
uint32 trainer_race;
|
||||||
float minrangedmg;
|
|
||||||
float maxrangedmg;
|
|
||||||
uint32 rangedattackpower;
|
|
||||||
uint32 type; // enum CreatureType values
|
uint32 type; // enum CreatureType values
|
||||||
uint32 type_flags; // enum CreatureTypeFlags mask values
|
uint32 type_flags; // enum CreatureTypeFlags mask values
|
||||||
uint32 lootid;
|
uint32 lootid;
|
||||||
|
|||||||
@@ -1045,16 +1045,20 @@ void Creature::UpdateAttackPowerAndDamage(bool ranged)
|
|||||||
void Creature::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bool addTotalPct, float& minDamage, float& maxDamage)
|
void Creature::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bool addTotalPct, float& minDamage, float& maxDamage)
|
||||||
{
|
{
|
||||||
UnitMods unitMod;
|
UnitMods unitMod;
|
||||||
|
float variance = 1.0f;
|
||||||
switch (attType)
|
switch (attType)
|
||||||
{
|
{
|
||||||
case BASE_ATTACK:
|
case BASE_ATTACK:
|
||||||
default:
|
default:
|
||||||
|
variance = GetCreatureTemplate()->BaseVariance;
|
||||||
unitMod = UNIT_MOD_DAMAGE_MAINHAND;
|
unitMod = UNIT_MOD_DAMAGE_MAINHAND;
|
||||||
break;
|
break;
|
||||||
case OFF_ATTACK:
|
case OFF_ATTACK:
|
||||||
|
variance = GetCreatureTemplate()->BaseVariance;
|
||||||
unitMod = UNIT_MOD_DAMAGE_OFFHAND;
|
unitMod = UNIT_MOD_DAMAGE_OFFHAND;
|
||||||
break;
|
break;
|
||||||
case RANGED_ATTACK:
|
case RANGED_ATTACK:
|
||||||
|
variance = GetCreatureTemplate()->RangeVariance;
|
||||||
unitMod = UNIT_MOD_DAMAGE_RANGED;
|
unitMod = UNIT_MOD_DAMAGE_RANGED;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1075,10 +1079,10 @@ void Creature::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized,
|
|||||||
weaponMaxDamage = 0.0f;
|
weaponMaxDamage = 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
// pussywizard: subtract value from database till its fixed (the way it worked before creature_levelstats damage implementation)
|
float attackPower = GetTotalAttackPowerValue(attType);
|
||||||
float attackPower = GetTotalAttackPowerValue(attType) - (attType == RANGED_ATTACK ? GetCreatureTemplate()->rangedattackpower : GetCreatureTemplate()->attackpower);
|
float attackSpeedMulti = GetAPMultiplier(attType, normalized);
|
||||||
float baseValue = GetModifierValue(unitMod, BASE_VALUE) + (attackPower * GetAPMultiplier(attType, normalized) / 14.0f);
|
float baseValue = GetModifierValue(unitMod, BASE_VALUE) + (attackPower / 14.0f) * variance;
|
||||||
float basePct = GetModifierValue(unitMod, BASE_PCT);
|
float basePct = GetModifierValue(unitMod, BASE_PCT) * attackSpeedMulti;
|
||||||
float totalValue = GetModifierValue(unitMod, TOTAL_VALUE);
|
float totalValue = GetModifierValue(unitMod, TOTAL_VALUE);
|
||||||
float totalPct = addTotalPct ? GetModifierValue(unitMod, TOTAL_PCT) : 1.0f;
|
float totalPct = addTotalPct ? GetModifierValue(unitMod, TOTAL_PCT) : 1.0f;
|
||||||
float dmgMultiplier = GetCreatureTemplate()->DamageModifier; // = DamageModifier * _GetDamageMod(rank);
|
float dmgMultiplier = GetCreatureTemplate()->DamageModifier; // = DamageModifier * _GetDamageMod(rank);
|
||||||
|
|||||||
@@ -463,15 +463,15 @@ void ObjectMgr::LoadCreatureTemplates()
|
|||||||
QueryResult result = WorldDatabase.Query("SELECT entry, difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, modelid1, modelid2, modelid3, "
|
QueryResult result = WorldDatabase.Query("SELECT entry, difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, modelid1, modelid2, modelid3, "
|
||||||
// 9 10 11 12 13 14 15 16 17 18 19 20
|
// 9 10 11 12 13 14 15 16 17 18 19 20
|
||||||
"modelid4, name, subname, IconName, gossip_menu_id, minlevel, maxlevel, exp, faction, npcflag, speed_walk, speed_run, "
|
"modelid4, name, subname, IconName, gossip_menu_id, minlevel, maxlevel, exp, faction, npcflag, speed_walk, speed_run, "
|
||||||
// 21 22 23 24 25 26 27 28 29 30 31 32
|
// 21 22 23 24 25 26 27 28 29 30 31
|
||||||
"scale, `rank`, mindmg, maxdmg, dmgschool, attackpower, DamageModifier, BaseAttackTime, RangeAttackTime, unit_class, unit_flags, unit_flags2, "
|
"scale, `rank`, dmgschool, DamageModifier, BaseAttackTime, RangeAttackTime, BaseVariance, RangeVariance, unit_class, unit_flags, unit_flags2, "
|
||||||
// 33 34 35 36 37 38 39 40 41 42
|
// 32 33 34 35 36 37 38
|
||||||
"dynamicflags, family, trainer_type, trainer_spell, trainer_class, trainer_race, minrangedmg, maxrangedmg, rangedattackpower, type, "
|
"dynamicflags, family, trainer_type, trainer_spell, trainer_class, trainer_race, type, "
|
||||||
// 43 44 45 46 47 48 49 50 51 52 53
|
// 39 40 41 42 43 44 45 46 47 48 49
|
||||||
"type_flags, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, spell1, "
|
"type_flags, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, spell1, "
|
||||||
// 54 55 56 57 58 59 60 61 62 63 64 65 66
|
// 50 51 52 53 54 55 56 57 58 59 60 61 62
|
||||||
"spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, "
|
"spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, "
|
||||||
// 67 68 69 70 71 72 73 74 75 76 77 78
|
// 63 64 65 66 67 68 69 70 71 72 73 74
|
||||||
"InhabitType, HoverHeight, HealthModifier, ManaModifier, ArmorModifier, RacialLeader, movementId, RegenHealth, mechanic_immune_mask, spell_school_immune_mask, flags_extra, ScriptName "
|
"InhabitType, HoverHeight, HealthModifier, ManaModifier, ArmorModifier, RacialLeader, movementId, RegenHealth, mechanic_immune_mask, spell_school_immune_mask, flags_extra, ScriptName "
|
||||||
"FROM creature_template;");
|
"FROM creature_template;");
|
||||||
|
|
||||||
@@ -516,55 +516,51 @@ void ObjectMgr::LoadCreatureTemplates()
|
|||||||
creatureTemplate.speed_run = fields[20].GetFloat();
|
creatureTemplate.speed_run = fields[20].GetFloat();
|
||||||
creatureTemplate.scale = fields[21].GetFloat();
|
creatureTemplate.scale = fields[21].GetFloat();
|
||||||
creatureTemplate.rank = uint32(fields[22].GetUInt8());
|
creatureTemplate.rank = uint32(fields[22].GetUInt8());
|
||||||
creatureTemplate.mindmg = fields[23].GetFloat();
|
creatureTemplate.dmgschool = uint32(fields[23].GetInt8());
|
||||||
creatureTemplate.maxdmg = fields[24].GetFloat();
|
creatureTemplate.DamageModifier = fields[24].GetFloat();
|
||||||
creatureTemplate.dmgschool = uint32(fields[25].GetInt8());
|
creatureTemplate.BaseAttackTime = fields[25].GetUInt32();
|
||||||
creatureTemplate.attackpower = fields[26].GetUInt32();
|
creatureTemplate.RangeAttackTime = fields[26].GetUInt32();
|
||||||
creatureTemplate.DamageModifier = fields[27].GetFloat();
|
creatureTemplate.BaseVariance = fields[27].GetFloat();
|
||||||
creatureTemplate.BaseAttackTime = fields[28].GetUInt32();
|
creatureTemplate.RangeVariance = fields[28].GetFloat();
|
||||||
creatureTemplate.RangeAttackTime = fields[29].GetUInt32();
|
creatureTemplate.unit_class = uint32(fields[29].GetUInt8());
|
||||||
creatureTemplate.unit_class = uint32(fields[30].GetUInt8());
|
creatureTemplate.unit_flags = fields[30].GetUInt32();
|
||||||
creatureTemplate.unit_flags = fields[31].GetUInt32();
|
creatureTemplate.unit_flags2 = fields[31].GetUInt32();
|
||||||
creatureTemplate.unit_flags2 = fields[32].GetUInt32();
|
creatureTemplate.dynamicflags = fields[32].GetUInt32();
|
||||||
creatureTemplate.dynamicflags = fields[33].GetUInt32();
|
creatureTemplate.family = uint32(fields[33].GetUInt8());
|
||||||
creatureTemplate.family = uint32(fields[34].GetUInt8());
|
creatureTemplate.trainer_type = uint32(fields[34].GetUInt8());
|
||||||
creatureTemplate.trainer_type = uint32(fields[35].GetUInt8());
|
creatureTemplate.trainer_spell = fields[35].GetUInt32();
|
||||||
creatureTemplate.trainer_spell = fields[36].GetUInt32();
|
creatureTemplate.trainer_class = uint32(fields[36].GetUInt8());
|
||||||
creatureTemplate.trainer_class = uint32(fields[37].GetUInt8());
|
creatureTemplate.trainer_race = uint32(fields[37].GetUInt8());
|
||||||
creatureTemplate.trainer_race = uint32(fields[38].GetUInt8());
|
creatureTemplate.type = uint32(fields[38].GetUInt8());
|
||||||
creatureTemplate.minrangedmg = fields[39].GetFloat();
|
creatureTemplate.type_flags = fields[39].GetUInt32();
|
||||||
creatureTemplate.maxrangedmg = fields[40].GetFloat();
|
creatureTemplate.lootid = fields[40].GetUInt32();
|
||||||
creatureTemplate.rangedattackpower = uint32(fields[41].GetUInt16());
|
creatureTemplate.pickpocketLootId = fields[41].GetUInt32();
|
||||||
creatureTemplate.type = uint32(fields[42].GetUInt8());
|
creatureTemplate.SkinLootId = fields[42].GetUInt32();
|
||||||
creatureTemplate.type_flags = fields[43].GetUInt32();
|
|
||||||
creatureTemplate.lootid = fields[44].GetUInt32();
|
|
||||||
creatureTemplate.pickpocketLootId = fields[45].GetUInt32();
|
|
||||||
creatureTemplate.SkinLootId = fields[46].GetUInt32();
|
|
||||||
|
|
||||||
for (uint8 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
|
for (uint8 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
|
||||||
creatureTemplate.resistance[i] = fields[47 + i - 1].GetInt16();
|
creatureTemplate.resistance[i] = fields[43 + i - 1].GetInt16();
|
||||||
|
|
||||||
for (uint8 i = 0; i < CREATURE_MAX_SPELLS; ++i)
|
for (uint8 i = 0; i < CREATURE_MAX_SPELLS; ++i)
|
||||||
creatureTemplate.spells[i] = fields[53 + i].GetUInt32();
|
creatureTemplate.spells[i] = fields[49 + i].GetUInt32();
|
||||||
|
|
||||||
creatureTemplate.PetSpellDataId = fields[61].GetUInt32();
|
creatureTemplate.PetSpellDataId = fields[57].GetUInt32();
|
||||||
creatureTemplate.VehicleId = fields[62].GetUInt32();
|
creatureTemplate.VehicleId = fields[58].GetUInt32();
|
||||||
creatureTemplate.mingold = fields[63].GetUInt32();
|
creatureTemplate.mingold = fields[59].GetUInt32();
|
||||||
creatureTemplate.maxgold = fields[64].GetUInt32();
|
creatureTemplate.maxgold = fields[60].GetUInt32();
|
||||||
creatureTemplate.AIName = fields[65].GetString();
|
creatureTemplate.AIName = fields[61].GetString();
|
||||||
creatureTemplate.MovementType = uint32(fields[66].GetUInt8());
|
creatureTemplate.MovementType = uint32(fields[62].GetUInt8());
|
||||||
creatureTemplate.InhabitType = uint32(fields[67].GetUInt8());
|
creatureTemplate.InhabitType = uint32(fields[63].GetUInt8());
|
||||||
creatureTemplate.HoverHeight = fields[68].GetFloat();
|
creatureTemplate.HoverHeight = fields[64].GetFloat();
|
||||||
creatureTemplate.ModHealth = fields[69].GetFloat();
|
creatureTemplate.ModHealth = fields[65].GetFloat();
|
||||||
creatureTemplate.ModMana = fields[70].GetFloat();
|
creatureTemplate.ModMana = fields[66].GetFloat();
|
||||||
creatureTemplate.ModArmor = fields[71].GetFloat();
|
creatureTemplate.ModArmor = fields[67].GetFloat();
|
||||||
creatureTemplate.RacialLeader = fields[72].GetBool();
|
creatureTemplate.RacialLeader = fields[68].GetBool();
|
||||||
creatureTemplate.movementId = fields[73].GetUInt32();
|
creatureTemplate.movementId = fields[69].GetUInt32();
|
||||||
creatureTemplate.RegenHealth = fields[74].GetBool();
|
creatureTemplate.RegenHealth = fields[70].GetBool();
|
||||||
creatureTemplate.MechanicImmuneMask = fields[75].GetUInt32();
|
creatureTemplate.MechanicImmuneMask = fields[71].GetUInt32();
|
||||||
creatureTemplate.SpellSchoolImmuneMask = fields[76].GetUInt8();
|
creatureTemplate.SpellSchoolImmuneMask = fields[72].GetUInt8();
|
||||||
creatureTemplate.flags_extra = fields[77].GetUInt32();
|
creatureTemplate.flags_extra = fields[73].GetUInt32();
|
||||||
creatureTemplate.ScriptID = GetScriptId(fields[78].GetCString());
|
creatureTemplate.ScriptID = GetScriptId(fields[74].GetCString());
|
||||||
|
|
||||||
++count;
|
++count;
|
||||||
} while (result->NextRow());
|
} while (result->NextRow());
|
||||||
|
|||||||
@@ -458,59 +458,51 @@ public:
|
|||||||
cInfo->speed_run = fields[19].GetFloat();
|
cInfo->speed_run = fields[19].GetFloat();
|
||||||
cInfo->scale = fields[20].GetFloat();
|
cInfo->scale = fields[20].GetFloat();
|
||||||
cInfo->rank = fields[21].GetUInt8();
|
cInfo->rank = fields[21].GetUInt8();
|
||||||
cInfo->mindmg = fields[22].GetFloat();
|
cInfo->dmgschool = fields[22].GetUInt8();
|
||||||
cInfo->maxdmg = fields[23].GetFloat();
|
cInfo->DamageModifier = fields[23].GetFloat();
|
||||||
cInfo->dmgschool = fields[24].GetUInt8();
|
cInfo->BaseAttackTime = fields[24].GetUInt32();
|
||||||
cInfo->attackpower = fields[25].GetUInt32();
|
cInfo->RangeAttackTime = fields[25].GetUInt32();
|
||||||
cInfo->DamageModifier = fields[26].GetFloat();
|
cInfo->BaseVariance = fields[26].GetFloat();
|
||||||
cInfo->BaseAttackTime = fields[27].GetUInt32();
|
cInfo->RangeVariance = fields[27].GetFloat();
|
||||||
cInfo->RangeAttackTime = fields[28].GetUInt32();
|
cInfo->unit_class = fields[28].GetUInt8();
|
||||||
cInfo->unit_class = fields[29].GetUInt8();
|
cInfo->unit_flags = fields[29].GetUInt32();
|
||||||
cInfo->unit_flags = fields[30].GetUInt32();
|
cInfo->unit_flags2 = fields[30].GetUInt32();
|
||||||
cInfo->unit_flags2 = fields[31].GetUInt32();
|
cInfo->dynamicflags = fields[31].GetUInt32();
|
||||||
cInfo->dynamicflags = fields[32].GetUInt32();
|
cInfo->family = fields[32].GetUInt8();
|
||||||
cInfo->family = fields[33].GetUInt8();
|
cInfo->trainer_type = fields[33].GetUInt8();
|
||||||
cInfo->trainer_type = fields[34].GetUInt8();
|
cInfo->trainer_spell = fields[34].GetUInt32();
|
||||||
cInfo->trainer_spell = fields[35].GetUInt32();
|
cInfo->trainer_class = fields[35].GetUInt8();
|
||||||
cInfo->trainer_class = fields[36].GetUInt8();
|
cInfo->trainer_race = fields[36].GetUInt8();
|
||||||
cInfo->trainer_race = fields[37].GetUInt8();
|
cInfo->type = fields[37].GetUInt8();
|
||||||
cInfo->minrangedmg = fields[38].GetFloat();
|
cInfo->type_flags = fields[38].GetUInt32();
|
||||||
cInfo->maxrangedmg = fields[39].GetFloat();
|
cInfo->lootid = fields[39].GetUInt32();
|
||||||
cInfo->rangedattackpower = fields[40].GetUInt16();
|
cInfo->pickpocketLootId = fields[40].GetUInt32();
|
||||||
cInfo->type = fields[41].GetUInt8();
|
cInfo->SkinLootId = fields[41].GetUInt32();
|
||||||
cInfo->type_flags = fields[42].GetUInt32();
|
|
||||||
cInfo->lootid = fields[43].GetUInt32();
|
|
||||||
cInfo->pickpocketLootId = fields[44].GetUInt32();
|
|
||||||
cInfo->SkinLootId = fields[45].GetUInt32();
|
|
||||||
|
|
||||||
for (uint8 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
|
for (uint8 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
|
||||||
cInfo->resistance[i] = fields[46 + i - 1].GetUInt16();
|
cInfo->resistance[i] = fields[42 + i - 1].GetUInt16();
|
||||||
|
|
||||||
cInfo->spells[0] = fields[52].GetUInt32();
|
for (uint8 i = 0; i < CREATURE_MAX_SPELLS; ++i)
|
||||||
cInfo->spells[1] = fields[53].GetUInt32();
|
cInfo->spells[i] = fields[48 + i].GetUInt32();
|
||||||
cInfo->spells[2] = fields[54].GetUInt32();
|
|
||||||
cInfo->spells[3] = fields[55].GetUInt32();
|
cInfo->PetSpellDataId = fields[56].GetUInt32();
|
||||||
cInfo->spells[4] = fields[56].GetUInt32();
|
cInfo->VehicleId = fields[57].GetUInt32();
|
||||||
cInfo->spells[5] = fields[57].GetUInt32();
|
cInfo->mingold = fields[58].GetUInt32();
|
||||||
cInfo->spells[6] = fields[58].GetUInt32();
|
cInfo->maxgold = fields[59].GetUInt32();
|
||||||
cInfo->spells[7] = fields[59].GetUInt32();
|
cInfo->AIName = fields[60].GetString();
|
||||||
cInfo->PetSpellDataId = fields[60].GetUInt32();
|
cInfo->MovementType = fields[61].GetUInt8();
|
||||||
cInfo->VehicleId = fields[61].GetUInt32();
|
cInfo->InhabitType = fields[62].GetUInt8();
|
||||||
cInfo->mingold = fields[62].GetUInt32();
|
cInfo->HoverHeight = fields[63].GetFloat();
|
||||||
cInfo->maxgold = fields[63].GetUInt32();
|
cInfo->ModHealth = fields[64].GetFloat();
|
||||||
cInfo->AIName = fields[64].GetString();
|
cInfo->ModMana = fields[65].GetFloat();
|
||||||
cInfo->MovementType = fields[65].GetUInt8();
|
cInfo->ModArmor = fields[66].GetFloat();
|
||||||
cInfo->InhabitType = fields[66].GetUInt8();
|
cInfo->RacialLeader = fields[67].GetBool();
|
||||||
cInfo->HoverHeight = fields[67].GetFloat();
|
cInfo->movementId = fields[68].GetUInt32();
|
||||||
cInfo->ModHealth = fields[68].GetFloat();
|
cInfo->RegenHealth = fields[69].GetBool();
|
||||||
cInfo->ModMana = fields[69].GetFloat();
|
cInfo->MechanicImmuneMask = fields[70].GetUInt32();
|
||||||
cInfo->ModArmor = fields[70].GetFloat();
|
cInfo->SpellSchoolImmuneMask = fields[71].GetUInt32();
|
||||||
cInfo->RacialLeader = fields[71].GetBool();
|
cInfo->flags_extra = fields[72].GetUInt32();
|
||||||
cInfo->movementId = fields[72].GetUInt32();
|
cInfo->ScriptID = sObjectMgr->GetScriptId(fields[73].GetCString());
|
||||||
cInfo->RegenHealth = fields[73].GetBool();
|
|
||||||
cInfo->MechanicImmuneMask = fields[74].GetUInt32();
|
|
||||||
cInfo->flags_extra = fields[75].GetUInt32();
|
|
||||||
cInfo->ScriptID = sObjectMgr->GetScriptId(fields[76].GetCString());
|
|
||||||
|
|
||||||
sObjectMgr->CheckCreatureTemplate(cInfo);
|
sObjectMgr->CheckCreatureTemplate(cInfo);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,6 +96,7 @@ public:
|
|||||||
_init = true;
|
_init = true;
|
||||||
|
|
||||||
CreatureTemplate const* Info = me->GetCreatureTemplate();
|
CreatureTemplate const* Info = me->GetCreatureTemplate();
|
||||||
|
CreatureBaseStats const* stats = sObjectMgr->GetCreatureBaseStats(me->getLevel(), Info->unit_class);
|
||||||
uint32 health = uint32(107 * (me->getLevel() - 40) * 0.025f);
|
uint32 health = uint32(107 * (me->getLevel() - 40) * 0.025f);
|
||||||
me->SetCreateHealth(health);
|
me->SetCreateHealth(health);
|
||||||
|
|
||||||
@@ -110,7 +111,7 @@ public:
|
|||||||
//Add delta to make them not all hit the same time
|
//Add delta to make them not all hit the same time
|
||||||
uint32 delta = urand(0, 700);
|
uint32 delta = urand(0, 700);
|
||||||
me->SetAttackTime(BASE_ATTACK, Info->BaseAttackTime + delta);
|
me->SetAttackTime(BASE_ATTACK, Info->BaseAttackTime + delta);
|
||||||
me->SetStatFloatValue(UNIT_FIELD_RANGED_ATTACK_POWER, float(Info->attackpower));
|
me->SetStatFloatValue(UNIT_FIELD_RANGED_ATTACK_POWER, float(stats->AttackPower));
|
||||||
me->CastSpell(me, SPELL_HUNTER_DEADLY_POISON_PASSIVE, true);
|
me->CastSpell(me, SPELL_HUNTER_DEADLY_POISON_PASSIVE, true);
|
||||||
|
|
||||||
// Glyph of Snake Trap
|
// Glyph of Snake Trap
|
||||||
|
|||||||
Reference in New Issue
Block a user