* Huge merge with original branch

--HG--
branch : trunk
This commit is contained in:
Drahy
2009-02-04 22:08:23 +01:00
371 changed files with 3181 additions and 2789 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
CREATE TABLE `game_event_battleground_holiday` ( CREATE TABLE `game_event_battleground_holiday` (
`event` int(10) unsigned NOT NULL, `event` int(10) unsigned NOT NULL,
`bgflag` int(10) unsigned NOT NULL default '0', `bgflag` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`event`) PRIMARY KEY (`event`)
+2 -2
View File
@@ -76,7 +76,7 @@ SET(game_STAT_SRCS
Creature.h Creature.h
CreatureGroups.cpp CreatureGroups.cpp
CreatureGroups.h CreatureGroups.h
debugcmds.cpp Debugcmds.cpp
DestinationHolder.cpp DestinationHolder.cpp
DestinationHolder.h DestinationHolder.h
DestinationHolderImp.h DestinationHolderImp.h
@@ -236,7 +236,7 @@ SET(game_STAT_SRCS
TicketHandler.cpp TicketHandler.cpp
TicketMgr.cpp TicketMgr.cpp
TicketMgr.h TicketMgr.h
tools.cpp Tools.cpp
Tools.h Tools.h
TotemAI.cpp TotemAI.cpp
TotemAI.h TotemAI.h
+1
View File
@@ -71,6 +71,7 @@ class ChatHandler
std::string PGetParseString(int32 entry, ...); std::string PGetParseString(int32 entry, ...);
int ParseCommands(const char* text); int ParseCommands(const char* text);
protected: protected:
explicit ChatHandler() : m_session(NULL) {} // for CLI subclass explicit ChatHandler() : m_session(NULL) {} // for CLI subclass
-1
View File
@@ -677,7 +677,6 @@ class TRINITY_DLL_SPEC Creature : public Unit
bool m_AlreadyCallAssistance; bool m_AlreadyCallAssistance;
bool m_regenHealth; bool m_regenHealth;
bool m_AI_locked; bool m_AI_locked;
bool m_AI_enabled;
bool m_isDeadByDefault; bool m_isDeadByDefault;
SpellSchoolMask m_meleeDamageSchoolMask; SpellSchoolMask m_meleeDamageSchoolMask;
+1 -1
View File
@@ -288,7 +288,7 @@ void Item::UpdateDuration(Player* owner, uint32 diff)
} }
SetUInt32Value(ITEM_FIELD_DURATION, GetUInt32Value(ITEM_FIELD_DURATION) - diff); SetUInt32Value(ITEM_FIELD_DURATION, GetUInt32Value(ITEM_FIELD_DURATION) - diff);
SetState(ITEM_CHANGED); // save new time in database SetState(ITEM_CHANGED, owner); // save new time in database
} }
void Item::SaveToDB() void Item::SaveToDB()
+2
View File
@@ -167,6 +167,8 @@ enum EnchantmentSlot
#define MAX_VISIBLE_ITEM_OFFSET 18 // 18 fields per visible item (creator(2) + enchantments(13) + properties(1) + seed(1) + pad(1)) #define MAX_VISIBLE_ITEM_OFFSET 18 // 18 fields per visible item (creator(2) + enchantments(13) + properties(1) + seed(1) + pad(1))
#define MAX_GEM_SOCKETS 3 // (BONUS_ENCHANTMENT_SLOT-SOCK_ENCHANTMENT_SLOT)
enum EnchantmentOffset enum EnchantmentOffset
{ {
ENCHANTMENT_ID_OFFSET = 0, ENCHANTMENT_ID_OFFSET = 0,
+53 -28
View File
@@ -1111,55 +1111,80 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data)
{ {
sLog.outDebug("WORLD: CMSG_SOCKET_GEMS"); sLog.outDebug("WORLD: CMSG_SOCKET_GEMS");
CHECK_PACKET_SIZE(recv_data,8*4); CHECK_PACKET_SIZE(recv_data,8+8*MAX_GEM_SOCKETS);
uint64 guids[4]; uint64 item_guid;
for(int i = 0; i < 4; i++) uint64 gem_guids[MAX_GEM_SOCKETS];
recv_data >> guids[i];
if(!guids[0]) recv_data >> item_guid;
if(!item_guid)
return; return;
for(int i = 0; i < MAX_GEM_SOCKETS; ++i)
recv_data >> gem_guids[i];
//cheat -> tried to socket same gem multiple times //cheat -> tried to socket same gem multiple times
if((guids[1] && (guids[1] == guids[2] || guids[1] == guids[3])) || (guids[2] && (guids[2] == guids[3]))) if ((gem_guids[0] && (gem_guids[0] == gem_guids[1] || gem_guids[0] == gem_guids[2])) ||
(gem_guids[1] && (gem_guids[1] == gem_guids[2])))
return; return;
Item *itemTarget = _player->GetItemByGuid(guids[0]); Item *itemTarget = _player->GetItemByGuid(item_guid);
if(!itemTarget) //missing item to socket if(!itemTarget) //missing item to socket
return; return;
ItemPrototype const* itemProto = itemTarget->GetProto();
if(!itemProto)
return;
//this slot is excepted when applying / removing meta gem bonus //this slot is excepted when applying / removing meta gem bonus
uint8 slot = itemTarget->IsEquipped() ? itemTarget->GetSlot() : NULL_SLOT; uint8 slot = itemTarget->IsEquipped() ? itemTarget->GetSlot() : NULL_SLOT;
Item *Gems[3]; Item *Gems[MAX_GEM_SOCKETS];
for(int i = 0; i < 3; i++) for(int i = 0; i < MAX_GEM_SOCKETS; ++i)
Gems[i] = guids[i + 1] ? _player->GetItemByGuid(guids[i + 1]) : NULL; Gems[i] = gem_guids[i] ? _player->GetItemByGuid(gem_guids[i]) : NULL;
GemPropertiesEntry const *GemProps[3]; GemPropertiesEntry const *GemProps[MAX_GEM_SOCKETS];
for(int i = 0; i < 3; ++i) //get geminfo from dbc storage for(int i = 0; i < MAX_GEM_SOCKETS; ++i) //get geminfo from dbc storage
{
GemProps[i] = (Gems[i]) ? sGemPropertiesStore.LookupEntry(Gems[i]->GetProto()->GemProperties) : NULL; GemProps[i] = (Gems[i]) ? sGemPropertiesStore.LookupEntry(Gems[i]->GetProto()->GemProperties) : NULL;
}
for(int i = 0; i < 3; ++i) //check for hack maybe for(int i = 0; i < MAX_GEM_SOCKETS; ++i) //check for hack maybe
{ {
// tried to put gem in socket where no socket exists / tried to put normal gem in meta socket if (!GemProps[i])
continue;
// tried to put gem in socket where no socket exists (take care about prismatic sockets)
if (!itemProto->Socket[i].Color)
{
// no prismatic socket
if(!itemTarget->GetEnchantmentId(PRISMATIC_ENCHANTMENT_SLOT))
return;
// not first not-colored (not normaly used) socket
if(i!=0 && !itemProto->Socket[i-1].Color && (i+1 >= MAX_GEM_SOCKETS || itemProto->Socket[i+1].Color))
return;
// ok, this is first not colored socket for item with prismatic socket
}
// tried to put normal gem in meta socket
if (itemProto->Socket[i].Color == SOCKET_COLOR_META && GemProps[i]->color != SOCKET_COLOR_META)
return;
// tried to put meta gem in normal socket // tried to put meta gem in normal socket
if( GemProps[i] && ( !itemTarget->GetProto()->Socket[i].Color || if (itemProto->Socket[i].Color != SOCKET_COLOR_META && GemProps[i]->color == SOCKET_COLOR_META)
itemTarget->GetProto()->Socket[i].Color == SOCKET_COLOR_META && GemProps[i]->color != SOCKET_COLOR_META ||
itemTarget->GetProto()->Socket[i].Color != SOCKET_COLOR_META && GemProps[i]->color == SOCKET_COLOR_META ) )
return; return;
} }
uint32 GemEnchants[3], OldEnchants[3]; uint32 GemEnchants[MAX_GEM_SOCKETS];
for(int i = 0; i < 3; ++i) //get new and old enchantments uint32 OldEnchants[MAX_GEM_SOCKETS];
for(int i = 0; i < MAX_GEM_SOCKETS; ++i) //get new and old enchantments
{ {
GemEnchants[i] = (GemProps[i]) ? GemProps[i]->spellitemenchantement : 0; GemEnchants[i] = (GemProps[i]) ? GemProps[i]->spellitemenchantement : 0;
OldEnchants[i] = itemTarget->GetEnchantmentId(EnchantmentSlot(SOCK_ENCHANTMENT_SLOT+i)); OldEnchants[i] = itemTarget->GetEnchantmentId(EnchantmentSlot(SOCK_ENCHANTMENT_SLOT+i));
} }
// check unique-equipped conditions // check unique-equipped conditions
for(int i = 0; i < 3; ++i) for(int i = 0; i < MAX_GEM_SOCKETS; ++i)
{ {
if (Gems[i] && (Gems[i]->GetProto()->Flags & ITEM_FLAGS_UNIQUE_EQUIPPED)) if (Gems[i] && (Gems[i]->GetProto()->Flags & ITEM_FLAGS_UNIQUE_EQUIPPED))
{ {
@@ -1174,7 +1199,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data)
} }
// continue check for case when attempt add 2 similar unique equipped gems in one item. // continue check for case when attempt add 2 similar unique equipped gems in one item.
for (int j = 0; j < 3; ++j) for (int j = 0; j < MAX_GEM_SOCKETS; ++j)
{ {
if ((i != j) && (Gems[j]) && (Gems[i]->GetProto()->ItemId == Gems[j]->GetProto()->ItemId)) if ((i != j) && (Gems[j]) && (Gems[i]->GetProto()->ItemId == Gems[j]->GetProto()->ItemId))
{ {
@@ -1182,7 +1207,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data)
return; return;
} }
} }
for (int j = 0; j < 3; ++j) for (int j = 0; j < MAX_GEM_SOCKETS; ++j)
{ {
if (OldEnchants[j]) if (OldEnchants[j])
{ {
@@ -1206,20 +1231,20 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data)
//if a meta gem is being equipped, all information has to be written to the item before testing if the conditions for the gem are met //if a meta gem is being equipped, all information has to be written to the item before testing if the conditions for the gem are met
//remove ALL enchants //remove ALL enchants
for(uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+3; ++enchant_slot) for(uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+MAX_GEM_SOCKETS; ++enchant_slot)
_player->ApplyEnchantment(itemTarget,EnchantmentSlot(enchant_slot),false); _player->ApplyEnchantment(itemTarget,EnchantmentSlot(enchant_slot),false);
for(int i = 0; i < 3; ++i) for(int i = 0; i < MAX_GEM_SOCKETS; ++i)
{ {
if(GemEnchants[i]) if(GemEnchants[i])
{ {
itemTarget->SetEnchantment(EnchantmentSlot(SOCK_ENCHANTMENT_SLOT+i), GemEnchants[i],0,0); itemTarget->SetEnchantment(EnchantmentSlot(SOCK_ENCHANTMENT_SLOT+i), GemEnchants[i],0,0);
if(Item* guidItem = _player->GetItemByGuid(guids[i + 1])) if(Item* guidItem = _player->GetItemByGuid(gem_guids[i]))
_player->DestroyItem(guidItem->GetBagSlot(), guidItem->GetSlot(), true ); _player->DestroyItem(guidItem->GetBagSlot(), guidItem->GetSlot(), true );
} }
} }
for(uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+3; ++enchant_slot) for(uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+MAX_GEM_SOCKETS; ++enchant_slot)
_player->ApplyEnchantment(itemTarget,EnchantmentSlot(enchant_slot),true); _player->ApplyEnchantment(itemTarget,EnchantmentSlot(enchant_slot),true);
bool SocketBonusToBeActivated = itemTarget->GemsFitSockets();//current socketbonus state bool SocketBonusToBeActivated = itemTarget->GemsFitSockets();//current socketbonus state
+3
View File
@@ -12403,6 +12403,9 @@ void Player::ApplyEnchantment(Item *item,EnchantmentSlot slot,bool apply, bool a
case ITEM_ENCHANTMENT_TYPE_USE_SPELL: case ITEM_ENCHANTMENT_TYPE_USE_SPELL:
// processed in Player::CastItemUseSpell // processed in Player::CastItemUseSpell
break; break;
case ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET:
// nothing do..
break;
default: default:
sLog.outError("Unknown item enchantment (id = %d) display type: %d", enchant_id, enchant_display_type); sLog.outError("Unknown item enchantment (id = %d) display type: %d", enchant_id, enchant_display_type);
break; break;
+1 -1
View File
@@ -1061,7 +1061,7 @@ class TRINITY_DLL_SPEC Player : public Unit
Item* GetItemByGuid( uint64 guid ) const; Item* GetItemByGuid( uint64 guid ) const;
Item* GetItemByPos( uint16 pos ) const; Item* GetItemByPos( uint16 pos ) const;
Item* GetItemByPos( uint8 bag, uint8 slot ) const; Item* GetItemByPos( uint8 bag, uint8 slot ) const;
inline Item* Player::GetUseableItemByPos( uint8 bag, uint8 slot ) const //Does additional check for disarmed weapons inline Item* GetUseableItemByPos( uint8 bag, uint8 slot ) const //Does additional check for disarmed weapons
{ {
if (!CanUseAttackType(GetAttackBySlot(slot))) if (!CanUseAttackType(GetAttackBySlot(slot)))
return NULL; return NULL;
+1 -1
View File
@@ -685,7 +685,7 @@ enum SpellEffects
SPELL_EFFECT_153 = 153, SPELL_EFFECT_153 = 153,
SPELL_EFFECT_154 = 154, SPELL_EFFECT_154 = 154,
SPELL_EFFECT_TITAN_GRIP = 155, SPELL_EFFECT_TITAN_GRIP = 155,
SPELL_EFFECT_ADD_SOCKET = 156, SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC = 156,
SPELL_EFFECT_CREATE_ITEM_2 = 157, SPELL_EFFECT_CREATE_ITEM_2 = 157,
SPELL_EFFECT_MILLING = 158, SPELL_EFFECT_MILLING = 158,
SPELL_EFFECT_ALLOW_RENAME_PET = 159, SPELL_EFFECT_ALLOW_RENAME_PET = 159,
+21 -19
View File
@@ -574,6 +574,7 @@ void Spell::FillTargetMap()
break; break;
/*case SPELL_EFFECT_ENCHANT_ITEM: /*case SPELL_EFFECT_ENCHANT_ITEM:
case SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY: case SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY:
case SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC:
case SPELL_EFFECT_DISENCHANT: case SPELL_EFFECT_DISENCHANT:
case SPELL_EFFECT_PROSPECTING: case SPELL_EFFECT_PROSPECTING:
case SPELL_EFFECT_MILLING: case SPELL_EFFECT_MILLING:
@@ -2054,8 +2055,9 @@ void Spell::prepare(SpellCastTargets const* targets, Aura* triggeredByAura)
{ {
m_caster->SetCurrentCastedSpell( this ); m_caster->SetCurrentCastedSpell( this );
m_selfContainer = &(m_caster->m_currentSpells[GetCurrentContainer()]); m_selfContainer = &(m_caster->m_currentSpells[GetCurrentContainer()]);
SendSpellStart();
} }
SendSpellStart();
} }
} }
@@ -2136,13 +2138,16 @@ void Spell::cast(bool skipCheck)
if(m_caster->GetTypeId() != TYPEID_PLAYER && m_targets.getUnitTarget() && m_targets.getUnitTarget() != m_caster) if(m_caster->GetTypeId() != TYPEID_PLAYER && m_targets.getUnitTarget() && m_targets.getUnitTarget() != m_caster)
m_caster->SetInFront(m_targets.getUnitTarget()); m_caster->SetInFront(m_targets.getUnitTarget());
castResult = CheckPower(); if(!m_IsTriggeredSpell)
if(castResult != 0)
{ {
SendCastResult(castResult); castResult = CheckPower();
finish(false); if(castResult != 0)
SetExecutedCurrently(false); {
return; SendCastResult(castResult);
finish(false);
SetExecutedCurrently(false);
return;
}
} }
// triggered cast called from Spell::prepare where it was already checked // triggered cast called from Spell::prepare where it was already checked
@@ -2197,22 +2202,15 @@ void Spell::cast(bool skipCheck)
((Player*)m_caster)->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL, m_spellInfo->Id); ((Player*)m_caster)->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL, m_spellInfo->Id);
} }
// CAST SPELL
SendSpellCooldown();
if(!m_IsTriggeredSpell) if(!m_IsTriggeredSpell)
{ {
//TakePower(); //TakePower();
TakeReagents(); // we must remove reagents before HandleEffects to allow place crafted item in same slot TakeReagents(); // we must remove reagents before HandleEffects to allow place crafted item in same slot
} }
if(m_spellState == SPELL_STATE_FINISHED) // stop cast if spell marked as finish somewhere in Take*/FillTargetMap // CAST SPELL
{ SendSpellCooldown();
SetExecutedCurrently(false); //SendCastResult(castResult);
return;
}
SendCastResult(castResult);
SendSpellGo(); // we must send smsg_spell_go packet before m_castItem delete in TakeCastItem()... SendSpellGo(); // we must send smsg_spell_go packet before m_castItem delete in TakeCastItem()...
if(m_customAttr & SPELL_ATTR_CU_DIRECT_DAMAGE) if(m_customAttr & SPELL_ATTR_CU_DIRECT_DAMAGE)
@@ -2257,9 +2255,12 @@ void Spell::cast(bool skipCheck)
uint32 auraSpellIdx = (*i)->GetEffIndex(); uint32 auraSpellIdx = (*i)->GetEffIndex();
// Calculate chance at that moment (can be depend for example from combo points) // Calculate chance at that moment (can be depend for example from combo points)
int32 chance = m_caster->CalculateSpellDamage(auraSpellInfo, auraSpellIdx, (*i)->GetBasePoints(),unit); int32 chance = m_caster->CalculateSpellDamage(auraSpellInfo, auraSpellIdx, (*i)->GetBasePoints(),unit);
chance *= (*i)->GetStackAmount();
if(roll_chance_i(chance)) if(roll_chance_i(chance))
for (int j=0; j != (*i)->GetStackAmount(); ++j) {
m_caster->CastSpell(unit, auraSpellInfo->EffectTriggerSpell[auraSpellIdx], true, NULL, (*i)); if(SpellEntry const *spellInfo = sSpellStore.LookupEntry(auraSpellInfo->EffectTriggerSpell[auraSpellIdx]))
m_TriggerSpells.push_back(spellInfo);
}
} }
} }
} }
@@ -5008,6 +5009,7 @@ uint8 Spell::CheckItems()
break; break;
} }
case SPELL_EFFECT_ENCHANT_ITEM: case SPELL_EFFECT_ENCHANT_ITEM:
case SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC:
{ {
Item* targetItem = m_targets.getItemTarget(); Item* targetItem = m_targets.getItemTarget();
if(!targetItem) if(!targetItem)
+1
View File
@@ -350,6 +350,7 @@ class Spell
void EffectRedirectThreat(uint32 i); void EffectRedirectThreat(uint32 i);
void EffectActivateRune(uint32 i); void EffectActivateRune(uint32 i);
void EffectTitanGrip(uint32 i); void EffectTitanGrip(uint32 i);
void EffectEnchantItemPrismatic(uint32 i);
Spell( Unit* Caster, SpellEntry const *info, bool triggered, uint64 originalCasterGUID = 0, Spell** triggeringContainer = NULL, bool skipCheck = false ); Spell( Unit* Caster, SpellEntry const *info, bool triggered, uint64 originalCasterGUID = 0, Spell** triggeringContainer = NULL, bool skipCheck = false );
~Spell(); ~Spell();
+63 -4
View File
@@ -220,7 +220,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
&Spell::EffectNULL, //153 SPELL_EFFECT_CREATE_PET misc value is creature entry &Spell::EffectNULL, //153 SPELL_EFFECT_CREATE_PET misc value is creature entry
&Spell::EffectNULL, //154 unused &Spell::EffectNULL, //154 unused
&Spell::EffectTitanGrip, //155 SPELL_EFFECT_TITAN_GRIP Allows you to equip two-handed axes, maces and swords in one hand, but you attack $49152s1% slower than normal. &Spell::EffectTitanGrip, //155 SPELL_EFFECT_TITAN_GRIP Allows you to equip two-handed axes, maces and swords in one hand, but you attack $49152s1% slower than normal.
&Spell::EffectNULL, //156 Add Socket &Spell::EffectEnchantItemPrismatic, //156 SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC
&Spell::EffectCreateItem, //157 SPELL_EFFECT_CREATE_ITEM_2 create/learn item/spell for profession &Spell::EffectCreateItem, //157 SPELL_EFFECT_CREATE_ITEM_2 create/learn item/spell for profession
&Spell::EffectMilling, //158 SPELL_EFFECT_MILLING milling &Spell::EffectMilling, //158 SPELL_EFFECT_MILLING milling
&Spell::EffectRenamePet //159 SPELL_EFFECT_ALLOW_RENAME_PET allow rename pet once again &Spell::EffectRenamePet //159 SPELL_EFFECT_ALLOW_RENAME_PET allow rename pet once again
@@ -1319,7 +1319,7 @@ void Spell::EffectDummy(uint32 i)
rage+=aura->GetModifier()->m_amount; rage+=aura->GetModifier()->m_amount;
spell_id = 20647; spell_id = 20647;
int32 bp = damage+int32(rage * m_spellInfo->DmgMultiplier[i] + bp = damage+int32(rage * m_spellInfo->DmgMultiplier[i] +
m_caster->GetTotalAttackPowerValue(BASE_ATTACK)*0.2f); m_caster->GetTotalAttackPowerValue(BASE_ATTACK)*0.2f);
m_caster->SetPower(POWER_RAGE,0); m_caster->SetPower(POWER_RAGE,0);
break; break;
@@ -3888,7 +3888,7 @@ void Spell::EffectTradeSkill(uint32 /*i*/)
// ((Player*)unitTarget)->SetSkill(skillid,skillval?skillval:1,skillmax+75); // ((Player*)unitTarget)->SetSkill(skillid,skillval?skillval:1,skillmax+75);
} }
void Spell::EffectEnchantItemPerm(uint32 i) void Spell::EffectEnchantItemPerm(uint32 effect_idx)
{ {
if(m_caster->GetTypeId() != TYPEID_PLAYER) if(m_caster->GetTypeId() != TYPEID_PLAYER)
return; return;
@@ -3897,9 +3897,10 @@ void Spell::EffectEnchantItemPerm(uint32 i)
Player* p_caster = (Player*)m_caster; Player* p_caster = (Player*)m_caster;
// not grow at item use at item case
p_caster->UpdateCraftSkill(m_spellInfo->Id); p_caster->UpdateCraftSkill(m_spellInfo->Id);
uint32 enchant_id = m_spellInfo->EffectMiscValue[i]; uint32 enchant_id = m_spellInfo->EffectMiscValue[effect_idx];
if (!enchant_id) if (!enchant_id)
return; return;
@@ -3929,6 +3930,64 @@ void Spell::EffectEnchantItemPerm(uint32 i)
item_owner->ApplyEnchantment(itemTarget,PERM_ENCHANTMENT_SLOT,true); item_owner->ApplyEnchantment(itemTarget,PERM_ENCHANTMENT_SLOT,true);
} }
void Spell::EffectEnchantItemPrismatic(uint32 effect_idx)
{
if(m_caster->GetTypeId() != TYPEID_PLAYER)
return;
if (!itemTarget)
return;
Player* p_caster = (Player*)m_caster;
uint32 enchant_id = m_spellInfo->EffectMiscValue[effect_idx];
if (!enchant_id)
return;
SpellItemEnchantmentEntry const *pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id);
if(!pEnchant)
return;
// support only enchantings with add socket in this slot
{
bool add_socket = false;
for(int i = 0; i < 3; ++i)
{
if(pEnchant->type[i]==ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET)
{
add_socket = true;
break;
}
}
if(!add_socket)
{
sLog.outError("Spell::EffectEnchantItemPrismatic: attempt apply enchant spell %u with SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC (%u) but without ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET (u), not suppoted yet.",
m_spellInfo->Id,SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC,ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET);
return;
}
}
// item can be in trade slot and have owner diff. from caster
Player* item_owner = itemTarget->GetOwner();
if(!item_owner)
return;
if(item_owner!=p_caster && p_caster->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_GM_LOG_TRADE) )
{
sLog.outCommand(p_caster->GetSession()->GetAccountId(),"GM %s (Account: %u) enchanting(perm): %s (Entry: %d) for player: %s (Account: %u)",
p_caster->GetName(),p_caster->GetSession()->GetAccountId(),
itemTarget->GetProto()->Name1,itemTarget->GetEntry(),
item_owner->GetName(),item_owner->GetSession()->GetAccountId());
}
// remove old enchanting before applying new if equipped
item_owner->ApplyEnchantment(itemTarget,PRISMATIC_ENCHANTMENT_SLOT,false);
itemTarget->SetEnchantment(PRISMATIC_ENCHANTMENT_SLOT, enchant_id, 0, 0);
// add new enchanting if equipped
item_owner->ApplyEnchantment(itemTarget,PRISMATIC_ENCHANTMENT_SLOT,true);
}
void Spell::EffectEnchantItemTmp(uint32 i) void Spell::EffectEnchantItemTmp(uint32 i)
{ {
if(m_caster->GetTypeId() != TYPEID_PLAYER) if(m_caster->GetTypeId() != TYPEID_PLAYER)
+5 -1
View File
@@ -74,7 +74,7 @@ static bool procPrepared = InitTriggerAuraData();
Unit::Unit() Unit::Unit()
: WorldObject(), i_motionMaster(this), m_ThreatManager(this), m_HostilRefManager(this) : WorldObject(), i_motionMaster(this), m_ThreatManager(this), m_HostilRefManager(this)
, m_IsInNotifyList(false), m_Notified(false) , m_IsInNotifyList(false), m_Notified(false), m_AI_enabled(false)
{ {
m_objectType |= TYPEMASK_UNIT; m_objectType |= TYPEMASK_UNIT;
m_objectTypeId = TYPEID_UNIT; m_objectTypeId = TYPEID_UNIT;
@@ -3034,7 +3034,11 @@ uint32 Unit::GetWeaponSkillValue (WeaponAttackType attType, Unit const* target)
// feral or unarmed skill only for base attack // feral or unarmed skill only for base attack
if(attType != BASE_ATTACK && !item ) if(attType != BASE_ATTACK && !item )
{
if(attType == RANGED_ATTACK && getClass() == CLASS_PALADIN) //hammer
return GetMaxSkillValueForLevel();
return 0; return 0;
}
if(((Player*)this)->IsInFeralForm()) if(((Player*)this)->IsInFeralForm())
return GetMaxSkillValueForLevel(); // always maximized SKILL_FERAL_COMBAT in fact return GetMaxSkillValueForLevel(); // always maximized SKILL_FERAL_COMBAT in fact
+2
View File
@@ -1559,6 +1559,8 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
uint32 m_regenTimer; uint32 m_regenTimer;
ThreatManager m_ThreatManager; ThreatManager m_ThreatManager;
bool m_AI_enabled;
private: private:
void SendAttackStop(Unit* victim); // only from AttackStop(Unit*) void SendAttackStop(Unit* victim); // only from AttackStop(Unit*)
//void SendAttackStart(Unit* pVictim); // only from Unit::AttackStart(Unit*) //void SendAttackStart(Unit* pVictim); // only from Unit::AttackStart(Unit*)
-1
View File
@@ -1,4 +1,3 @@
add_subdirectory(vmap) add_subdirectory(vmap)
add_subdirectory(Auth) add_subdirectory(Auth)
add_subdirectory(Config) add_subdirectory(Config)
+8 -8
View File
@@ -1278,14 +1278,14 @@ struct SpellItemEnchantmentEntry
uint32 amount[3]; // 5-7 m_effectPointsMin[3] uint32 amount[3]; // 5-7 m_effectPointsMin[3]
//uint32 amount2[3] // 8-10 m_effectPointsMax[3] //uint32 amount2[3] // 8-10 m_effectPointsMax[3]
uint32 spellid[3]; // 11-13 m_effectArg[3] uint32 spellid[3]; // 11-13 m_effectArg[3]
char* description[16]; // 14-30 m_name_lang[16] char* description[16]; // 14-29 m_name_lang[16]
//uint32 descriptionFlags; // 31 name flags //uint32 descriptionFlags; // 30 name flags
uint32 aura_id; // 32 m_itemVisual uint32 aura_id; // 31 m_itemVisual
uint32 slot; // 33 m_flags uint32 slot; // 32 m_flags
uint32 GemID; // 34 m_src_itemID uint32 GemID; // 33 m_src_itemID
uint32 EnchantmentCondition; // 35 m_condition_id uint32 EnchantmentCondition; // 34 m_condition_id
//uint32 requiredSkill; // 36 m_requiredSkillID //uint32 requiredSkill; // 35 m_requiredSkillID
//uint32 requiredSkillValue; // 37 m_requiredSkillRank //uint32 requiredSkillValue; // 36 m_requiredSkillRank
}; };
struct SpellItemEnchantmentConditionEntry struct SpellItemEnchantmentConditionEntry
+1 -1
View File
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "7226" #define REVISION_NR "7227"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__
+35
View File
@@ -0,0 +1,35 @@
/*
* Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
*
* Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/// \addtogroup Trinityd
/// @{
/// \file
#ifndef __CLIRUNNABLE_H
#define __CLIRUNNABLE_H
/// Command Line Interface handling thread
class CliRunnable : public ZThread::Runnable
{
public:
void run();
};
#endif
/// @}
+52
View File
@@ -0,0 +1,52 @@
/*
* Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
*
* Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/// \addtogroup Trinityd
/// @{
/// \file
#ifndef _MASTER_H
#define _MASTER_H
#include "Common.h"
#include "Policies/Singleton.h"
/// Start the server
class Master
{
public:
Master();
~Master();
int Run();
static volatile uint32 m_masterLoopCounter;
private:
bool _StartDB();
void _HookSignals();
void _UnhookSignals();
static void _OnSignal(int s);
void clearOnlineAccounts();
};
#define sMaster Trinity::Singleton<Master>::Instance()
#endif
/// @}
+35
View File
@@ -0,0 +1,35 @@
/*
* Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
*
* Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/// \addtogroup Trinityd
/// @{
/// \file
#ifndef __WORLDRUNNABLE_H
#define __WORLDRUNNABLE_H
/// Heartbeat thread for the World
class WorldRunnable : public ZThread::Runnable
{
public:
void run();
};
#endif
/// @}
+15
View File
@@ -0,0 +1,15 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by TrinityCore.rc
//
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 101
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
+75
View File
@@ -0,0 +1,75 @@
/*
* Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
*
* Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/** \file
\ingroup realmd
*/
#ifndef _AUTHCODES_H
#define _AUTHCODES_H
enum eAuthResults
{
REALM_AUTH_SUCCESS = 0x00,
REALM_AUTH_FAILURE = 0x01, ///< Unable to connect
REALM_AUTH_UNKNOWN1 = 0x02, ///< Unable to connect
REALM_AUTH_ACCOUNT_BANNED = 0x03, ///< This <game> account has been closed and is no longer available for use. Please go to <site>/banned.html for further information.
REALM_AUTH_NO_MATCH = 0x04, ///< The information you have entered is not valid. Please check the spelling of the account name and password. If you need help in retrieving a lost or stolen password, see <site> for more information
REALM_AUTH_UNKNOWN2 = 0x05, ///< The information you have entered is not valid. Please check the spelling of the account name and password. If you need help in retrieving a lost or stolen password, see <site> for more information
REALM_AUTH_ACCOUNT_IN_USE = 0x06, ///< This account is already logged into <game>. Please check the spelling and try again.
REALM_AUTH_PREPAID_TIME_LIMIT = 0x07, ///< You have used up your prepaid time for this account. Please purchase more to continue playing
REALM_AUTH_SERVER_FULL = 0x08, ///< Could not log in to <game> at this time. Please try again later.
REALM_AUTH_WRONG_BUILD_NUMBER = 0x09, ///< Unable to validate game version. This may be caused by file corruption or interference of another program. Please visit <site> for more information and possible solutions to this issue.
REALM_AUTH_UPDATE_CLIENT = 0x0a, ///< Downloading
REALM_AUTH_UNKNOWN3 = 0x0b, ///< Unable to connect
REALM_AUTH_ACCOUNT_FREEZED = 0x0c, ///< This <game> account has been temporarily suspended. Please go to <site>/banned.html for further information
REALM_AUTH_UNKNOWN4 = 0x0d, ///< Unable to connect
REALM_AUTH_UNKNOWN5 = 0x0e, ///< Connected.
REALM_AUTH_PARENTAL_CONTROL = 0x0f ///< Access to this account has been blocked by parental controls. Your settings may be changed in your account preferences at <site>
};
enum LoginResult
{
LOGIN_OK = 0x00,
LOGIN_FAILED = 0x01,
LOGIN_FAILED2 = 0x02,
LOGIN_BANNED = 0x03,
LOGIN_UNKNOWN_ACCOUNT = 0x04,
LOGIN_UNKNOWN_ACCOUNT3 = 0x05,
LOGIN_ALREADYONLINE = 0x06,
LOGIN_NOTIME = 0x07,
LOGIN_DBBUSY = 0x08,
LOGIN_BADVERSION = 0x09,
LOGIN_DOWNLOAD_FILE = 0x0A,
LOGIN_FAILED3 = 0x0B,
LOGIN_SUSPENDED = 0x0C,
LOGIN_FAILED4 = 0x0D,
LOGIN_CONNECTED = 0x0E,
LOGIN_PARENTALCONTROL = 0x0F,
LOGIN_LOCKED_ENFORCED = 0x10,
};
// we need to stick to 1 version or half of the stuff will work for someone
// others will not and opposite
// will only support WoW and WoW:TBC 2.4.3 client build 8606...
#define EXPECTED_TRINITY_CLIENT_BUILD {8606, 0}
#endif
+68
View File
@@ -0,0 +1,68 @@
/*
* Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
*
* Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/// \addtogroup realmd
/// @{
/// \file
#ifndef _REALMLIST_H
#define _REALMLIST_H
#include "Common.h"
/// Storage object for a realm
struct Realm
{
std::string name;
std::string address;
uint8 icon;
uint8 color;
uint8 timezone;
uint32 m_ID;
AccountTypes allowedSecurityLevel;
float populationLevel;
};
/// Storage object for the list of realms on the server
class RealmList
{
public:
typedef std::map<std::string, Realm> RealmMap;
RealmList();
~RealmList() {}
void Initialize(uint32 updateInterval);
void UpdateIfNeed();
RealmMap::const_iterator begin() const { return m_realms.begin(); }
RealmMap::const_iterator end() const { return m_realms.end(); }
uint32 size() const { return m_realms.size(); }
private:
void UpdateRealms(bool init);
void UpdateRealm( uint32 ID, const std::string& name, const std::string& address, uint32 port, uint8 icon, uint8 color, uint8 timezone, AccountTypes allowedSecurityLevel, float popu);
private:
RealmMap m_realms; ///< Internal map of realms
uint32 m_UpdateInterval;
time_t m_NextUpdateTime;
};
#endif
/// @}
+15
View File
@@ -0,0 +1,15 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by TrinityCore.rc
//
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 101
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif