Merge remote branch 'origin/master' into 330

Also move accepteble build number to src/game/SharedDefines.h
as expected by new realmd code.
This commit is contained in:
VladimirMangos 2009-12-17 03:55:33 +03:00
commit 34d8d69e2b
42 changed files with 462 additions and 229 deletions

View file

@ -1491,11 +1491,11 @@ struct SpellShapeshiftEntry
int32 creatureType; // 20 <=0 humanoid, other normal creature types
//uint32 unk1; // 21 unused, related to next field
uint32 attackSpeed; // 22
//uint32 modelID; // 23 unused, alliance modelid (where horde case?)
//uint32 unk2; // 24 unused, also modelid (single case)
//uint32 unk3; // 25 unused, all zeros
//uint32 unk4; // 26 unused, all zeros
//uint32 spellids[8]; // 27-34 unused
uint32 modelID_A; // 23 alliance modelid (0 means no model)
uint32 modelID_H; // 24 horde modelid (but only for one form)
//uint32 unk3; // 25 unused always 0
//uint32 unk4; // 26 unused always 0
//uint32 spell[8]; // 27-34 unused, spells which appear in the bar after shapeshifting
};
struct SpellDurationEntry

View file

@ -91,7 +91,7 @@ const char SpellItemEnchantmentConditionfmt[]="nbbbbbxxxxxbbbbbbbbbbiiiiiXXXXX";
const char SpellRadiusfmt[]="nfxf";
const char SpellRangefmt[]="nffffxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
const char SpellRuneCostfmt[]="niiii";
const char SpellShapeshiftfmt[]="nxxxxxxxxxxxxxxxxxxiixixxxxxxxxxxxx";
const char SpellShapeshiftfmt[]="nxxxxxxxxxxxxxxxxxxiixiiixxxxxxxxxx";
const char StableSlotPricesfmt[] = "ni";
const char SummonPropertiesfmt[] = "niiiii";
const char TalentEntryfmt[]="niiiiiiiixxxxixxixxxxxx";

View file

@ -914,7 +914,7 @@ void MailDraft::SendReturnToSender(uint32 sender_acc, uint32 sender_guid, uint32
void MailDraft::SendMailTo(MailReceiver const& receiver, MailSender const& sender, MailCheckMask checked, uint32 deliver_delay)
{
Player* pReceiver = receiver.GetPlayer(); // can be NULL
if (pReceiver)
prepareItems(pReceiver); // generate mail template items

View file

@ -306,7 +306,8 @@ void WorldSession::HandleGossipSelectOptionOpcode( WorldPacket & recv_data )
// TODO: determine if scriptCall is needed for GO and also if scriptCall can be same as current, with modified argument WorldObject*
if (IS_CREATURE_GUID(guid))
// can vehicle have gossip? If so, need check for this also.
if (IS_CREATURE_OR_PET_GUID(guid))
{
Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_NONE);

View file

@ -352,22 +352,28 @@ void WorldSession::HandlePetSetAction( WorldPacket & recv_data )
}
}
// check swap
// check swap (at command->spell swap client remove spell first in another packet, so check only command move correctness)
if (move_command)
{
uint8 act_state_0 = UNIT_ACTION_BUTTON_TYPE(data[0]);
uint32 spell_id_0 = UNIT_ACTION_BUTTON_ACTION(data[0]);
UnitActionBarEntry const* actionEntry_1 = charmInfo->GetActionBarEntry(position[1]);
if (!actionEntry_1 || spell_id_0 != actionEntry_1->GetAction() ||
act_state_0 != actionEntry_1->GetType())
return;
if(act_state_0 == ACT_COMMAND || act_state_0 == ACT_REACTION)
{
uint32 spell_id_0 = UNIT_ACTION_BUTTON_ACTION(data[0]);
UnitActionBarEntry const* actionEntry_1 = charmInfo->GetActionBarEntry(position[1]);
if (!actionEntry_1 || spell_id_0 != actionEntry_1->GetAction() ||
act_state_0 != actionEntry_1->GetType())
return;
}
uint8 act_state_1 = UNIT_ACTION_BUTTON_TYPE(data[1]);
uint32 spell_id_1 = UNIT_ACTION_BUTTON_ACTION(data[1]);
UnitActionBarEntry const* actionEntry_0 = charmInfo->GetActionBarEntry(position[0]);
if (!actionEntry_0 || spell_id_1 != actionEntry_0->GetAction() ||
act_state_1 != actionEntry_0->GetType())
return;
if(act_state_1 == ACT_COMMAND || act_state_1 == ACT_REACTION)
{
uint32 spell_id_1 = UNIT_ACTION_BUTTON_ACTION(data[1]);
UnitActionBarEntry const* actionEntry_0 = charmInfo->GetActionBarEntry(position[0]);
if (!actionEntry_0 || spell_id_1 != actionEntry_0->GetAction() ||
act_state_1 != actionEntry_0->GetType())
return;
}
}
for(uint8 i = 0; i < count; ++i)

