mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 10:37:03 +00:00
Mage 400 INTO master/434
Signed-off-by: Salja <salja2012@hotmail.de>
This commit is contained in:
parent
7665a09232
commit
22bfaa12b0
66 changed files with 5773 additions and 3971 deletions
|
|
@ -91,7 +91,9 @@ LanguageDesc lang_description[LANGUAGES_COUNT] =
|
|||
{ LANG_DRAENEI, 29932, SKILL_LANG_DRAENEI },
|
||||
{ LANG_ZOMBIE, 0, 0 },
|
||||
{ LANG_GNOMISH_BINARY, 0, 0 },
|
||||
{ LANG_GOBLIN_BINARY, 0, 0 }
|
||||
{ LANG_GOBLIN_BINARY, 0, 0 },
|
||||
{ LANG_WORGEN, 69270, SKILL_LANG_WORGEN },
|
||||
{ LANG_GOBLIN, 69269, SKILL_LANG_GOBLIN }
|
||||
};
|
||||
|
||||
LanguageDesc const* GetLanguageDescByID(uint32 lang)
|
||||
|
|
@ -842,30 +844,31 @@ void ObjectMgr::LoadEquipmentTemplates()
|
|||
for (uint8 j = 0; j < 3; ++j)
|
||||
{
|
||||
if (!eqInfo->equipentry[j])
|
||||
continue;
|
||||
continue;
|
||||
|
||||
ItemEntry const* dbcitem = sItemStore.LookupEntry(eqInfo->equipentry[j]);
|
||||
if (!dbcitem)
|
||||
{
|
||||
sLog.outErrorDb("Unknown item (entry=%u) in creature_equip_template.equipentry%u for entry = %u, forced to 0.", eqInfo->equipentry[j], j + 1, i);
|
||||
const_cast<EquipmentInfo*>(eqInfo)->equipentry[j] = 0;
|
||||
continue;
|
||||
}
|
||||
//ItemEntry const *dbcitem = sItemStore.LookupEntry(eqInfo->equipentry[j]);
|
||||
|
||||
if (dbcitem->InventoryType != INVTYPE_WEAPON &&
|
||||
dbcitem->InventoryType != INVTYPE_SHIELD &&
|
||||
dbcitem->InventoryType != INVTYPE_RANGED &&
|
||||
dbcitem->InventoryType != INVTYPE_2HWEAPON &&
|
||||
dbcitem->InventoryType != INVTYPE_WEAPONMAINHAND &&
|
||||
dbcitem->InventoryType != INVTYPE_WEAPONOFFHAND &&
|
||||
dbcitem->InventoryType != INVTYPE_HOLDABLE &&
|
||||
dbcitem->InventoryType != INVTYPE_THROWN &&
|
||||
dbcitem->InventoryType != INVTYPE_RANGEDRIGHT &&
|
||||
dbcitem->InventoryType != INVTYPE_RELIC)
|
||||
{
|
||||
sLog.outErrorDb("Item (entry=%u) in creature_equip_template.equipentry%u for entry = %u is not equipable in a hand, forced to 0.", eqInfo->equipentry[j], j + 1, i);
|
||||
const_cast<EquipmentInfo*>(eqInfo)->equipentry[j] = 0;
|
||||
}
|
||||
//if (!dbcitem)
|
||||
//{
|
||||
// sLog.outErrorDb("Unknown item (entry=%u) in creature_equip_template.equipentry%u for entry = %u, forced to 0.", eqInfo->equipentry[j], j+1, i);
|
||||
// const_cast<EquipmentInfo*>(eqInfo)->equipentry[j] = 0;
|
||||
// continue;
|
||||
//}
|
||||
|
||||
//if (dbcitem->InventoryType != INVTYPE_WEAPON &&
|
||||
// dbcitem->InventoryType != INVTYPE_SHIELD &&
|
||||
// dbcitem->InventoryType != INVTYPE_RANGED &&
|
||||
// dbcitem->InventoryType != INVTYPE_2HWEAPON &&
|
||||
// dbcitem->InventoryType != INVTYPE_WEAPONMAINHAND &&
|
||||
// dbcitem->InventoryType != INVTYPE_WEAPONOFFHAND &&
|
||||
// dbcitem->InventoryType != INVTYPE_HOLDABLE &&
|
||||
// dbcitem->InventoryType != INVTYPE_THROWN &&
|
||||
// dbcitem->InventoryType != INVTYPE_RANGEDRIGHT &&
|
||||
// dbcitem->InventoryType != INVTYPE_RELIC)
|
||||
//{
|
||||
// sLog.outErrorDb("Item (entry=%u) in creature_equip_template.equipentry%u for entry = %u is not equipable in a hand, forced to 0.", eqInfo->equipentry[j], j+1, i);
|
||||
// const_cast<EquipmentInfo*>(eqInfo)->equipentry[j] = 0;
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1790,8 +1793,8 @@ void ObjectMgr::LoadItemPrototypes()
|
|||
for (uint32 i = 1; i < sItemStorage.MaxEntry; ++i)
|
||||
{
|
||||
ItemPrototype const* proto = sItemStorage.LookupEntry<ItemPrototype >(i);
|
||||
ItemEntry const* dbcitem = sItemStore.LookupEntry(i);
|
||||
if (!proto)
|
||||
//ItemEntry const *dbcitem = sItemStore.LookupEntry(i);
|
||||
if(!proto)
|
||||
{
|
||||
/* to many errors, and possible not all items really used in game
|
||||
if (dbcitem)
|
||||
|
|
@ -1800,13 +1803,13 @@ void ObjectMgr::LoadItemPrototypes()
|
|||
continue;
|
||||
}
|
||||
|
||||
if (dbcitem)
|
||||
if(true/*dbcitem*/)
|
||||
{
|
||||
if (proto->Class != dbcitem->Class)
|
||||
{
|
||||
sLog.outErrorDb("Item (Entry: %u) not correct class %u, must be %u (still using DB value).", i, proto->Class, dbcitem->Class);
|
||||
// It safe let use Class from DB
|
||||
}
|
||||
//if(proto->Class != dbcitem->Class)
|
||||
//{
|
||||
// sLog.outErrorDb("Item (Entry: %u) not correct class %u, must be %u (still using DB value).",i,proto->Class,dbcitem->Class);
|
||||
// // It safe let use Class from DB
|
||||
//}
|
||||
/* disabled: have some strange wrong cases for Subclass values.
|
||||
for enable also uncomment Subclass field in ItemEntry structure and in Itemfmt[]
|
||||
if(proto->SubClass != dbcitem->SubClass)
|
||||
|
|
@ -1816,34 +1819,34 @@ void ObjectMgr::LoadItemPrototypes()
|
|||
}
|
||||
*/
|
||||
|
||||
if (proto->Unk0 != dbcitem->Unk0)
|
||||
{
|
||||
sLog.outErrorDb("Item (Entry: %u) not correct %i Unk0, must be %i (still using DB value).", i, proto->Unk0, dbcitem->Unk0);
|
||||
// It safe let use Unk0 from DB
|
||||
}
|
||||
//if(proto->Unk0 != dbcitem->Unk0)
|
||||
//{
|
||||
// sLog.outErrorDb("Item (Entry: %u) not correct %i Unk0, must be %i (still using DB value).",i,proto->Unk0,dbcitem->Unk0);
|
||||
// // It safe let use Unk0 from DB
|
||||
//}
|
||||
|
||||
if (proto->Material != dbcitem->Material)
|
||||
{
|
||||
sLog.outErrorDb("Item (Entry: %u) not correct %i material, must be %i (still using DB value).", i, proto->Material, dbcitem->Material);
|
||||
// It safe let use Material from DB
|
||||
}
|
||||
//if(proto->Material != dbcitem->Material)
|
||||
//{
|
||||
// sLog.outErrorDb("Item (Entry: %u) not correct %i material, must be %i (still using DB value).",i,proto->Material,dbcitem->Material);
|
||||
// // It safe let use Material from DB
|
||||
//}
|
||||
|
||||
if (proto->InventoryType != dbcitem->InventoryType)
|
||||
{
|
||||
sLog.outErrorDb("Item (Entry: %u) not correct %u inventory type, must be %u (still using DB value).", i, proto->InventoryType, dbcitem->InventoryType);
|
||||
// It safe let use InventoryType from DB
|
||||
}
|
||||
//if(proto->InventoryType != dbcitem->InventoryType)
|
||||
//{
|
||||
// sLog.outErrorDb("Item (Entry: %u) not correct %u inventory type, must be %u (still using DB value).",i,proto->InventoryType,dbcitem->InventoryType);
|
||||
// // It safe let use InventoryType from DB
|
||||
//}
|
||||
|
||||
if (proto->DisplayInfoID != dbcitem->DisplayId)
|
||||
{
|
||||
sLog.outErrorDb("Item (Entry: %u) not correct %u display id, must be %u (using it).", i, proto->DisplayInfoID, dbcitem->DisplayId);
|
||||
const_cast<ItemPrototype*>(proto)->DisplayInfoID = dbcitem->DisplayId;
|
||||
}
|
||||
if (proto->Sheath != dbcitem->Sheath)
|
||||
{
|
||||
sLog.outErrorDb("Item (Entry: %u) not correct %u sheath, must be %u (using it).", i, proto->Sheath, dbcitem->Sheath);
|
||||
const_cast<ItemPrototype*>(proto)->Sheath = dbcitem->Sheath;
|
||||
}
|
||||
//if(proto->DisplayInfoID != dbcitem->DisplayId)
|
||||
//{
|
||||
// sLog.outErrorDb("Item (Entry: %u) not correct %u display id, must be %u (using it).",i,proto->DisplayInfoID,dbcitem->DisplayId);
|
||||
// const_cast<ItemPrototype*>(proto)->DisplayInfoID = dbcitem->DisplayId;
|
||||
//}
|
||||
//if(proto->Sheath != dbcitem->Sheath)
|
||||
//{
|
||||
// sLog.outErrorDb("Item (Entry: %u) not correct %u sheath, must be %u (using it).",i,proto->Sheath,dbcitem->Sheath);
|
||||
// const_cast<ItemPrototype*>(proto)->Sheath = dbcitem->Sheath;
|
||||
//}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -2214,15 +2217,15 @@ void ObjectMgr::LoadItemPrototypes()
|
|||
continue;
|
||||
}
|
||||
|
||||
if (BAG_FAMILY_MASK_CURRENCY_TOKENS & mask)
|
||||
{
|
||||
CurrencyTypesEntry const* ctEntry = sCurrencyTypesStore.LookupEntry(proto->ItemId);
|
||||
if (!ctEntry)
|
||||
{
|
||||
sLog.outErrorDb("Item (Entry: %u) has currency bag family bit set in BagFamily but not listed in CurrencyTypes.dbc, remove bit", i);
|
||||
const_cast<ItemPrototype*>(proto)->BagFamily &= ~mask;
|
||||
}
|
||||
}
|
||||
//if(BAG_FAMILY_MASK_CURRENCY_TOKENS & mask)
|
||||
//{
|
||||
// CurrencyTypesEntry const* ctEntry = sCurrencyTypesStore.LookupEntry(proto->ItemId);
|
||||
// if(!ctEntry)
|
||||
// {
|
||||
// sLog.outErrorDb("Item (Entry: %u) has currency bag family bit set in BagFamily but not listed in CurrencyTypes.dbc, remove bit",i);
|
||||
// const_cast<ItemPrototype*>(proto)->BagFamily &= ~mask;
|
||||
// }
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2545,10 +2548,14 @@ void ObjectMgr::LoadItemRequiredTarget()
|
|||
|
||||
for (int j = 0; j < MAX_EFFECT_INDEX; ++j)
|
||||
{
|
||||
if (pSpellInfo->EffectImplicitTargetA[j] == TARGET_CHAIN_DAMAGE ||
|
||||
pSpellInfo->EffectImplicitTargetB[j] == TARGET_CHAIN_DAMAGE ||
|
||||
pSpellInfo->EffectImplicitTargetA[j] == TARGET_DUELVSPLAYER ||
|
||||
pSpellInfo->EffectImplicitTargetB[j] == TARGET_DUELVSPLAYER)
|
||||
SpellEffectEntry const* spellEffect = pSpellInfo->GetSpellEffect(SpellEffectIndex(j));
|
||||
if(!pSpellInfo)
|
||||
continue;
|
||||
|
||||
if (spellEffect->EffectImplicitTargetA == TARGET_CHAIN_DAMAGE ||
|
||||
spellEffect->EffectImplicitTargetB == TARGET_CHAIN_DAMAGE ||
|
||||
spellEffect->EffectImplicitTargetA == TARGET_DUELVSPLAYER ||
|
||||
spellEffect->EffectImplicitTargetB == TARGET_DUELVSPLAYER)
|
||||
{
|
||||
bIsItemSpellValid = true;
|
||||
break;
|
||||
|
|
@ -4010,8 +4017,12 @@ void ObjectMgr::LoadQuests()
|
|||
bool found = false;
|
||||
for (int k = 0; k < MAX_EFFECT_INDEX; ++k)
|
||||
{
|
||||
if ((spellInfo->Effect[k] == SPELL_EFFECT_QUEST_COMPLETE && uint32(spellInfo->EffectMiscValue[k]) == qinfo->QuestId) ||
|
||||
spellInfo->Effect[k] == SPELL_EFFECT_SEND_EVENT)
|
||||
SpellEffectEntry const* spellEffect = spellInfo->GetSpellEffect(SpellEffectIndex(k));
|
||||
if(!spellEffect)
|
||||
continue;
|
||||
|
||||
if ((spellEffect->Effect == SPELL_EFFECT_QUEST_COMPLETE && uint32(spellEffect->EffectMiscValue) == qinfo->QuestId) ||
|
||||
spellEffect->Effect == SPELL_EFFECT_SEND_EVENT)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
|
|
@ -4286,10 +4297,13 @@ void ObjectMgr::LoadQuests()
|
|||
|
||||
for (int j = 0; j < MAX_EFFECT_INDEX; ++j)
|
||||
{
|
||||
if (spellInfo->Effect[j] != SPELL_EFFECT_QUEST_COMPLETE)
|
||||
SpellEffectEntry const* spellEffect = spellInfo->GetSpellEffect(SpellEffectIndex(j));
|
||||
if(!spellEffect)
|
||||
continue;
|
||||
if (spellEffect->Effect != SPELL_EFFECT_QUEST_COMPLETE)
|
||||
continue;
|
||||
|
||||
uint32 quest_id = spellInfo->EffectMiscValue[j];
|
||||
uint32 quest_id = spellEffect->EffectMiscValue;
|
||||
|
||||
Quest const* quest = GetQuestTemplate(quest_id);
|
||||
|
||||
|
|
@ -6819,59 +6833,6 @@ void ObjectMgr::LoadNPCSpellClickSpells()
|
|||
sLog.outString(">> Loaded %u spellclick definitions", count);
|
||||
}
|
||||
|
||||
static char* SERVER_SIDE_SPELL = "MaNGOS server-side spell";
|
||||
|
||||
struct SQLSpellLoader : public SQLStorageLoaderBase<SQLSpellLoader>
|
||||
{
|
||||
template<class S, class D>
|
||||
void default_fill(uint32 field_pos, S src, D& dst)
|
||||
{
|
||||
if (field_pos == LOADED_SPELLDBC_FIELD_POS_EQUIPPED_ITEM_CLASS)
|
||||
dst = D(-1);
|
||||
else
|
||||
dst = D(src);
|
||||
}
|
||||
|
||||
void default_fill_to_str(uint32 field_pos, char const* /*src*/, char*& dst)
|
||||
{
|
||||
if (field_pos == LOADED_SPELLDBC_FIELD_POS_SPELLNAME_0)
|
||||
{
|
||||
dst = SERVER_SIDE_SPELL;
|
||||
}
|
||||
else
|
||||
{
|
||||
dst = new char[1];
|
||||
*dst = 0;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
void ObjectMgr::LoadSpellTemplate()
|
||||
{
|
||||
SQLSpellLoader loader;
|
||||
loader.Load(sSpellTemplate);
|
||||
|
||||
sLog.outString(">> Loaded %u spell definitions", sSpellTemplate.RecordCount);
|
||||
sLog.outString();
|
||||
|
||||
for (uint32 i = 1; i < sSpellTemplate.MaxEntry; ++i)
|
||||
{
|
||||
// check data correctness
|
||||
SpellEntry const* spellEntry = sSpellTemplate.LookupEntry<SpellEntry>(i);
|
||||
if (!spellEntry)
|
||||
continue;
|
||||
|
||||
// insert serverside spell data
|
||||
if (sSpellStore.GetNumRows() <= i)
|
||||
{
|
||||
sLog.outErrorDb("Loading Spell Template for spell %u, index out of bounds (max = %u)", i, sSpellStore.GetNumRows());
|
||||
continue;
|
||||
}
|
||||
else
|
||||
sSpellStore.InsertEntry(const_cast<SpellEntry*>(spellEntry), i);
|
||||
}
|
||||
}
|
||||
|
||||
void ObjectMgr::LoadWeatherZoneChances()
|
||||
{
|
||||
uint32 count = 0;
|
||||
|
|
@ -8490,15 +8451,23 @@ void ObjectMgr::LoadTrainers(char const* tableName, bool isTemplates)
|
|||
trainerSpell.learnedSpell = spell;
|
||||
for (int i = 0; i < MAX_EFFECT_INDEX; ++i)
|
||||
{
|
||||
if (spellinfo->Effect[i] == SPELL_EFFECT_LEARN_SPELL &&
|
||||
SpellMgr::IsProfessionOrRidingSpell(spellinfo->EffectTriggerSpell[i]))
|
||||
SpellEffectEntry const* spellEffect = spellinfo->GetSpellEffect(SpellEffectIndex(i));
|
||||
if (!spellEffect)
|
||||
continue;
|
||||
|
||||
if (spellEffect->Effect == SPELL_EFFECT_LEARN_SPELL &&
|
||||
SpellMgr::IsProfessionOrRidingSpell(spellEffect->EffectTriggerSpell))
|
||||
{
|
||||
// prof spells sometime only additions to main spell learn that have level data
|
||||
for (int j = 0; j < MAX_EFFECT_INDEX; ++j)
|
||||
{
|
||||
if (spellinfo->Effect[j] == SPELL_EFFECT_LEARN_SPELL)
|
||||
SpellEffectEntry const* spellEff = spellinfo->GetSpellEffect(SpellEffectIndex(j));
|
||||
if (!spellEff)
|
||||
continue;
|
||||
|
||||
if (spellEff->Effect == SPELL_EFFECT_LEARN_SPELL)
|
||||
{
|
||||
trainerSpell.learnedSpell = spellinfo->EffectTriggerSpell[j];
|
||||
trainerSpell.learnedSpell = spellEff->EffectTriggerSpell;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -8528,11 +8497,11 @@ void ObjectMgr::LoadTrainers(char const* tableName, bool isTemplates)
|
|||
{
|
||||
if (trainerSpell.reqLevel)
|
||||
{
|
||||
if (trainerSpell.reqLevel == learnSpellinfo->spellLevel)
|
||||
if (trainerSpell.reqLevel == learnSpellinfo->GetSpellLevel())
|
||||
ERROR_DB_STRICT_LOG("Table `%s` (Entry: %u) has redundant reqlevel %u (=spell level) for spell %u", tableName, entry, trainerSpell.reqLevel, spell);
|
||||
}
|
||||
else
|
||||
trainerSpell.reqLevel = learnSpellinfo->spellLevel;
|
||||
trainerSpell.reqLevel = learnSpellinfo->GetSpellLevel();
|
||||
}
|
||||
|
||||
++count;
|
||||
|
|
@ -9106,7 +9075,7 @@ bool ObjectMgr::IsVendorItemValid(bool isTemplate, char const* tableName, uint32
|
|||
return false;
|
||||
}
|
||||
|
||||
if (ExtendedCost && !sItemExtendedCostStore.LookupEntry(ExtendedCost))
|
||||
/*if (ExtendedCost && !sItemExtendedCostStore.LookupEntry(ExtendedCost))
|
||||
{
|
||||
if (pl)
|
||||
ChatHandler(pl).PSendSysMessage(LANG_EXTENDED_COST_NOT_EXIST, ExtendedCost);
|
||||
|
|
@ -9114,7 +9083,7 @@ bool ObjectMgr::IsVendorItemValid(bool isTemplate, char const* tableName, uint32
|
|||
sLog.outErrorDb("Table `%s` contain item (Entry: %u) with wrong ExtendedCost (%u) for %s %u, ignoring",
|
||||
tableName, item_id, ExtendedCost, idStr, vendor_entry);
|
||||
return false;
|
||||
}
|
||||
}*/
|
||||
|
||||
if (maxcount > 0 && incrtime == 0)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue