Changeset 18 for trunk/src/bindings

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

[svn] * Little fix in RandomMovementGenerator?
* Updated to 6731 and 680

Original author: Neo2003
Date: 2008-10-06 04:48:59-05:00

Location:
trunk/src/bindings/scripts
Files:
20 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/bindings/scripts/docs/EventAI.txt

    r2 r18  
    6806803       8           CAST_NO_MELEE_IF_OOM           Prevents creature from entering melee if out of mana or out of range 
    6816814       16          CAST_FORCE_TARGET_SELF         Forces the target to cast this spell on itself 
     6825       32          CAST_AURA_NOT_PRESENT          Only casts the spell on the target if the target does not have the aura from that spell on itself already. 
    682683 
    683684NOTE: You can add the numbers in the decimal column to combine flags.  
  • trunk/src/bindings/scripts/include/sc_creature.cpp

    r13 r18  
    3636            if (!InCombat) 
    3737            { 
     38                InCombat = true; 
    3839                Aggro(who); 
    39                 InCombat = true; 
    4040            } 
    4141        } 
     
    5555        if (!InCombat) 
    5656        { 
     57            InCombat = true; 
    5758            Aggro(who); 
    58             InCombat = true; 
    5959        } 
    6060    } 
     
    583583            if (!InCombat) 
    584584            { 
     585                InCombat = true; 
    585586                Aggro(who); 
    586                 InCombat = true; 
    587587            } 
    588588        } 
     
    602602        if (!InCombat) 
    603603        { 
     604            InCombat = true; 
    604605            Aggro(who); 
    605             InCombat = true; 
    606606        } 
    607607    } 
  • trunk/src/bindings/scripts/scripts/creature/mob_event_ai.cpp

    r14 r18  
    5656                    ProcessEvent(*i); 
    5757                    break; 
    58                 default: 
    59                     break; 
    6058            } 
    6159        } 
     
    613611                } 
    614612 
    615                 //Interrupt any previous spell 
    616                 if (caster->IsNonMeleeSpellCasted(false) && param3 & CAST_INTURRUPT_PREVIOUS) 
    617                     caster->InterruptNonMeleeSpells(false); 
    618  
    619                 //Cast only if not casting or if spell is triggered 
    620                 if (param3 & CAST_TRIGGERED || !caster->IsNonMeleeSpellCasted(false)) 
     613                //Allowed to cast only if not casting (unless we interrupt ourself) or if spell is triggered 
     614                bool canCast = !(caster->IsNonMeleeSpellCasted(false) && (param3 & CAST_TRIGGERED | CAST_INTURRUPT_PREVIOUS)); 
     615 
     616                // If cast flag CAST_AURA_NOT_PRESENT is active, check if target already has aura on them 
     617                if(param3 & CAST_AURA_NOT_PRESENT) 
     618                { 
     619                    for(uint8 i = 0; i < 3; ++i) 
     620                        if(target->HasAura(param1, i)) 
     621                            return; 
     622                } 
     623 
     624                if (canCast) 
    621625                { 
    622626                    const SpellEntry* tSpell = GetSpellStore()->LookupEntry(param1); 
     
    639643                            } 
    640644 
    641                         }else caster->CastSpell(target, param1, (param3 & CAST_TRIGGERED)); 
     645                        }else 
     646                        { 
     647                            //Interrupt any previous spell 
     648                            if (caster->IsNonMeleeSpellCasted(false) && param3 & CAST_INTURRUPT_PREVIOUS) 
     649                                caster->InterruptNonMeleeSpells(false); 
     650 
     651                            caster->CastSpell(target, param1, (param3 & CAST_TRIGGERED)); 
     652                        } 
    642653 
    643654                    }else if (EAI_ErrorLevel > 0) 
     
    9971008                    } 
    9981009                    break; 
    999                 default: 
     1010                //default: 
    10001011                    //TODO: enable below code line / verify this is correct to enable events previously disabled (ex. aggro yell), instead of enable this in void Aggro() 
    10011012                    //(*i).Enabled = true; 
    10021013                    //(*i).Time = 0; 
    1003                     break; 
     1014                    //break; 
    10041015            } 
    10051016        } 
     
    10301041                    ProcessEvent(*i); 
    10311042                    break; 
    1032                 default: 
    1033                     break; 
    10341043            } 
    10351044        } 
     
    10511060                    ProcessEvent(*i, killer); 
    10521061                    break; 
    1053                 default: 
    1054                     break; 
    10551062            } 
    10561063        } 
     
    10701077                    ProcessEvent(*i, victim); 
    10711078                    break; 
    1072                 default: 
    1073                     break; 
    10741079            } 
    10751080        } 
     
    10891094                case EVENT_T_SUMMONED_UNIT: 
    10901095                    ProcessEvent(*i, pUnit); 
    1091                     break; 
    1092                 default: 
    10931096                    break; 
    10941097            } 
     
    11461149            if (!InCombat) 
    11471150            { 
     1151                InCombat = true; 
    11481152                Aggro(who); 
    1149                 InCombat = true; 
    11501153            } 
    11511154        } 
     
    11941197                if (!InCombat) 
    11951198                { 
     1199                    InCombat = true; 
    11961200                    Aggro(who); 
    1197                     InCombat = true; 
    11981201                } 
    11991202            } 
     
    12151218                                ProcessEvent(*i, pUnit); 
    12161219                    } 
    1217                     break; 
    1218                 default: 
    12191220                    break; 
    12201221            } 
  • trunk/src/bindings/scripts/scripts/creature/mob_event_ai.h

    r6 r18  
    114114    CAST_NO_MELEE_IF_OOM        = 0x08,     //Prevents creature from entering melee if out of mana or out of range 
    115115    CAST_FORCE_TARGET_SELF      = 0x10,     //Forces the target to cast this spell on itself 
     116    CAST_AURA_NOT_PRESENT       = 0x20,     //Only casts the spell if the target does not have an aura from the spell 
    116117}; 
    117118 
  • trunk/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp

    r6 r18  
    105105                    Class_Timer = 10000; 
    106106                    break; 
    107                 default: 
    108                     break; 
    109107            } 
    110108        }else Class_Timer -= diff; 
     
    205203                if (!InCombat) 
    206204                { 
     205                    InCombat = true; 
    207206                    Aggro(who); 
    208                     InCombat = true; 
    209207                } 
    210208            } 
  • trunk/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp

    r6 r18  
    107107                if (!InCombat) 
    108108                { 
     109                    InCombat = true; 
    109110                    Aggro(who); 
    110                     InCombat = true; 
    111111                } 
    112112            } 
  • trunk/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp

    r6 r18  
    116116                if (!InCombat) 
    117117                { 
     118                    InCombat = true; 
    118119                    Aggro(who); 
    119                     InCombat = true; 
    120120                } 
    121121            } 
  • trunk/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp

    r6 r18  
    126126                if (!InCombat) 
    127127                { 
     128                    InCombat = true; 
    128129                    Aggro(who); 
    129                     InCombat = true; 
    130130                } 
    131131            } 
  • trunk/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp

    r6 r18  
    7575            if (!InCombat) 
    7676            { 
     77                InCombat = true; 
    7778                Aggro(who); 
    78                 InCombat = true; 
    7979            } 
    8080        } 
     
    9696                if (!InCombat) 
    9797                { 
     98                    InCombat = true; 
    9899                    Aggro(who); 
    99                     InCombat = true; 
    100100                } 
    101101            } 
  • trunk/src/bindings/scripts/scripts/zone/burning_steppes/burning_steppes.cpp

    r6 r18  
    6262                if (!InCombat) 
    6363                { 
     64                    InCombat = true; 
    6465                    Aggro(who); 
    65                     InCombat = true; 
    6666                } 
    6767            } 
  • trunk/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp

    r6 r18  
    118118            if (!InCombat) 
    119119            { 
     120                InCombat = true; 
    120121                Aggro(who); 
    121                 InCombat = true; 
    122122            } 
    123123        } 
     
    139139                if (!InCombat) 
    140140                { 
     141                    InCombat = true; 
    141142                    Aggro(who); 
    142                     InCombat = true; 
    143143                } 
    144144            } 
  • trunk/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp

    r6 r18  
    109109                if (!InCombat) 
    110110                { 
     111                    InCombat = true; 
    111112                    Aggro(who); 
    112                     InCombat = true; 
    113113                } 
    114114            } 
  • trunk/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_nethekurse.cpp

    r6 r18  
    201201            if( !InCombat ) 
    202202            { 
     203                InCombat = true; 
    203204                Aggro(who); 
    204                 InCombat = true; 
    205205            } 
    206206        } 
     
    238238                if( !InCombat ) 
    239239                { 
     240                    InCombat = true; 
    240241                    Aggro(who); 
    241                     InCombat = true; 
    242242                } 
    243243            } 
  • trunk/src/bindings/scripts/scripts/zone/karazhan/boss_prince_malchezaar.cpp

    r6 r18  
    583583        { 
    584584            //Check for base attack 
    585             if( m_creature->isAttackReady()) 
     585            if( m_creature->isAttackReady() && m_creature->getVictim() ) 
    586586            { 
    587587                m_creature->AttackerStateUpdate(m_creature->getVictim()); 
     
    589589            } 
    590590            //Check for offhand attack 
    591             if( m_creature->isAttackReady(OFF_ATTACK)) 
     591            if( m_creature->isAttackReady(OFF_ATTACK) && m_creature->getVictim() ) 
    592592            { 
    593593                m_creature->AttackerStateUpdate(m_creature->getVictim(), OFF_ATTACK); 
  • trunk/src/bindings/scripts/scripts/zone/molten_core/instance_molten_core.cpp

    r6 r18  
    164164                    FlamewakerPriest = creature->GetGUID(); 
    165165                    break; 
    166  
    167                 default: 
    168                     return; 
    169166            } 
    170167        } 
  • trunk/src/bindings/scripts/scripts/zone/netherstorm/netherstorm.cpp

    r6 r18  
    265265                    ++Phase; 
    266266                    break; 
    267                 default: 
    268                     break; 
    269267            } 
    270268        } else Event_Timer -= diff; 
  • trunk/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/arcatraz.cpp

    r6 r18  
    139139                if (!InCombat) 
    140140                { 
     141                    InCombat = true; 
    141142                    Aggro(who); 
    142                     InCombat = true; 
    143143                } 
    144144            } 
     
    154154            if (!InCombat) 
    155155            { 
     156                InCombat = true; 
    156157                Aggro(who); 
    157                 InCombat = true; 
    158158            } 
    159159        } 
     
    445445                    pInstance->SetData(TYPE_WARDEN_5,IN_PROGRESS); 
    446446                    break; 
    447                 default: 
    448                     break; 
    449447            } 
    450448            CanSpawn = true; 
     
    506504                        DoPlaySoundToSet(m_creature,SOUND_WELCOME); 
    507505                        break; 
    508                     default: 
    509                         break; 
    510506                } 
    511507                CanSpawn = false; 
     
    554550                        EventProgress_Timer = 15000; 
    555551                        break; 
    556                     default: 
    557                         break; 
    558552                } 
    559553            } 
  • trunk/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp

    r6 r18  
    131131                if (!InCombat) 
    132132                { 
     133                    InCombat = true; 
    133134                    Aggro(who); 
    134                     InCombat = true; 
    135135                } 
    136136            } 
     
    149149            if( !InCombat ) 
    150150            { 
     151                InCombat = true; 
    151152                Aggro(who); 
    152                 InCombat = true; 
    153153            } 
    154154        } 
     
    237237                        Intro = true; 
    238238                        break; 
    239                     default: 
    240                         break; 
    241239                } 
    242240            }else Intro_Timer -=diff; 
  • trunk/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp

    r6 r18  
    216216                if (!InCombat) 
    217217                { 
     218                    InCombat = true; 
    218219                    Aggro(who); 
    219                     InCombat = true; 
    220220                } 
    221221            } 
     
    235235            if (!InCombat) 
    236236            { 
     237                InCombat = true; 
    237238                Aggro(who); 
    238                 InCombat = true; 
    239239            } 
    240240        } 
     
    864864                            DoPlaySoundToSet(m_creature, SOUND_SUMMON_PHOENIX1); 
    865865                            break; 
    866  
    867866                        case 1: 
    868867                            DoYell(SAY_SUMMON_PHOENIX2, LANG_UNIVERSAL, NULL); 
    869868                            DoPlaySoundToSet(m_creature, SOUND_SUMMON_PHOENIX2); 
    870                             break; 
    871  
    872                         default: 
    873869                            break; 
    874870                    } 
     
    12531249            if (!InCombat) 
    12541250            { 
     1251                InCombat = true; 
    12551252                Aggro(who); 
    1256                 InCombat = true; 
    12571253            } 
    12581254        } 
  • trunk/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_twinemperors.cpp

    r6 r18  
    666666            if (!InCombat) 
    667667            { 
     668                InCombat = true; 
    668669                Aggro(who); 
    669                 InCombat = true; 
    670670            } 
    671671        }