Last active
December 15, 2015 16:09
-
-
Save Raydor/5286810 to your computer and use it in GitHub Desktop.
Monturas por cuenta estilo MOP, más información en: http://overwow.com/topic/24-mythcore-monturas-por-cuenta-estilo-mop/ Tipo de Core: Mythcore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a/src/server/game/Entities/Player/Player.cpp 2013-03-08 20:30:35.000000000 +0100 | |
+++b/src/server/game/Entities/Player/Player.cpp 2013-03-11 15:40:07.000000000 +0100 | |
@@ -16984,6 +16996,8 @@ | |
_LoadTalents(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADTALENTS)); | |
_LoadSpells(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADSPELLS)); | |
+ | |
+ _LoadMounts(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADSMOUNT)); | |
_LoadGlyphs(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADGLYPHS)); | |
_LoadAuras(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADAURAS), time_diff); | |
@@ -17850,6 +17864,18 @@ | |
} | |
} | |
+void Player::_LoadMounts(PreparedQueryResult result) | |
+{ | |
+ //QueryResult *result = CharacterDatabase.PQuery("SELECT spell, active, disabled FROM character_mount WHERE `account` = '%u'", GetAccount()); | |
+ | |
+ if(result) | |
+ { | |
+ do | |
+ addSpell((*result)[0].GetUInt32(), (*result)[1].GetBool(), false, false, (*result)[2].GetBool(), true); | |
+ while(result->NextRow()); | |
+ } | |
+} | |
+ | |
void Player::_LoadGroup(PreparedQueryResult result) | |
{ | |
//QueryResult *result = CharacterDatabase.PQuery("SELECT guid FROM group_member WHERE memberGuid=%u", GetGUIDLow()); | |
@@ -18882,8 +18908,17 @@ | |
// add only changed/new not dependent spells | |
if(!itr->second->dependent && (itr->second->state == PLAYERSPELL_NEW || itr->second->state == PLAYERSPELL_CHANGED)) | |
- trans->PAppend("INSERT IGNORE INTO character_spell (guid, spell, active, disabled) VALUES ('%u', '%u', '%u', '%u')", GetGUIDLow(), itr->first, itr->second->active ? 1 : 0, itr->second->disabled ? 1 : 0); | |
- | |
+ { | |
+ bool mount=false; | |
+ SpellEntry const *spellInfo = sSpellStore.LookupEntry(itr->first); | |
+ for(int i = 0; i < MAX_SPELL_EFFECTS; i++) | |
+ if (spellInfo->EffectApplyAuraName[i]==SPELL_AURA_MOUNTED) | |
+ mount=true; | |
+ if(mount) | |
+ trans->PAppend("INSERT IGNORE INTO character_mount (account, spell, active, disabled) VALUES ('%u', '%u', '%u', '%u')", GetSession()->GetAccountId(), itr->first, itr->second->active ? 1 : 0, itr->second->disabled ? 1 : 0); | |
+ else | |
+ trans->PAppend("INSERT IGNORE INTO character_spell (guid, spell, active, disabled) VALUES ('%u', '%u', '%u', '%u')", GetGUIDLow(), itr->first, itr->second->active ? 1 : 0, itr->second->disabled ? 1 : 0); | |
+ } | |
if(itr->second->state == PLAYERSPELL_REMOVED) | |
{ | |
delete itr->second; | |
--- a/src/server/game/Entities/Player/Player.h 2013-03-06 12:50:57.619924945 +0100 | |
+++ b/src/server/game/Entities/Player/Player.h 2013-03-11 15:24:22.000000000 +0100 | |
@@ -822,6 +830,7 @@ | |
PLAYER_LOGIN_QUERY_LOADBANNED = 28, | |
PLAYER_LOGIN_QUERY_LOADQUESTSTATUSREW = 29, | |
PLAYER_LOGIN_QUERY_LOADINSTANCELOCKTIMES = 30, | |
+ PLAYER_LOGIN_QUERY_LOADSMOUNT = 31, | |
MAX_PLAYER_LOGIN_QUERY, | |
}; | |
@@ -2600,6 +2611,7 @@ | |
void _LoadGroup(PreparedQueryResult result); | |
void _LoadSkills(PreparedQueryResult result); | |
void _LoadSpells(PreparedQueryResult result); | |
+ void _LoadMounts(PreparedQueryResult result); | |
void _LoadFriendList(PreparedQueryResult result); | |
bool _LoadHomeBind(PreparedQueryResult result); | |
void _LoadDeclinedNames(PreparedQueryResult result); | |
--- a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp 2013-03-06 12:52:19.975926491 +0100 | |
+++ b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp 2013-03-11 15:24:32.000000000 +0100 | |
@@ -78,6 +78,10 @@ | |
stmt->setUInt32(0, lowGuid); | |
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADSPELLS, stmt); | |
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_PLAYER_MOUNT); | |
+ stmt->setUInt32(0, m_accountId); | |
+ res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADSMOUNT, stmt); | |
+ | |
stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_PLAYER_QUESTSTATUS); | |
stmt->setUInt32(0, lowGuid); | |
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADQUESTSTATUS, stmt); | |
--- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp 2013-03-05 12:01:07.000000000 +0100 | |
+++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp 2013-03-11 15:24:19.000000000 +0100 | |
@@ -42,6 +42,7 @@ | |
PREPARE_STATEMENT(CHAR_LOAD_PLAYER_AURAS, "SELECT caster_guid, spell, effect_mask, recalculate_mask, stackcount, amount0, amount1, amount2, " | |
"base_amount0, base_amount1, base_amount2, maxduration, remaintime, remaincharges FROM character_aura WHERE `guid` = ?", CONNECTION_ASYNC) | |
PREPARE_STATEMENT(CHAR_LOAD_PLAYER_SPELLS, "SELECT spell, active, disabled FROM character_spell WHERE `guid` = ?", CONNECTION_ASYNC) | |
+ PREPARE_STATEMENT(CHAR_LOAD_PLAYER_MOUNT, "SELECT spell, active, disabled FROM character_mount WHERE `account` = ?", CONNECTION_ASYNC) | |
PREPARE_STATEMENT(CHAR_LOAD_PLAYER_QUESTSTATUS, "SELECT quest, status, explored, timer, mobcount1, mobcount2, mobcount3, mobcount4, " | |
"itemcount1, itemcount2, itemcount3, itemcount4 FROM character_queststatus WHERE `guid` = ?", CONNECTION_ASYNC) | |
PREPARE_STATEMENT(CHAR_LOAD_PLAYER_DAILYQUESTSTATUS, "SELECT quest, time FROM character_queststatus_daily WHERE `guid` = ?", CONNECTION_ASYNC) | |
--- a/src/server/shared/Database/Implementation/CharacterDatabase.h 2013-03-05 12:01:07.000000000 +0100 | |
+++ b/src/server/shared/Database/Implementation/CharacterDatabase.h 2013-03-11 15:24:27.000000000 +0100 | |
@@ -56,6 +56,7 @@ | |
CHAR_LOAD_PLAYER_BOUNDINSTANCES, | |
CHAR_LOAD_PLAYER_AURAS, | |
CHAR_LOAD_PLAYER_SPELLS, | |
+ CHAR_LOAD_PLAYER_MOUNT, | |
CHAR_LOAD_PLAYER_QUESTSTATUS, | |
CHAR_LOAD_PLAYER_DAILYQUESTSTATUS, | |
CHAR_LOAD_PLAYER_WEKLYQUESTSTATUS, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment