Changeset 161 for trunk

Show
Ignore:
Timestamp:
11/19/08 13:41:55 (17 years ago)
Author:
yumileroy
Message:

[svn] Fix 146_world.sql. Do not use default for text. (Ignore this if you have successfully applied 146_world.sql)
Fix HandleAuraModIncreaseHealth?, also increase current health.
Merge from Mangos:
2008-11-02 10:53:27 854e0d64e3410b2a1eff6d56705f8e42b4291534 Do not split self caused damage.
(PART) 2008-10-31 12:45:22 e56b671979623570acd358a9b99aa169be22ffba Move tamed pet creating code to new function.

Original author: megamage
Date: 2008-11-04 09:23:06-06:00

Location:
trunk
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • trunk/sql/updates/146_world.sql

    r160 r161  
    66  `spell_effect` int(10) NOT NULL default '0', 
    77  `type` smallint(3) unsigned NOT NULL default '0', 
    8   `comment` text NOT NULL default '', 
     8  `comment` text NOT NULL, 
    99  PRIMARY KEY (`spell_trigger`) 
    1010) ENGINE=MyISAM DEFAULT CHARSET=utf8; 
  • trunk/src/game/Creature.cpp

    r136 r161  
    1111 * This program is distributed in the hope that it will be useful, 
    1212 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
     13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    1414 * GNU General Public License for more details. 
    1515 * 
    1616 * You should have received a copy of the GNU General Public License 
    1717 * along with this program; if not, write to the Free Software 
    18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
     18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
    1919 */ 
    2020 
     
    122122m_lootMoney(0), m_lootRecipient(0), 
    123123m_deathTimer(0), m_respawnTime(0), m_respawnDelay(25), m_corpseDelay(60), m_respawnradius(0.0f), 
    124 m_gossipOptionLoaded(false),m_emoteState(0), m_isPet(false), m_isTotem(false), 
     124m_gossipOptionLoaded(false), m_emoteState(0), m_isPet(false), m_isTotem(false), 
    125125m_regenTimer(2000), m_defaultMovementType(IDLE_MOTION_TYPE), m_equipmentId(0), 
    126126m_AlreadyCallAssistence(false), m_regenHealth(true), m_AI_locked(false), m_isDeadByDefault(false), 
     
    574574 
    575575    TrainerSpellData const* trainer_spells = GetTrainerSpells(); 
    576  
    577576 
    578577    if(!trainer_spells || trainer_spells->spellList.empty()) 
     
    835834    uint32 zoneid=GetZoneId(); 
    836835    uint64 guid=GetGUID(); 
     836 
    837837    GossipOption const *gossip=GetGossipOption( action ); 
    838838    uint32 textid; 
     
    852852        case GOSSIP_OPTION_GOSSIP: 
    853853            player->PlayerTalkClass->CloseGossip(); 
    854             player->PlayerTalkClass->SendTalking( textid ); 
     854            player->PlayerTalkClass->SendTalking(textid); 
    855855            break; 
    856856        case GOSSIP_OPTION_OUTDOORPVP: 
     
    858858            break; 
    859859        case GOSSIP_OPTION_SPIRITHEALER: 
    860             if( player->isDead() ) 
     860            if (player->isDead()) 
    861861                CastSpell(this,17251,true,NULL,NULL,player->GetGUID()); 
    862862            break; 
     
    13941394        if (force) 
    13951395        { 
    1396             for (uint8 i=0;i<3;i++) 
     1396            for (uint8 i = 0; i < 3; i++) 
    13971397            { 
    13981398                SetUInt32Value( UNIT_VIRTUAL_ITEM_SLOT_DISPLAY + i, 0); 
     
    14101410 
    14111411    m_equipmentId = equip_entry; 
    1412     for (uint8 i=0;i<3;i++) 
     1412    for (uint8 i = 0; i < 3; i++) 
    14131413    { 
    14141414        SetUInt32Value( UNIT_VIRTUAL_ITEM_SLOT_DISPLAY + i, einfo->equipmodel[i]); 
     
    20232023} 
    20242024 
    2025  
    20262025VendorItemData const* Creature::GetVendorItems() const 
    20272026{ 
     
    20532052        if((vCount->count + diff * pProto->BuyCount) >= vItem->maxcount ) 
    20542053        { 
    2055             m_vendorItemCounts.erase(itr);         
     2054            m_vendorItemCounts.erase(itr); 
    20562055            return vItem->maxcount; 
    20572056        } 
  • trunk/src/game/SpellAuras.cpp

    r139 r161  
    1111 * This program is distributed in the hope that it will be useful, 
    1212 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
     13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    1414 * GNU General Public License for more details. 
    1515 * 
    1616 * You should have received a copy of the GNU General Public License 
    1717 * along with this program; if not, write to the Free Software 
    18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
     18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
    1919 */ 
    2020 
     
    29122912        if(m_target->GetTypeId() == TYPEID_PLAYER) 
    29132913            ((Player*)m_target)->setFactionForRace(m_target->getRace()); 
    2914  
    29152914        else if(m_target->GetTypeId() == TYPEID_UNIT) 
    29162915        { 
     
    46254624void Aura::HandleAuraModIncreaseHealth(bool apply, bool Real) 
    46264625{ 
    4627     // Special case with temporary increase max/current health 
    4628     switch(GetId()) 
    4629     { 
    4630         case 12976:                                         // Warrior Last Stand triggered spell 
    4631         case 28726:                                         // Nightmare Seed ( Nightmare Seed ) 
    4632         case 34511:                                         // Valor (Bulwark of Kings, Bulwark of the Ancient Kings) 
    4633         case 44055:                                         // Tremendous Fortitude (Battlemaster's Alacrity) 
    4634         { 
    4635             if(Real) 
    4636             { 
    4637                 if(apply) 
    4638                 { 
    4639                     m_target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_VALUE, float(m_modifier.m_amount), apply); 
    4640                     m_target->ModifyHealth(m_modifier.m_amount); 
    4641                 } 
    4642                 else 
    4643                 { 
    4644                     if (int32(m_target->GetHealth()) > m_modifier.m_amount) 
    4645                         m_target->ModifyHealth(-m_modifier.m_amount); 
    4646                     else 
    4647                         m_target->SetHealth(1); 
    4648                     m_target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_VALUE, float(m_modifier.m_amount), apply); 
    4649                 } 
    4650             } 
    4651             return; 
    4652         } 
    4653     } 
    4654  
    4655     // generic case 
    4656     m_target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_VALUE, float(m_modifier.m_amount), apply); 
     4626    if(Real) 
     4627    { 
     4628        if(apply) 
     4629        { 
     4630            m_target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_VALUE, float(m_modifier.m_amount), apply); 
     4631            m_target->ModifyHealth(m_modifier.m_amount); 
     4632        } 
     4633        else 
     4634        { 
     4635            if (int32(m_target->GetHealth()) > m_modifier.m_amount) 
     4636                m_target->ModifyHealth(-m_modifier.m_amount); 
     4637            else 
     4638                m_target->SetHealth(1); 
     4639            m_target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_VALUE, float(m_modifier.m_amount), apply); 
     4640        } 
     4641    } 
    46574642} 
    46584643 
  • trunk/src/game/SpellEffects.cpp

    r160 r161  
    1111 * This program is distributed in the hope that it will be useful, 
    1212 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
     13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    1414 * GNU General Public License for more details. 
    1515 * 
    1616 * You should have received a copy of the GNU General Public License 
    1717 * along with this program; if not, write to the Free Software 
    18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
     18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
    1919 */ 
    2020 
     
    39193919        return; 
    39203920 
    3921     if(m_caster->getClass() == CLASS_HUNTER) 
    3922     { 
    3923         // cast finish successfully 
    3924         //SendChannelUpdate(0); 
    3925         finish(); 
    3926  
    3927         Pet* pet = new Pet(HUNTER_PET); 
    3928  
    3929         if(!pet->CreateBaseAtCreature(creatureTarget)) 
    3930         { 
    3931             delete pet; 
    3932             return; 
    3933         } 
    3934  
    3935         creatureTarget->setDeathState(JUST_DIED); 
    3936         creatureTarget->RemoveCorpse(); 
    3937         creatureTarget->SetHealth(0);                       // just for nice GM-mode view 
    3938  
    3939         pet->SetUInt64Value(UNIT_FIELD_SUMMONEDBY, m_caster->GetGUID()); 
    3940         pet->SetUInt64Value(UNIT_FIELD_CREATEDBY, m_caster->GetGUID()); 
    3941         pet->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE,m_caster->getFaction()); 
    3942         pet->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id); 
    3943  
    3944         if(!pet->InitStatsForLevel(creatureTarget->getLevel())) 
    3945         { 
    3946             sLog.outError("ERROR: InitStatsForLevel() in EffectTameCreature failed! Pet deleted."); 
    3947             delete pet; 
    3948             return; 
    3949         } 
    3950  
    3951         // prepare visual effect for levelup 
    3952         pet->SetUInt32Value(UNIT_FIELD_LEVEL,creatureTarget->getLevel()-1); 
    3953  
    3954         pet->GetCharmInfo()->SetPetNumber(objmgr.GeneratePetNumber(), true); 
    3955                                                             // this enables pet details window (Shift+P) 
    3956         pet->AIM_Initialize(); 
    3957         pet->InitPetCreateSpells(); 
    3958         pet->SetHealth(pet->GetMaxHealth()); 
    3959  
    3960         MapManager::Instance().GetMap(pet->GetMapId(), pet)->Add((Creature*)pet); 
    3961  
    3962         // visual effect for levelup 
    3963         pet->SetUInt32Value(UNIT_FIELD_LEVEL,creatureTarget->getLevel()); 
    3964  
    3965         if(m_caster->GetTypeId() == TYPEID_PLAYER) 
    3966         { 
    3967             m_caster->SetPet(pet); 
    3968             pet->SavePetToDB(PET_SAVE_AS_CURRENT); 
    3969             ((Player*)m_caster)->PetSpellInitialize(); 
    3970         } 
     3921    if(m_caster->getClass() != CLASS_HUNTER) 
     3922        return; 
     3923 
     3924    // cast finish successfully 
     3925    //SendChannelUpdate(0); 
     3926    finish(); 
     3927 
     3928    Pet* pet = m_caster->CreateTamedPetFrom(creatureTarget,m_spellInfo->Id); 
     3929 
     3930    // kill original creature 
     3931    creatureTarget->setDeathState(JUST_DIED); 
     3932    creatureTarget->RemoveCorpse(); 
     3933    creatureTarget->SetHealth(0);                       // just for nice GM-mode view 
     3934 
     3935    // prepare visual effect for levelup 
     3936    pet->SetUInt32Value(UNIT_FIELD_LEVEL,creatureTarget->getLevel()-1); 
     3937 
     3938    // add to world 
     3939    MapManager::Instance().GetMap(pet->GetMapId(), pet)->Add((Creature*)pet); 
     3940 
     3941    // visual effect for levelup 
     3942    pet->SetUInt32Value(UNIT_FIELD_LEVEL,creatureTarget->getLevel()); 
     3943 
     3944    // caster have pet now 
     3945    m_caster->SetPet(pet); 
     3946 
     3947    if(m_caster->GetTypeId() == TYPEID_PLAYER) 
     3948    { 
     3949        pet->SavePetToDB(PET_SAVE_AS_CURRENT); 
     3950        ((Player*)m_caster)->PetSpellInitialize(); 
    39713951    } 
    39723952} 
  • trunk/src/game/Unit.cpp

    r157 r161  
    1111 * This program is distributed in the hope that it will be useful, 
    1212 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
     13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    1414 * GNU General Public License for more details. 
    1515 * 
    1616 * You should have received a copy of the GNU General Public License 
    1717 * along with this program; if not, write to the Free Software 
    18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
     18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
    1919 */ 
    2020 
     
    16971697    } 
    16981698 
    1699     AuraList const& vSplitDamageFlat = pVictim->GetAurasByType(SPELL_AURA_SPLIT_DAMAGE_FLAT); 
    1700     for(AuraList::const_iterator i = vSplitDamageFlat.begin(), next; i != vSplitDamageFlat.end() && RemainingDamage >= 0; i = next) 
    1701     { 
    1702         next = i; ++next; 
    1703  
    1704         // check damage school mask 
    1705         if(((*i)->GetModifier()->m_miscvalue & schoolMask)==0) 
    1706             continue; 
    1707  
    1708         // Damage can be splitted only if aura has an alive caster 
    1709         Unit *caster = (*i)->GetCaster(); 
    1710         if(!caster || caster == pVictim || !caster->IsInWorld() || !caster->isAlive()) 
    1711             continue; 
    1712  
    1713         int32 currentAbsorb; 
    1714         if (RemainingDamage >= (*i)->GetModifier()->m_amount) 
    1715             currentAbsorb = (*i)->GetModifier()->m_amount; 
    1716         else 
    1717             currentAbsorb = RemainingDamage; 
    1718  
    1719         RemainingDamage -= currentAbsorb; 
    1720  
    1721         SendSpellNonMeleeDamageLog(caster, (*i)->GetSpellProto()->Id, currentAbsorb, schoolMask, 0, 0, false, 0, false); 
    1722  
    1723         CleanDamage cleanDamage = CleanDamage(currentAbsorb, BASE_ATTACK, MELEE_HIT_NORMAL); 
    1724         DealDamage(caster, currentAbsorb, &cleanDamage, DIRECT_DAMAGE, schoolMask, (*i)->GetSpellProto(), false); 
    1725     } 
    1726  
    1727     AuraList const& vSplitDamagePct = pVictim->GetAurasByType(SPELL_AURA_SPLIT_DAMAGE_PCT); 
    1728     for(AuraList::const_iterator i = vSplitDamagePct.begin(), next; i != vSplitDamagePct.end() && RemainingDamage >= 0; i = next) 
    1729     { 
    1730         next = i; ++next; 
    1731  
    1732         // check damage school mask 
    1733         if(((*i)->GetModifier()->m_miscvalue & schoolMask)==0) 
    1734             continue; 
    1735  
    1736         // Damage can be splitted only if aura has an alive caster 
    1737         Unit *caster = (*i)->GetCaster(); 
    1738         if(!caster || caster == pVictim || !caster->IsInWorld() || !caster->isAlive()) 
    1739             continue; 
    1740  
    1741         int32 splitted = int32(RemainingDamage * (*i)->GetModifier()->m_amount / 100.0f); 
    1742  
    1743         RemainingDamage -= splitted; 
    1744  
    1745         SendSpellNonMeleeDamageLog(caster, (*i)->GetSpellProto()->Id, splitted, schoolMask, 0, 0, false, 0, false); 
    1746  
    1747         CleanDamage cleanDamage = CleanDamage(splitted, BASE_ATTACK, MELEE_HIT_NORMAL); 
    1748         DealDamage(caster, splitted, &cleanDamage, DIRECT_DAMAGE, schoolMask, (*i)->GetSpellProto(), false); 
     1699    // only split damage if not damaing yourself 
     1700    if(pVictim != this) 
     1701    { 
     1702        AuraList const& vSplitDamageFlat = pVictim->GetAurasByType(SPELL_AURA_SPLIT_DAMAGE_FLAT); 
     1703        for(AuraList::const_iterator i = vSplitDamageFlat.begin(), next; i != vSplitDamageFlat.end() && RemainingDamage >= 0; i = next) 
     1704        { 
     1705            next = i; ++next; 
     1706 
     1707            // check damage school mask 
     1708            if(((*i)->GetModifier()->m_miscvalue & schoolMask)==0) 
     1709                continue; 
     1710 
     1711            // Damage can be splitted only if aura has an alive caster 
     1712            Unit *caster = (*i)->GetCaster(); 
     1713            if(!caster || caster == pVictim || !caster->IsInWorld() || !caster->isAlive()) 
     1714                continue; 
     1715 
     1716            int32 currentAbsorb; 
     1717            if (RemainingDamage >= (*i)->GetModifier()->m_amount) 
     1718                currentAbsorb = (*i)->GetModifier()->m_amount; 
     1719            else 
     1720                currentAbsorb = RemainingDamage; 
     1721 
     1722            RemainingDamage -= currentAbsorb; 
     1723 
     1724            SendSpellNonMeleeDamageLog(caster, (*i)->GetSpellProto()->Id, currentAbsorb, schoolMask, 0, 0, false, 0, false); 
     1725 
     1726            CleanDamage cleanDamage = CleanDamage(currentAbsorb, BASE_ATTACK, MELEE_HIT_NORMAL); 
     1727            DealDamage(caster, currentAbsorb, &cleanDamage, DIRECT_DAMAGE, schoolMask, (*i)->GetSpellProto(), false); 
     1728        } 
     1729 
     1730        AuraList const& vSplitDamagePct = pVictim->GetAurasByType(SPELL_AURA_SPLIT_DAMAGE_PCT); 
     1731        for(AuraList::const_iterator i = vSplitDamagePct.begin(), next; i != vSplitDamagePct.end() && RemainingDamage >= 0; i = next) 
     1732        { 
     1733            next = i; ++next; 
     1734 
     1735            // check damage school mask 
     1736            if(((*i)->GetModifier()->m_miscvalue & schoolMask)==0) 
     1737                continue; 
     1738 
     1739            // Damage can be splitted only if aura has an alive caster 
     1740            Unit *caster = (*i)->GetCaster(); 
     1741            if(!caster || caster == pVictim || !caster->IsInWorld() || !caster->isAlive()) 
     1742                continue; 
     1743 
     1744            int32 splitted = int32(RemainingDamage * (*i)->GetModifier()->m_amount / 100.0f); 
     1745 
     1746            RemainingDamage -= splitted; 
     1747 
     1748            SendSpellNonMeleeDamageLog(caster, (*i)->GetSpellProto()->Id, splitted, schoolMask, 0, 0, false, 0, false); 
     1749 
     1750            CleanDamage cleanDamage = CleanDamage(splitted, BASE_ATTACK, MELEE_HIT_NORMAL); 
     1751            DealDamage(caster, splitted, &cleanDamage, DIRECT_DAMAGE, schoolMask, (*i)->GetSpellProto(), false); 
     1752        } 
    17491753    } 
    17501754 
     
    19451949 
    19461950                // after parry nearest next attack time will reduced at %40 from full attack time. 
    1947                 // The delay cannot be reduced to less than 20% of your weapon's base swing delay. 
     1951                // The delay cannot be reduced to less than 20% of your weapon base swing delay. 
    19481952                if (pVictim->haveOffhandWeapon() && offtime < basetime) 
    19491953                { 
     
    64906494        case 836:                                           // Improved Blizzard (Rank 1) 
    64916495        { 
    6492             if( !procSpell || procSpell->SpellVisual!=9487) 
     6496            if (!procSpell || procSpell->SpellVisual!=9487) 
    64936497                return false; 
    64946498            triggered_spell_id = 12484; 
     
    64976501        case 988:                                           // Improved Blizzard (Rank 2) 
    64986502        { 
    6499             if( !procSpell || procSpell->SpellVisual!=9487) 
     6503            if (!procSpell || procSpell->SpellVisual!=9487) 
    65006504                return false; 
    65016505            triggered_spell_id = 12485; 
     
    65046508        case 989:                                           // Improved Blizzard (Rank 3) 
    65056509        { 
    6506             if( !procSpell || procSpell->SpellVisual!=9487) 
     6510            if (!procSpell || procSpell->SpellVisual!=9487) 
    65076511                return false; 
    65086512            triggered_spell_id = 12486; 
     
    73037307        } 
    73047308    } 
     7309 
    73057310    // .. taken pct: dummy auras 
    73067311    AuraList const& mDummyAuras = pVictim->GetAurasByType(SPELL_AURA_DUMMY); 
     
    75367541            } 
    75377542            // Holy Nova - 14% 
    7538             else if ((spellProto->SpellFamilyFlags & 0x400000LL) && spellProto->SpellIconID == 1874)  
     7543            else if ((spellProto->SpellFamilyFlags & 0x400000LL) && spellProto->SpellIconID == 1874) 
    75397544            { 
    75407545                CastingTime = 500; 
     
    77767781        return healamount; 
    77777782 
    7778  
    77797783    int32 AdvertisedBenefit = SpellBaseHealingBonus(GetSpellSchoolMask(spellProto)); 
    77807784    uint32 CastingTime = GetSpellCastTime(spellProto); 
     
    78817885            case SPELLFAMILY_PRIEST: 
    78827886                // Holy Nova - 14% 
    7883                 if ((spellProto->SpellFamilyFlags & 0x8000000LL) && spellProto->SpellIconID == 1874)  
     7887                if ((spellProto->SpellFamilyFlags & 0x8000000LL) && spellProto->SpellIconID == 1874) 
    78847888                    CastingTime = 500; 
    78857889                break; 
     
    86438647    // raw invisibility 
    86448648    bool invisible = (m_invisibilityMask != 0 || u->m_invisibilityMask !=0); 
    8645      
     8649 
    86468650    // detectable invisibility case 
    86478651    if( invisible && ( 
     
    1037610380    WorldPacket data(SMSG_SPELL_COOLDOWN, 8+1+4+4); 
    1037710381    data << uint64(GetGUID()); 
    10378     data << uint8(0x0); 
     10382    data << uint8(0x0);                                     // flags (0x1, 0x2) 
    1037910383    data << uint32(spellid); 
    1038010384    data << uint32(cooltime); 
     
    1088710891        pet->RemoveAurasDueToSpell(petSpell->GetAura(pet->GetEntry())); 
    1088810892} 
     10893 
     10894Pet* Unit::CreateTamedPetFrom(Creature* creatureTarget,uint32 spell_id) 
     10895{ 
     10896    Pet* pet = new Pet(HUNTER_PET); 
     10897 
     10898    if(!pet->CreateBaseAtCreature(creatureTarget)) 
     10899    { 
     10900        delete pet; 
     10901        return NULL; 
     10902    } 
     10903 
     10904    pet->SetUInt64Value(UNIT_FIELD_SUMMONEDBY, this->GetGUID()); 
     10905    pet->SetUInt64Value(UNIT_FIELD_CREATEDBY, this->GetGUID()); 
     10906    pet->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE,this->getFaction()); 
     10907    pet->SetUInt32Value(UNIT_CREATED_BY_SPELL, spell_id); 
     10908 
     10909    if(!pet->InitStatsForLevel(creatureTarget->getLevel())) 
     10910    { 
     10911        sLog.outError("ERROR: Pet::InitStatsForLevel() failed for creature (Entry: %u)!",creatureTarget->GetEntry()); 
     10912        delete pet; 
     10913        return NULL; 
     10914    } 
     10915 
     10916    pet->GetCharmInfo()->SetPetNumber(objmgr.GeneratePetNumber(), true); 
     10917    // this enables pet details window (Shift+P) 
     10918    pet->AIM_Initialize(); 
     10919    pet->InitPetCreateSpells(); 
     10920    pet->SetHealth(pet->GetMaxHealth()); 
     10921 
     10922    return pet; 
     10923} 
  • trunk/src/game/Unit.h

    r149 r161  
    1111 * This program is distributed in the hope that it will be useful, 
    1212 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
     13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    1414 * GNU General Public License for more details. 
    1515 * 
     
    217217    HITINFO_RESIST              = 0x00000040,               // resisted atleast some damage 
    218218    HITINFO_CRITICALHIT         = 0x00000080, 
     219    HITINFO_UNK2                = 0x00000100,               // wotlk? 
     220    HITINFO_UNK3                = 0x00002000,               // wotlk? 
    219221    HITINFO_GLANCING            = 0x00004000, 
    220222    HITINFO_CRUSHING            = 0x00008000, 
     
    513515    UNIT_NPC_FLAG_STABLEMASTER          = 0x00400000,       // 100% 
    514516    UNIT_NPC_FLAG_GUILD_BANKER          = 0x00800000,       // cause client to send 997 opcode 
    515     UNIT_NPC_FLAG_UNK3                  = 0x01000000,       // cause client to send 1015 opcode 
     517    UNIT_NPC_FLAG_SPELLCLICK            = 0x01000000,       // cause client to send 1015 opcode (spell click) 
    516518    UNIT_NPC_FLAG_GUARD                 = 0x10000000,       // custom flag for guards 
    517519    UNIT_NPC_FLAG_OUTDOORPVP            = 0x20000000,       // custom flag for outdoor pvp creatures 
     
    648650        bool HasCommandState(CommandStates state) { return (m_CommandState == state); } 
    649651        void SetReactState(ReactStates st) { m_reactState = st; } 
    650                 ReactStates GetReactState() { return m_reactState; } 
    651                 bool HasReactState(ReactStates state) { return (m_reactState == state); } 
     652        ReactStates GetReactState() { return m_reactState; } 
     653        bool HasReactState(ReactStates state) { return (m_reactState == state); } 
    652654 
    653655        void InitPossessCreateSpells(); 
     
    992994        CharmInfo* GetCharmInfo() { return m_charmInfo; } 
    993995        CharmInfo* InitCharmInfo(Unit* charm); 
     996 
     997        Pet* CreateTamedPetFrom(Creature* creatureTarget,uint32 spell_id = 0); 
    994998 
    995999        bool AddAura(Aura *aur); 
     
    13301334        bool HandleHasteAuraProc(Unit *pVictim, SpellEntry const *spellProto, uint32 effIndex, uint32 damage, Aura* triggredByAura, SpellEntry const * procSpell, uint32 procFlag,uint32 cooldown); 
    13311335        bool HandleOverrideClassScriptAuraProc(Unit *pVictim, int32 scriptId, uint32 damage, Aura* triggredByAura, SpellEntry const *procSpell,uint32 cooldown); 
     1336 
    13321337        uint32 m_state;                                     // Even derived shouldn't modify 
    13331338        uint32 m_CombatTimer;