View file

@ -202,7 +202,7 @@ void PoolGroup<T>::SpawnObject(uint32 limit, uint32 triggerFrom)
int count = limit - m_SpawnedPoolAmount;
// If triggered from some object respawn this object is still marked as spawned
// and also counted into m_SpawnedPoolAmount so we need increase count to be
// and also counted into m_SpawnedPoolAmount so we need increase count to be
// spawned by 1
if (triggerFrom)
++count;

View file

@ -2640,4 +2640,10 @@ enum PetTameFailureReason
PETTAME_UNKNOWNERROR = 12
};
// 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, WoW:TBC and WoW:WotLK 3.3.0a client build 11159...
#define EXPECTED_MANGOSD_CLIENT_BUILD {11159, 0}
#endif

View file

@ -4320,7 +4320,7 @@ SpellCastResult Spell::CheckCast(bool strict)
return SPELL_FAILED_BAD_IMPLICIT_TARGETS;
Pet* target = m_caster->GetMap()->GetPet(((Player*)m_caster)->GetSelection());
// alive
// alive
if (!target || target->isDead())
return SPELL_FAILED_BAD_IMPLICIT_TARGETS;
// undead

View file

@ -2572,7 +2572,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
break;
case SPELLFAMILY_WARLOCK:
{
// Haunt
// Haunt
if (GetSpellProto()->SpellIconID == 3172 && (GetSpellProto()->SpellFamilyFlags & UI64LIT(0x0004000000000000)))
{
// NOTE: for avoid use additional field damage stored in dummy value (replace unused 100%
@ -2923,86 +2923,68 @@ void Aura::HandleAuraModShapeshift(bool apply, bool Real)
uint32 modelid = 0;
Powers PowerType = POWER_MANA;
ShapeshiftForm form = ShapeshiftForm(m_modifier.m_miscvalue);
SpellShapeshiftEntry const* ssEntry = sSpellShapeshiftStore.LookupEntry(form);
if(ssEntry && ssEntry->modelID_A)
{
// i will asume that creatures will always take the defined model from the dbc
// since no field in creature_templates describes wether an alliance or
// horde modelid should be used at shapeshifting
if (m_target->GetTypeId() != TYPEID_PLAYER)
modelid = ssEntry->modelID_A;
else
{
// players are a bit difficult since the dbc has seldomly an horde modelid
// so we add hacks here to set the right model
if (Player::TeamForRace(m_target->getRace()) == ALLIANCE)
modelid = ssEntry->modelID_A;
else // 3.2.3 only the moonkin form has this information
modelid = ssEntry->modelID_H;
// no model found, if player is horde we look here for our hardcoded modelids
if (!modelid && Player::TeamForRace(m_target->getRace()) == HORDE)
{
switch(form)
{
case FORM_CAT:
modelid = 8571;
break;
case FORM_BEAR:
case FORM_DIREBEAR:
modelid = 2289;
break;
case FORM_FLIGHT:
modelid = 20872;
break;
case FORM_FLIGHT_EPIC:
modelid = 21244;
break;
// per default use alliance modelid
// mostly horde and alliance share the same
default:
modelid = ssEntry->modelID_A;
break;
}
}
}
}
// now only powertype must be set
switch(form)
{
case FORM_CAT:
if(Player::TeamForRace(m_target->getRace()) == ALLIANCE)
modelid = 892;
else
modelid = 8571;
PowerType = POWER_ENERGY;
break;
case FORM_TRAVEL:
modelid = 632;
break;
case FORM_AQUA:
if(Player::TeamForRace(m_target->getRace()) == ALLIANCE)
modelid = 2428;
else
modelid = 2428;
break;
case FORM_BEAR:
if(Player::TeamForRace(m_target->getRace()) == ALLIANCE)
modelid = 2281;
else
modelid = 2289;
PowerType = POWER_RAGE;
break;
case FORM_GHOUL:
if(Player::TeamForRace(m_target->getRace()) == ALLIANCE)
modelid = 10045;
break;
case FORM_DIREBEAR:
if(Player::TeamForRace(m_target->getRace()) == ALLIANCE)
modelid = 2281;
else
modelid = 2289;
PowerType = POWER_RAGE;
break;
case FORM_CREATUREBEAR:
modelid = 902;
break;
case FORM_GHOSTWOLF:
modelid = 4613;
break;
case FORM_FLIGHT:
if(Player::TeamForRace(m_target->getRace()) == ALLIANCE)
modelid = 20857;
else
modelid = 20872;
break;
case FORM_MOONKIN:
if(Player::TeamForRace(m_target->getRace()) == ALLIANCE)
modelid = 15374;
else
modelid = 15375;
break;
case FORM_FLIGHT_EPIC:
if(Player::TeamForRace(m_target->getRace()) == ALLIANCE)
modelid = 21243;
else
modelid = 21244;
break;
case FORM_METAMORPHOSIS:
modelid = 25277;
break;
case FORM_AMBIENT:
case FORM_SHADOW:
case FORM_STEALTH:
break;
case FORM_TREE:
modelid = 864;
break;
case FORM_BATTLESTANCE:
case FORM_BERSERKERSTANCE:
case FORM_DEFENSIVESTANCE:
PowerType = POWER_RAGE;
break;
case FORM_SPIRITOFREDEMPTION:
modelid = 16031;
break;
default:
sLog.outError("Auras: Unknown Shapeshift Type: %u, SpellId %u.", m_modifier.m_miscvalue, GetId());
break;
}
// remove polymorph before changing display id to keep new display id
@ -5915,7 +5897,7 @@ void Aura::HandleSpellSpecificBoosts(bool apply)
case SPELLFAMILY_MAGE:
{
// Ice Barrier (non stacking from one caster)
if (m_spellProto->SpellIconID == 32)
if (m_spellProto->SpellIconID == 32)
{
if (!apply && (m_removeMode == AURA_REMOVE_BY_DISPEL || (m_removeMode == AURA_REMOVE_BY_DEFAULT && !GetModifier()->m_amount)))
{
@ -6010,7 +5992,7 @@ void Aura::HandleSpellSpecificBoosts(bool apply)
for(Unit::AuraList::const_iterator itr = dummyAuras.begin(); itr != dummyAuras.end(); ++itr)
{
// Shadow Affinity
if ((*itr)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_PRIEST
if ((*itr)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_PRIEST
&& (*itr)->GetSpellProto()->SpellIconID == 178)
{
// custom cast code

View file

@ -3414,16 +3414,15 @@ void Spell::EffectSummonType(uint32 i)
{
switch(summon_prop->Type)
{
case SUMMON_PROP_TYPE_SIEGE_VEH:
case SUMMON_PROP_TYPE_DRAKE_VEH:
case SUMMON_PROP_TYPE_OTHER:
{
// TODO
// EffectSummonVehicle(i);
break;
}
case SUMMON_PROP_TYPE_TOTEM:
{
EffectSummonTotem(i, summon_prop->Slot);
// those are classical totems - effectbasepoints is their hp and not summon ammount!
//SUMMON_TYPE_TOTEM = 121: 23035, battlestands
//SUMMON_TYPE_TOTEM2 = 647: 52893, Anti-Magic Zone (npc used)
if(prop_id == 121 || prop_id == 647)
EffectSummonTotem(i);
else
EffectSummonWild(i, summon_prop->FactionId);
break;
}
case SUMMON_PROP_TYPE_SUMMON:
@ -3441,25 +3440,22 @@ void Spell::EffectSummonType(uint32 i)
EffectSummonGuardian(i, summon_prop->FactionId);
break;
}
case SUMMON_PROP_TYPE_TOTEM:
EffectSummonTotem(i, summon_prop->Slot);
break;
case SUMMON_PROP_TYPE_CRITTER:
case SUMMON_PROP_TYPE_REPAIR_BOT:
{
EffectSummonCritter(i, summon_prop->FactionId);
break;
}
case SUMMON_PROP_TYPE_OTHER:
case SUMMON_PROP_TYPE_PHASING:
case SUMMON_PROP_TYPE_LIGHTWELL:
{
// those are classical totems - effectbasepoints is their hp and not summon ammount!
//SUMMON_TYPE_TOTEM = 121: 23035, battlestands
//SUMMON_TYPE_TOTEM2 = 647: 52893, Anti-Magic Zone (npc used)
if(prop_id == 121 || prop_id == 647)
EffectSummonTotem(i);
else
EffectSummonWild(i, summon_prop->FactionId);
case SUMMON_PROP_TYPE_REPAIR_BOT:
EffectSummonWild(i, summon_prop->FactionId);
break;
case SUMMON_PROP_TYPE_SIEGE_VEH:
case SUMMON_PROP_TYPE_DRAKE_VEH:
// TODO
// EffectSummonVehicle(i);
break;
}
default:
sLog.outError("EffectSummonType: Unhandled summon type %u", summon_prop->Type);
break;

View file

@ -311,6 +311,7 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
// not have spell in spellbook or spell passive and not casted by client
if (!((Player*)mover)->HasActiveSpell (spellId) || IsPassiveSpell(spellId) )
{
sLog.outError("World: Player %u casts spell %u which he shouldn't have", mover->GetGUIDLow(), spellId);
//cheater? kick? ban?
recvPacket.rpos(recvPacket.wpos()); // prevent spam at ignore packet
return;

View file

@ -6253,7 +6253,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
break;
}
// Sacred Shield (talent rank)
case 53601:
case 53601:
{
triggered_spell_id = 58597;
target = this;
@ -7638,16 +7638,6 @@ bool Unit::HandleOverrideClassScriptAuraProc(Unit *pVictim, uint32 damage, Aura
case 6953: // Warbringer
RemoveAurasAtMechanicImmunity(IMMUNE_TO_ROOT_AND_SNARE_MASK,0,true);
return true;
case 8152: // Serendipity
{
// if heal your target over maximum health
if (pVictim->GetHealth() + damage < pVictim->GetMaxHealth())
return false;
int32 cost = procSpell->manaCost + procSpell->ManaCostPercentage * GetCreateMana() / 100;
int32 basepoints0 = cost * triggeredByAura->GetModifier()->m_amount/100;
CastCustomSpell(this, 47762, &basepoints0, NULL, NULL, true, NULL, triggeredByAura);
return true;
}
}
// not processed
@ -8993,7 +8983,7 @@ bool Unit::isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM
// Lava Burst
if (spellProto->SpellFamilyFlags & UI64LIT(0x0000100000000000))
{
// Flame Shock
// Flame Shock
if (Aura *flameShock = pVictim->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_SHAMAN, UI64LIT(0x0000000010000000), 0, GetGUID()))
return true;
}
@ -10827,7 +10817,7 @@ int32 Unit::CalculateSpellDuration(SpellEntry const* spellProto, uint8 effect_in
durationMod_always+=target->GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_DURATION_OF_EFFECTS_BY_DISPEL, spellProto->Dispel);
// Find max mod (negative bonus)
int32 durationMod_not_stack = target->GetMaxNegativeAuraModifierByMiscValue(SPELL_AURA_MECHANIC_DURATION_MOD_NOT_STACK, mechanic);
if (!IsPositiveSpell(spellProto->Id))
durationMod_always += target->GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_DURATION_OF_MAGIC_EFFECTS, spellProto->DmgClass);
@ -13055,4 +13045,4 @@ void Unit::CleanupDeletedAuars()
for(AuraList::const_iterator itr = m_deletedAuras.begin(); itr != m_deletedAuras.end(); ++itr)
delete *itr;
m_deletedAuras.clear();
}
}

View file

@ -173,6 +173,11 @@ enum ShapeshiftForm
FORM_AMBIENT = 0x06,
FORM_GHOUL = 0x07,
FORM_DIREBEAR = 0x08,
FORM_STEVES_GHOUL = 0x09,
FORM_THARONJA_SKELETON = 0x0A,
FORM_TEST_OF_STRENGTH = 0x0B,
FORM_BLB_PLAYER = 0x0C,
FORM_SHADOW_DANCE = 0x0D,
FORM_CREATUREBEAR = 0x0E,
FORM_CREATURECAT = 0x0F,
FORM_GHOSTWOLF = 0x10,
@ -182,12 +187,14 @@ enum ShapeshiftForm
FORM_TEST = 0x14,
FORM_ZOMBIE = 0x15,
FORM_METAMORPHOSIS = 0x16,
FORM_UNDEAD = 0x19,
FORM_FRENZY = 0x1A,
FORM_FLIGHT_EPIC = 0x1B,
FORM_SHADOW = 0x1C,
FORM_FLIGHT = 0x1D,
FORM_STEALTH = 0x1E,
FORM_MOONKIN = 0x1F,
FORM_SPIRITOFREDEMPTION = 0x20
FORM_SPIRITOFREDEMPTION = 0x20,
};
// low byte ( 0 from 0..3 ) of UNIT_FIELD_BYTES_2

View file

@ -745,7 +745,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
BigNumber K;
// Read the content of the packet
recvPacket >> ClientBuild; // for now no use
recvPacket >> ClientBuild;
recvPacket >> unk2;
recvPacket >> account;
recvPacket >> unk3;
@ -760,6 +760,29 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
unk3,
clientSeed);
// Check the version of client trying to connect
bool valid_version = false;
int accepted_versions[] = EXPECTED_MANGOSD_CLIENT_BUILD;
for(int i = 0; accepted_versions[i]; ++i)
{
if(ClientBuild == accepted_versions[i])
{
valid_version = true;
break;
}
}
if(!valid_version)
{
packet.Initialize (SMSG_AUTH_RESPONSE, 1);
packet << uint8 (AUTH_VERSION_MISMATCH);
SendPacket (packet);
sLog.outError ("WorldSocket::HandleAuthSession: Sent Auth Response (version mismatch).");
return -1;
}
// Get the account information from the realmd database
std::string safe_account = account; // Duplicate, else will screw the SHA hash verification below
loginDatabase.escape_string (safe_account);