mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 10:37:02 +00:00
[9496] HomeBind fixes.
* Use area id instead zone id for home bind zone info as expected. This will for example proper show capital name in area himebinding for capital; tavern. * Clarify that player create zone in fact is area (subzone) * Implement SPELL_EFFECT_BIND for normal homebinding. Also support spell target position mode used in 53823/53821 spells * Add Spell::EffectEmpty for mark spell effects that used but not expect any code in handler. Example weapon spells that used just as known spell markers for client. Original patch idea inspirit by Sadikum patch suggestion.
This commit is contained in:
parent
aa13458b69
commit
4a051e2443
9 changed files with 116 additions and 66 deletions
|
|
@ -795,7 +795,7 @@ void SpellMgr::LoadSpellTargetPositions()
|
|||
|
||||
// 0 1 2 3 4 5
|
||||
QueryResult *result = WorldDatabase.Query("SELECT id, target_map, target_position_x, target_position_y, target_position_z, target_orientation FROM spell_target_position");
|
||||
if( !result )
|
||||
if (!result)
|
||||
{
|
||||
|
||||
barGoLink bar( 1 );
|
||||
|
|
@ -807,7 +807,7 @@ void SpellMgr::LoadSpellTargetPositions()
|
|||
return;
|
||||
}
|
||||
|
||||
barGoLink bar( (int)result->GetRowCount() );
|
||||
barGoLink bar((int)result->GetRowCount());
|
||||
|
||||
do
|
||||
{
|
||||
|
|
@ -825,8 +825,21 @@ void SpellMgr::LoadSpellTargetPositions()
|
|||
st.target_Z = fields[4].GetFloat();
|
||||
st.target_Orientation = fields[5].GetFloat();
|
||||
|
||||
MapEntry const* mapEntry = sMapStore.LookupEntry(st.target_mapId);
|
||||
if (!mapEntry)
|
||||
{
|
||||
sLog.outErrorDb("Spell (ID:%u) target map (ID: %u) does not exist in `Map.dbc`.",Spell_ID,st.target_mapId);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (st.target_X==0 && st.target_Y==0 && st.target_Z==0)
|
||||
{
|
||||
sLog.outErrorDb("Spell (ID:%u) target coordinates not provided.",Spell_ID);
|
||||
continue;
|
||||
}
|
||||
|
||||
SpellEntry const* spellInfo = sSpellStore.LookupEntry(Spell_ID);
|
||||
if(!spellInfo)
|
||||
if (!spellInfo)
|
||||
{
|
||||
sLog.outErrorDb("Spell (ID:%u) listed in `spell_target_position` does not exist.",Spell_ID);
|
||||
continue;
|
||||
|
|
@ -835,31 +848,29 @@ void SpellMgr::LoadSpellTargetPositions()
|
|||
bool found = false;
|
||||
for(int i = 0; i < MAX_EFFECT_INDEX; ++i)
|
||||
{
|
||||
if( spellInfo->EffectImplicitTargetA[i]==TARGET_TABLE_X_Y_Z_COORDINATES || spellInfo->EffectImplicitTargetB[i]==TARGET_TABLE_X_Y_Z_COORDINATES )
|
||||
if (spellInfo->EffectImplicitTargetA[i]==TARGET_TABLE_X_Y_Z_COORDINATES || spellInfo->EffectImplicitTargetB[i]==TARGET_TABLE_X_Y_Z_COORDINATES)
|
||||
{
|
||||
// additional requirements
|
||||
if (spellInfo->Effect[i]==SPELL_EFFECT_BIND && spellInfo->EffectMiscValue[i])
|
||||
{
|
||||
uint32 zone_id = sMapMgr.GetAreaId(st.target_mapId, st.target_X, st.target_Y, st.target_Z);
|
||||
if (zone_id != spellInfo->EffectMiscValue[i])
|
||||
{
|
||||
sLog.outErrorDb("Spell (Id: %u) listed in `spell_target_position` expected point to zone %u bit point to zone %u.",Spell_ID, spellInfo->EffectMiscValue[i], zone_id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!found)
|
||||
if (!found)
|
||||
{
|
||||
sLog.outErrorDb("Spell (Id: %u) listed in `spell_target_position` does not have target TARGET_TABLE_X_Y_Z_COORDINATES (17).",Spell_ID);
|
||||
continue;
|
||||
}
|
||||
|
||||
MapEntry const* mapEntry = sMapStore.LookupEntry(st.target_mapId);
|
||||
if(!mapEntry)
|
||||
{
|
||||
sLog.outErrorDb("Spell (ID:%u) target map (ID: %u) does not exist in `Map.dbc`.",Spell_ID,st.target_mapId);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(st.target_X==0 && st.target_Y==0 && st.target_Z==0)
|
||||
{
|
||||
sLog.outErrorDb("Spell (ID:%u) target coordinates not provided.",Spell_ID);
|
||||
continue;
|
||||
}
|
||||
|
||||
mSpellTargetPositions[Spell_ID] = st;
|
||||
++count;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue