Merge branch 'master' into 310

This commit is contained in:
tomrus88 2009-06-03 16:03:44 +04:00
commit b9b2e254b5
8 changed files with 36 additions and 25 deletions

View file

@ -89,9 +89,20 @@ string ConvertNativeType(enum_field_types mysqlType, uint32 length)
case FIELD_TYPE_INT24:
return "integer";
case FIELD_TYPE_LONGLONG:
return "int8";
case FIELD_TYPE_LONG:
return "bigint";
{
string temp;
char str[10];
temp = "numeric";
if (length)
{
temp.append("(");
sprintf(str,"%d",length);
temp.append(str);
temp.append(")");
}
return temp;
}
case FIELD_TYPE_DECIMAL:
case FIELD_TYPE_FLOAT:
case FIELD_TYPE_DOUBLE:

View file

@ -266,9 +266,9 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData *data )
SelectLevel(GetCreatureInfo());
if (team == HORDE)
SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, GetCreatureInfo()->faction_H);
setFaction(GetCreatureInfo()->faction_H);
else
SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, GetCreatureInfo()->faction_A);
setFaction(GetCreatureInfo()->faction_A);
SetUInt32Value(UNIT_NPC_FLAGS,GetCreatureInfo()->npcflag);
@ -1501,8 +1501,8 @@ void Creature::setDeathState(DeathState s)
if(s == JUST_DIED)
{
SetUInt64Value (UNIT_FIELD_TARGET,0); // remove target selection in any cases (can be set at aura remove in Unit::setDeathState)
SetUInt32Value(UNIT_NPC_FLAGS, 0);
SetUInt64Value(UNIT_FIELD_TARGET,0); // remove target selection in any cases (can be set at aura remove in Unit::setDeathState)
SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
if(!isPet() && GetCreatureInfo()->SkinLootId)
if ( LootTemplates_Skinning.HaveLootFor(GetCreatureInfo()->SkinLootId) )

View file

@ -1602,7 +1602,7 @@ bool ChatHandler::HandleModifyMountCommand(const char* args)
if (needReportToTarget(chr))
ChatHandler(chr).PSendSysMessage(LANG_MOUNT_GIVED, GetNameLink().c_str());
chr->SetUInt32Value( UNIT_FIELD_FLAGS , 0x001000 );
chr->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP);
chr->Mount(mId);
WorldPacket data( SMSG_FORCE_RUN_SPEED_CHANGE, (8+4+1+4) );

View file

@ -165,7 +165,7 @@ bool Pet::LoadPetFromDB( Player* owner, uint32 petentry, uint32 petnumber, bool
}
setPetType(PetType(fields[18].GetUInt8()));
SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, owner->getFaction());
setFaction(owner->getFaction());
SetUInt32Value(UNIT_CREATED_BY_SPELL, summon_spell_id);
CreatureInfo const *cinfo = GetCreatureInfo();
@ -183,7 +183,7 @@ bool Pet::LoadPetFromDB( Player* owner, uint32 petentry, uint32 petnumber, bool
SetDisplayId(fields[3].GetUInt32());
SetNativeDisplayId(fields[3].GetUInt32());
uint32 petlevel = fields[4].GetUInt32();
SetUInt32Value(UNIT_NPC_FLAGS, 0);
SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
SetName(fields[8].GetString());
switch (getPetType())
@ -769,7 +769,7 @@ bool Pet::CreateBaseAtCreature(Creature* creature)
SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, 0);
SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, objmgr.GetXPForLevel(creature->getLevel())/4);
SetUInt32Value(UNIT_NPC_FLAGS, 0);
SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
if(CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(cinfo->family))
SetName(cFamily->Name[sWorld.GetDefaultDbcLocale()]);

View file

@ -3074,7 +3074,7 @@ void Aura::HandleModPossess(bool apply, bool Real)
if( apply )
{
m_target->SetCharmerGUID(GetCasterGUID());
m_target->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, caster->getFaction());
m_target->setFaction(caster->getFaction());
caster->SetCharm(m_target);
@ -3116,7 +3116,7 @@ void Aura::HandleModPossess(bool apply, bool Real)
else if(m_target->GetTypeId() == TYPEID_UNIT)
{
CreatureInfo const *cinfo = ((Creature*)m_target)->GetCreatureInfo();
m_target->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, cinfo->faction_A);
m_target->setFaction(cinfo->faction_A);
}
caster->SetCharm(NULL);
@ -3205,7 +3205,7 @@ void Aura::HandleModCharm(bool apply, bool Real)
if( apply )
{
m_target->SetCharmerGUID(GetCasterGUID());
m_target->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, caster->getFaction());
m_target->setFaction(caster->getFaction());
m_target->CastStop(m_target == caster ? GetId() : 0);
caster->SetCharm(m_target);
@ -3254,12 +3254,12 @@ void Aura::HandleModCharm(bool apply, bool Real)
if(((Creature*)m_target)->isPet())
{
if(Unit* owner = m_target->GetOwner())
m_target->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, owner->getFaction());
m_target->setFaction(owner->getFaction());
else if(cinfo)
m_target->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, cinfo->faction_A);
m_target->setFaction(cinfo->faction_A);
}
else if(cinfo) // normal creature
m_target->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, cinfo->faction_A);
m_target->setFaction(cinfo->faction_A);
// restore UNIT_FIELD_BYTES_0
if(cinfo && caster->GetTypeId() == TYPEID_PLAYER && caster->getClass() == CLASS_WARLOCK && cinfo->type == CREATURE_TYPE_DEMON)

View file

@ -3268,9 +3268,9 @@ void Spell::EffectSummon(uint32 i)
spawnCreature->SetDuration(duration);
spawnCreature->SetOwnerGUID(m_caster->GetGUID());
spawnCreature->SetUInt32Value(UNIT_NPC_FLAGS, 0);
spawnCreature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
spawnCreature->setPowerType(POWER_MANA);
spawnCreature->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, m_caster->getFaction());
spawnCreature->setFaction(m_caster->getFaction());
spawnCreature->SetUInt32Value(UNIT_FIELD_FLAGS, 0);
spawnCreature->SetUInt32Value(UNIT_FIELD_BYTES_0, 2048);
spawnCreature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
@ -3702,8 +3702,8 @@ void Spell::EffectSummonGuardian(uint32 i)
spawnCreature->SetOwnerGUID(m_caster->GetGUID());
spawnCreature->setPowerType(POWER_MANA);
spawnCreature->SetUInt32Value(UNIT_NPC_FLAGS, 0);
spawnCreature->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, m_caster->getFaction());
spawnCreature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
spawnCreature->setFaction(m_caster->getFaction());
spawnCreature->SetUInt32Value(UNIT_FIELD_FLAGS, 0);
spawnCreature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
spawnCreature->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, 0);
@ -4184,8 +4184,8 @@ void Spell::EffectSummonPet(uint32 i)
NewSummon->SetOwnerGUID(m_caster->GetGUID());
NewSummon->SetCreatorGUID(m_caster->GetGUID());
NewSummon->SetUInt32Value(UNIT_NPC_FLAGS, 0);
NewSummon->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, faction);
NewSummon->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
NewSummon->setFaction(faction);
NewSummon->SetUInt32Value(UNIT_FIELD_BYTES_0, 2048);
NewSummon->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
NewSummon->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, time(NULL));
@ -5984,7 +5984,7 @@ void Spell::EffectSummonCritter(uint32 i)
critter->SetOwnerGUID(m_caster->GetGUID());
critter->SetCreatorGUID(m_caster->GetGUID());
critter->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE,m_caster->getFaction());
critter->setFaction(m_caster->getFaction());
critter->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id);
critter->AIM_Initialize();

View file

@ -11459,7 +11459,7 @@ Pet* Unit::CreateTamedPetFrom(Creature* creatureTarget,uint32 spell_id)
pet->SetOwnerGUID(GetGUID());
pet->SetCreatorGUID(GetGUID());
pet->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, getFaction());
pet->setFaction(getFaction());
pet->SetUInt32Value(UNIT_CREATED_BY_SPELL, spell_id);
if(GetTypeId()==TYPEID_PLAYER)

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "7946"
#define REVISION_NR "7948"
#endif // __REVISION_NR_H__