Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
Merge pull request #700 from ProjectSkyfire/dev_aridev
Browse files Browse the repository at this point in the history
*Server/Player: Fixed saving blockpct into character_stats, also added mastery, pvpdamage and pvphealing.
*Server/Scripts: Fixed an issue after using .reload quest_template that u were unable to earn credit to quests because quest objectives were not updated.
  • Loading branch information
AriDEV committed Feb 27, 2016
2 parents ff40c8c + a2ad018 commit 7775943
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 3 deletions.
4 changes: 4 additions & 0 deletions sql/base/characters_database.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1348,11 +1348,15 @@ CREATE TABLE `character_stats` (
`parryPct` float unsigned NOT NULL DEFAULT '0',
`critPct` float unsigned NOT NULL DEFAULT '0',
`rangedCritPct` float unsigned NOT NULL DEFAULT '0',
`offhandCritPct` float unsigned NOT NULL DEFAULT '0',
`spellCritPct` float unsigned NOT NULL DEFAULT '0',
`attackPower` int(10) unsigned NOT NULL DEFAULT '0',
`rangedAttackPower` int(10) unsigned NOT NULL DEFAULT '0',
`spellPower` int(10) unsigned NOT NULL DEFAULT '0',
`resilience` int(10) unsigned NOT NULL DEFAULT '0',
`mastery` int(10) unsigned NOT NULL DEFAULT '0',
`pvpDamage` int(10) unsigned NOT NULL DEFAULT '0',
`pvpHealing` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`guid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ALTER TABLE `character_stats`
ADD COLUMN `offhandCritPct` FLOAT UNSIGNED NOT NULL DEFAULT '0' AFTER `rangedCritPct`,
ADD COLUMN `mastery` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `resilience`,
ADD COLUMN `pvpDamage` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `mastery`,
ADD COLUMN `pvpHealing` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `pvpDamage`;
7 changes: 6 additions & 1 deletion src/server/game/Entities/Player/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20906,16 +20906,21 @@ void Player::_SaveStats(SQLTransaction& trans)
for (int i = 0; i < MAX_SPELL_SCHOOL; ++i)
stmt->setUInt32(index++, GetResistance(SpellSchools(i)));

stmt->setFloat(index++, GetFloatValue(PLAYER_FIELD_PLAYER_FLAGS));
stmt->setFloat(index++, GetFloatValue(PLAYER_FIELD_BLOCK_PERCENTAGE));
stmt->setFloat(index++, GetFloatValue(PLAYER_FIELD_DODGE_PERCENTAGE));
stmt->setFloat(index++, GetFloatValue(PLAYER_FIELD_PARRY_PERCENTAGE));
stmt->setFloat(index++, GetFloatValue(PLAYER_FIELD_CRIT_PERCENTAGE));
stmt->setFloat(index++, GetFloatValue(PLAYER_FIELD_RANGED_CRIT_PERCENTAGE));
stmt->setFloat(index++, GetFloatValue(PLAYER_FIELD_OFFHAND_CRIT_PERCENTAGE));
stmt->setFloat(index++, GetFloatValue(PLAYER_FIELD_SPELL_CRIT_PERCENTAGE));
stmt->setUInt32(index++, GetUInt32Value(UNIT_FIELD_ATTACK_POWER));
stmt->setUInt32(index++, GetUInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER));
stmt->setUInt32(index++, GetBaseSpellPowerBonus());
stmt->setUInt32(index++, GetUInt32Value(PLAYER_FIELD_COMBAT_RATINGS + CR_RESILIENCE_PLAYER_DAMAGE_TAKEN));
stmt->setUInt32(index++, GetUInt32Value(PLAYER_FIELD_MASTERY));
stmt->setUInt32(index++, GetUInt32Value(PLAYER_FIELD_PVP_POWER_DAMAGE));
stmt->setUInt32(index++, GetUInt32Value(PLAYER_FIELD_PVP_POWER_HEALING));


trans->Append(stmt);
}
Expand Down
3 changes: 3 additions & 0 deletions src/server/scripts/Commands/cs_reload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,9 @@ class reload_commandscript : public CommandScript
sObjectMgr->LoadQuests();
handler->SendGlobalGMSysMessage("DB table `quest_template` (quest definitions) reloaded.");

HandleReloadQuestObjectivesCommand(handler, "a");
HandleReloadQuestObjectiveEffectsCommand(handler, "a");

/// dependent also from `gameobject` but this table not reloaded anyway
TC_LOG_INFO("misc", "Re-Loading GameObjects for quests...");
sObjectMgr->LoadGameObjectForQuests();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -572,8 +572,8 @@ void CharacterDatabaseConnection::DoPrepareStatements()
PrepareStatement(CHAR_INS_CHAR_SPELL, "INSERT INTO character_spell (guid, spell, active, disabled) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC);
PrepareStatement(CHAR_DEL_CHAR_STATS, "DELETE FROM character_stats WHERE guid = ?", CONNECTION_ASYNC);
PrepareStatement(CHAR_INS_CHAR_STATS, "INSERT INTO character_stats (guid, maxhealth, maxpower1, maxpower2, maxpower3, maxpower4, maxpower5, strength, agility, stamina, intellect, spirit, "
"armor, resHoly, resFire, resNature, resFrost, resShadow, resArcane, blockPct, dodgePct, parryPct, critPct, rangedCritPct, spellCritPct, attackPower, rangedAttackPower, "
"spellPower, resilience) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC);
"armor, resHoly, resFire, resNature, resFrost, resShadow, resArcane, blockPct, dodgePct, parryPct, critPct, rangedCritPct, offhandCritPct, spellCritPct, attackPower, rangedAttackPower, "
"spellPower, resilience, mastery, pvpDamage, pvpHealing) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC);
PrepareStatement(CHAR_DEL_PETITION_BY_OWNER, "DELETE FROM petition WHERE ownerguid = ?", CONNECTION_ASYNC);
PrepareStatement(CHAR_DEL_PETITION_SIGNATURE_BY_OWNER, "DELETE FROM petition_sign WHERE ownerguid = ?", CONNECTION_ASYNC);
PrepareStatement(CHAR_DEL_PETITION_BY_OWNER_AND_TYPE, "DELETE FROM petition WHERE ownerguid = ? AND type = ?", CONNECTION_ASYNC);
Expand Down

0 comments on commit 7775943

Please sign in to comment.