Changeset 122

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

[svn] Fix a compile error about M_PI_2.
Update Felmyst script to test new setActive function.
Fix the bug that priest's fear is unbreakable (dirty hack before find the correct way).
(some unfinished unused content included, just ignore them, will finish them later)

Original author: megamage
Date: 2008-10-27 10:57:53-05:00

Location:
trunk/src
Files:
7 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_felmyst.cpp

    r90 r122  
    158158        FlightCount = 0; 
    159159 
    160         m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); 
     160        m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING + MOVEMENTFLAG_ONTRANSPORT); 
    161161        m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10); 
    162162        m_creature->SetFloatValue(UNIT_FIELD_COMBATREACH, 10); 
    163163 
    164164        DespawnSummons(MOB_VAPOR_TRAIL); 
     165  m_creature->setActive(false); 
    165166    } 
    166167 
    167168    void Aggro(Unit *who) 
    168169    { 
     170  m_creature->setActive(true); 
    169171        DoZoneInCombat(); 
    170172        m_creature->CastSpell(m_creature, AURA_SUNWELL_RADIANCE, true); 
     
    283285            m_creature->GetMotionMaster()->Clear(false); 
    284286            m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); 
    285             m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); 
     287            m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING + MOVEMENTFLAG_ONTRANSPORT); 
    286288            m_creature->StopMoving(); 
    287289            DoYell(YELL_TAKEOFF, LANG_UNIVERSAL, NULL); 
     
    290292            break; 
    291293        case 1: 
    292             m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT); 
    293294            m_creature->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX()+1, m_creature->GetPositionY(), m_creature->GetPositionZ()+10); 
    294             m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT); 
    295295            Timer[EVENT_FLIGHT_SEQUENCE] = 0; 
    296296            break; 
    297297        case 2: 
    298             if(Player* target = SelectRandomPlayer(50)) 
     298            if(Player* target = SelectRandomPlayer(150)) 
    299299            { 
    300300                Creature* Vapor = m_creature->SummonCreature(MOB_VAPOR, target->GetPositionX()-5+rand()%10, target->GetPositionY()-5+rand()%10, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 9000); 
     
    312312            DespawnSummons(MOB_VAPOR_TRAIL); 
    313313            //m_creature->CastSpell(m_creature, SPELL_VAPOR_SELECT); need core support 
    314             if(Player* target = SelectRandomPlayer(50)) 
     314            if(Player* target = SelectRandomPlayer(150)) 
    315315            { 
    316316                //target->CastSpell(target, SPELL_VAPOR_SUMMON, true); need core support 
     
    331331            break; 
    332332        case 5: 
    333             if(Player* target = SelectRandomPlayer(80)) 
     333            if(Player* target = SelectRandomPlayer(150)) 
    334334            { 
    335335                BreathX = target->GetPositionX(); 
    336336                BreathY = target->GetPositionY(); 
    337337                float x, y, z; 
    338                 target->GetContactPoint(m_creature, x, y, z, 40); 
    339                 m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT); 
     338                target->GetContactPoint(m_creature, x, y, z, 70); 
    340339                m_creature->GetMotionMaster()->MovePoint(0, x, y, z+10); 
    341                 m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT); 
    342340            }else EnterEvadeMode(); 
    343341            Timer[EVENT_FLIGHT_SEQUENCE] = 0; 
     
    356354                x = 2 * BreathX - x; 
    357355                y = 2 * BreathY - y; 
    358                 m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT); 
    359356                m_creature->GetMotionMaster()->MovePoint(0, x, y, z); 
    360                 m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT); 
    361357            } 
    362358            Timer[EVENT_SUMMON_FOG] = 1; 
     
    375371                float x, y, z; 
    376372                target->GetContactPoint(m_creature, x, y, z); 
    377                 m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT); 
    378373                m_creature->GetMotionMaster()->MovePoint(0, x, y, z); 
    379                 m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT); 
    380374            }else EnterEvadeMode(); 
    381375            Timer[EVENT_FLIGHT_SEQUENCE] = 0; 
    382376            break; 
    383377        case 10: 
    384             m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); 
     378            m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING + MOVEMENTFLAG_ONTRANSPORT); 
    385379            m_creature->StopMoving(); 
    386380            m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAND); 
     
    440434                break; 
    441435            case EVENT_ENCAPSULATE: 
    442                 if(Unit* target = SelectRandomPlayer(50)) 
     436                if(Unit* target = SelectRandomPlayer(150)) 
    443437                { 
    444438                    m_creature->CastSpell(target, SPELL_ENCAPSULATE_CHANNEL, false); 
  • trunk/src/game/Object.cpp

    r120 r122  
    15381538        if (angle_offset_ratio < 0.05) angle_offset_ratio = 0.05; 
    15391539        // angle to face `obj` to `this`plus a random angle offset(from -90 degree to 90 degree)*angle_offset_ratio using distance from distance2dMin to distance2dMax includes size of `obj` 
    1540         GetNearPoint(obj,x,y,z,object_size,distance2dMin+(distance2dMax-distance2dMin)*rand_norm(), GetAngle( obj ) + (M_PI_2 - M_PI * rand_norm()) * angle_offset_ratio); 
    1541 } 
     1540        GetNearPoint(obj,x,y,z,object_size,distance2dMin+(distance2dMax-distance2dMin)*rand_norm(), GetAngle( obj ) + (M_PI/2 - M_PI * rand_norm()) * angle_offset_ratio); 
     1541} 
  • trunk/src/game/Spell.cpp

    r114 r122  
    12291229        cell_lock->Visit(cell_lock, world_object_notifier, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster)); 
    12301230    } 
    1231     if(!spellmgr.GetSpellExtraInfo(m_spellInfo->Id, SPELL_EXTRA_INFO_MAX_TARGETS)) 
     1231    if(!spellmgr.GetSpellExtraAttr(m_spellInfo->Id, SPELL_EXTRA_ATTR_MAX_TARGETS)) 
    12321232    { 
    12331233        TypeContainerVisitor<Trinity::SpellNotifierCreatureAndPlayer, GridTypeMapContainer >  grid_object_notifier(notifier); 
     
    13581358        { 
    13591359            if(!unMaxTargets) 
    1360                 unMaxTargets = spellmgr.GetSpellExtraInfo(m_spellInfo->Id, SPELL_EXTRA_INFO_MAX_TARGETS); 
     1360                unMaxTargets = spellmgr.GetSpellExtraAttr(m_spellInfo->Id, SPELL_EXTRA_ATTR_MAX_TARGETS); 
    13611361            m_caster->GetPosition(m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ); 
    13621362        }break; 
     
    14241424        case TARGET_UNIT_CONE_ENEMY_UNKNOWN: 
    14251425        { 
    1426             switch(spellmgr.GetSpellExtraInfo(m_spellInfo->Id, SPELL_EXTRA_INFO_CONE_TYPE)) 
     1426            switch(spellmgr.GetSpellExtraAttr(m_spellInfo->Id, SPELL_EXTRA_ATTR_CONE_TYPE)) 
    14271427            { 
    14281428                default: 
  • trunk/src/game/SpellEffects.cpp

    r110 r122  
    313313 
    314314                // Meteor like spells (divided damage to targets) 
    315                 if(spellmgr.GetSpellExtraInfo(m_spellInfo->Id, SPELL_EXTRA_INFO_SHARE_DAMAGE)) 
     315                if(spellmgr.GetSpellExtraAttr(m_spellInfo->Id, SPELL_EXTRA_ATTR_SHARE_DAMAGE)) 
    316316                { 
    317317                    uint32 count = 0; 
  • trunk/src/game/SpellMgr.cpp

    r110 r122  
    19701970 
    19711971// set data in core for now 
    1972 void SpellMgr::LoadSpellExtraInfo() 
    1973 { 
    1974     SpellExtraInfo info; 
    1975     info.info[SPELL_EXTRA_INFO_CONE_TYPE] = 0; 
    1976     info.info[SPELL_EXTRA_INFO_MAX_TARGETS] = 0; 
    1977     info.info[SPELL_EXTRA_INFO_SHARE_DAMAGE] = 0; 
    1978  
    1979     info.info[SPELL_EXTRA_INFO_CONE_TYPE] = 1; 
    1980     SpellEntry const* tempSpell; 
    1981     for(uint32 i = 0; i < GetSpellStore()->GetNumRows(); ++i) 
    1982     { 
    1983         tempSpell = GetSpellStore()->LookupEntry(i); 
    1984         if(tempSpell && tempSpell->SpellVisual == 3879) 
    1985             mSpellExtraInfoMap[tempSpell->Id] = info; 
    1986     } 
    1987     info.info[SPELL_EXTRA_INFO_CONE_TYPE] = 2; 
    1988     mSpellExtraInfoMap[26029] = info; // dark glare 
    1989     mSpellExtraInfoMap[37433] = info; // spout 
    1990     mSpellExtraInfoMap[43140] = info; // flame breath 
    1991     mSpellExtraInfoMap[43215] = info; // flame breath 
    1992     info.info[SPELL_EXTRA_INFO_CONE_TYPE] = 0; 
    1993  
    1994     info.info[SPELL_EXTRA_INFO_SHARE_DAMAGE] = 1; 
     1972void SpellMgr::LoadSpellExtraAttr() 
     1973{ 
     1974    SpellExtraAttribute tempAttr; 
     1975    tempAttr.attr[SPELL_EXTRA_ATTR_CONE_TYPE] = 0; 
     1976    tempAttr.attr[SPELL_EXTRA_ATTR_MAX_TARGETS] = 0; 
     1977    tempAttr.attr[SPELL_EXTRA_ATTR_SHARE_DAMAGE] = 0; 
     1978 
     1979    tempAttr.attr[SPELL_EXTRA_ATTR_CONE_TYPE] = 1; 
     1980    { 
     1981        SpellEntry const* tempSpell; 
     1982        for(uint32 i = 0; i < GetSpellStore()->GetNumRows(); ++i) 
     1983        { 
     1984            tempSpell = GetSpellStore()->LookupEntry(i); 
     1985            if(tempSpell && tempSpell->SpellVisual == 3879) 
     1986                mSpellExtraAttrMap[tempSpell->Id] = tempAttr; 
     1987        } 
     1988    } 
     1989    tempAttr.attr[SPELL_EXTRA_ATTR_CONE_TYPE] = 2; 
     1990    mSpellExtraAttrMap[26029] = tempAttr; // dark glare 
     1991    mSpellExtraAttrMap[37433] = tempAttr; // spout 
     1992    mSpellExtraAttrMap[43140] = tempAttr; // flame breath 
     1993    mSpellExtraAttrMap[43215] = tempAttr; // flame breath 
     1994    tempAttr.attr[SPELL_EXTRA_ATTR_CONE_TYPE] = 0; 
     1995 
     1996    tempAttr.attr[SPELL_EXTRA_ATTR_SHARE_DAMAGE] = 1; 
    19951997    for(uint32 i = 0; i < 46000; ++i) 
    19961998    { 
     
    20052007            case 42384:                             // Brutal Swipe 
    20062008            case 45150:                             // Meteor Slash 
    2007                 mSpellExtraInfoMap[i] = info; 
     2009                mSpellExtraAttrMap[i] = tempAttr; 
    20082010                break; 
    20092011            default: 
     
    20112013        } 
    20122014    } 
    2013     info.info[SPELL_EXTRA_INFO_SHARE_DAMAGE] = 0; 
    2014  
    2015     info.info[SPELL_EXTRA_INFO_MAX_TARGETS] = 1; 
     2015    tempAttr.attr[SPELL_EXTRA_ATTR_SHARE_DAMAGE] = 0; 
     2016 
     2017    tempAttr.attr[SPELL_EXTRA_ATTR_MAX_TARGETS] = 1; 
    20162018    for(uint32 i = 0; i < 46000; ++i) 
    20172019    { 
     
    20222024            case 31347: // Doom 
    20232025            case 41635: // Prayer of Mending 
    2024                 mSpellExtraInfoMap[i] = info; 
     2026                mSpellExtraAttrMap[i] = tempAttr; 
    20252027                break; 
    20262028            default: 
     
    20282030        } 
    20292031    } 
    2030     info.info[SPELL_EXTRA_INFO_MAX_TARGETS] = 3; 
    2031     mSpellExtraInfoMap[41376] = info;   //Spite 
    2032     info.info[SPELL_EXTRA_INFO_MAX_TARGETS] = 0; 
     2032    tempAttr.attr[SPELL_EXTRA_ATTR_MAX_TARGETS] = 3; 
     2033    mSpellExtraAttrMap[41376] = tempAttr;   //Spite 
     2034    tempAttr.attr[SPELL_EXTRA_ATTR_MAX_TARGETS] = 0; 
     2035 
     2036    //hack here, only for those strange exceptions! 
     2037    // Psychic Scream 
     2038    SpellEntry *tempSpell; 
     2039    if(tempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(8122)) 
     2040        tempSpell->AttributesEx |= SPELL_ATTR_BREAKABLE_BY_DAMAGE; 
     2041    if(tempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(8124)) 
     2042        tempSpell->AttributesEx |= SPELL_ATTR_BREAKABLE_BY_DAMAGE; 
     2043    if(tempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(10888)) 
     2044        tempSpell->AttributesEx |= SPELL_ATTR_BREAKABLE_BY_DAMAGE; 
     2045    if(tempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(10890)) 
     2046        tempSpell->AttributesEx |= SPELL_ATTR_BREAKABLE_BY_DAMAGE; 
     2047} 
     2048 
     2049void SpellMgr::LoadSpellLinked() 
     2050{ 
     2051    mSpellLinkedMap.clear();    // need for reload case 
     2052    uint32 count = 0; 
     2053 
     2054    //                                                0       1 
     2055    QueryResult *result = WorldDatabase.Query("SELECT spell0, spell1 FROM spell_linked_spell"); 
     2056    if( !result ) 
     2057    { 
     2058        barGoLink bar( 1 ); 
     2059        bar.step(); 
     2060        sLog.outString(); 
     2061        sLog.outString( ">> Loaded %u spell pet auras", count ); 
     2062        return; 
     2063    } 
     2064 
     2065    barGoLink bar( result->GetRowCount() ); 
     2066 
     2067    do 
     2068    { 
     2069        Field *fields = result->Fetch(); 
     2070 
     2071        bar.step(); 
     2072 
     2073        uint16 spell = fields[0].GetUInt16(); 
     2074        uint16 pet = fields[1].GetUInt16(); 
     2075        uint16 aura = fields[2].GetUInt16(); 
     2076 
     2077        SpellPetAuraMap::iterator itr = mSpellPetAuraMap.find(spell); 
     2078        if(itr != mSpellPetAuraMap.end()) 
     2079        { 
     2080            itr->second.AddAura(pet, aura); 
     2081        } 
     2082        else 
     2083        { 
     2084            SpellEntry const* spellInfo = sSpellStore.LookupEntry(spell); 
     2085            if (!spellInfo) 
     2086            { 
     2087                sLog.outErrorDb("Spell %u listed in `spell_pet_auras` does not exist", spell); 
     2088                continue; 
     2089            } 
     2090            int i = 0; 
     2091            for(; i < 3; ++i) 
     2092                if((spellInfo->Effect[i] == SPELL_EFFECT_APPLY_AURA && 
     2093                    spellInfo->EffectApplyAuraName[i] == SPELL_AURA_DUMMY) || 
     2094                    spellInfo->Effect[i] == SPELL_EFFECT_DUMMY) 
     2095                    break; 
     2096 
     2097            if(i == 3) 
     2098            { 
     2099                sLog.outError("Spell %u listed in `spell_pet_auras` does not have dummy aura or dummy effect", spell); 
     2100                continue; 
     2101            } 
     2102 
     2103            SpellEntry const* spellInfo2 = sSpellStore.LookupEntry(aura); 
     2104            if (!spellInfo2) 
     2105            { 
     2106                sLog.outErrorDb("Aura %u listed in `spell_pet_auras` does not exist", aura); 
     2107                continue; 
     2108            } 
     2109 
     2110            PetAura pa(pet, aura, spellInfo->EffectImplicitTargetA[i] == TARGET_PET, spellInfo->EffectBasePoints[i] + spellInfo->EffectBaseDice[i]); 
     2111            mSpellPetAuraMap[spell] = pa; 
     2112        } 
     2113 
     2114        ++count; 
     2115    } while( result->NextRow() ); 
     2116 
     2117    delete result; 
     2118 
     2119    sLog.outString(); 
     2120    sLog.outString( ">> Loaded %u spell pet auras", count ); 
    20332121} 
    20342122 
  • trunk/src/game/SpellMgr.h

    r110 r122  
    635635} 
    636636 
    637 enum SpellExtraInfoType 
    638 { 
    639     SPELL_EXTRA_INFO_MAX_TARGETS, 
    640     SPELL_EXTRA_INFO_CONE_TYPE, 
    641     SPELL_EXTRA_INFO_SHARE_DAMAGE 
    642 }; 
    643  
    644 struct SpellExtraInfo 
    645 { 
    646     uint32 info[3]; 
    647 }; 
    648  
    649 typedef std::map<uint32, SpellExtraInfo> SpellExtraInfoMap; 
     637enum SpellExtraAttributeType 
     638{ 
     639    SPELL_EXTRA_ATTR_MAX_TARGETS, 
     640    SPELL_EXTRA_ATTR_CONE_TYPE, 
     641    SPELL_EXTRA_ATTR_SHARE_DAMAGE 
     642}; 
     643 
     644struct SpellExtraAttribute 
     645{ 
     646    uint32 attr[3]; 
     647}; 
     648 
     649typedef std::map<uint32, SpellExtraAttribute> SpellExtraAttrMap; 
     650 
     651typedef std::map<int32, int32> SpellLinkedMap; 
    650652 
    651653class SpellMgr 
     
    847849        } 
    848850 
    849         uint32 GetSpellExtraInfo(uint32 spell_id, uint32 type) const 
    850         { 
    851             SpellExtraInfoMap::const_iterator itr = mSpellExtraInfoMap.find(spell_id); 
    852             if(itr != mSpellExtraInfoMap.end()) 
    853                 return itr->second.info[type]; 
     851        uint32 GetSpellExtraAttr(uint32 spell_id, uint32 type) const 
     852        { 
     853            SpellExtraAttrMap::const_iterator itr = mSpellExtraAttrMap.find(spell_id); 
     854            if(itr != mSpellExtraAttrMap.end()) 
     855                return itr->second.attr[type]; 
     856            else 
     857                return 0; 
     858        } 
     859 
     860        int32 GetSpellLinked(int32 spell_id) const 
     861        { 
     862            SpellLinkedMap::const_iterator itr = mSpellLinkedMap.find(spell_id); 
     863            if(itr != mSpellLinkedMap.end()) 
     864                return itr->second; 
    854865            else 
    855866                return 0; 
     
    872883        void LoadSkillLineAbilityMap(); 
    873884        void LoadSpellPetAuras(); 
    874         void LoadSpellExtraInfo(); 
     885        void LoadSpellExtraAttr(); 
     886        void LoadSpellLinked(); 
    875887 
    876888    private: 
     
    886898        SkillLineAbilityMap mSkillLineAbilityMap; 
    887899        SpellPetAuraMap     mSpellPetAuraMap; 
    888         SpellExtraInfoMap   mSpellExtraInfoMap; 
     900        SpellExtraAttrMap   mSpellExtraAttrMap; 
     901        SpellLinkedMap      mSpellLinkedMap; 
    889902}; 
    890903 
  • trunk/src/game/World.cpp

    r112 r122  
    10941094    spellmgr.LoadSpellPetAuras(); 
    10951095 
    1096     sLog.outString( "Loading spell extra infos...(TODO)" ); 
    1097     spellmgr.LoadSpellExtraInfo(); 
     1096    sLog.outString( "Loading spell extra attributes...(TODO)" ); 
     1097    spellmgr.LoadSpellExtraAttr(); 
    10981098 
    10991099    sLog.outString( "Loading player Create Info & Level Stats..." );