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

[svn] Implement a new table (spell_disabled) to allow disabling some spells for players and / or creatures. To disable a spell for a players and pets, set 20 in the disable_mask, to disable for creatures, set 21. The comment field is optional. Original patch provided by Craker.

Original author: w12x
Date: 2008-10-21 03:58:38-05:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/game/Level3.cpp

    r79 r85  
    151151    HandleReloadSpellThreatsCommand("a"); 
    152152    HandleReloadSpellPetAurasCommand("a"); 
     153    HandleReloadSpellDisabledCommand("a"); 
    153154    return true; 
    154155} 
     
    610611 
    611612    SendGlobalSysMessage("DB table `game_tele` reloaded."); 
     613 
     614    return true; 
     615} 
     616 
     617bool ChatHandler::HandleReloadSpellDisabledCommand(const char* /*arg*/) 
     618{ 
     619    sLog.outString( "Re-Loading spell disabled table..."); 
     620 
     621    objmgr.LoadSpellDisabledEntrys(); 
     622 
     623    SendGlobalSysMessage("DB table `spell_disabled` reloaded."); 
    612624 
    613625    return true; 
     
    55775589    { 
    55785590        player = getSelectedPlayer(); 
    5579                 if (player) //prevent crash with creature as target 
     5591        if (player) //prevent crash with creature as target 
    55805592        {    
    55815593           name = player->GetName(); 
     
    56105622        player->setFaction(35); 
    56115623        player->CombatStop(); 
    5612                 if(player->IsNonMeleeSpellCasted(true)) 
     5624        if(player->IsNonMeleeSpellCasted(true)) 
    56135625        player->InterruptNonMeleeSpells(true); 
    56145626        player->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); 
    56155627        player->SetUInt32Value(PLAYER_DUEL_TEAM, 1); 
    56165628 
    5617                 //if player class = hunter || warlock remove pet if alive 
     5629        //if player class = hunter || warlock remove pet if alive 
    56185630        if((player->getClass() == CLASS_HUNTER) || (player->getClass() == CLASS_WARLOCK)) 
    56195631        { 
     
    56625674    { 
    56635675        player = getSelectedPlayer(); 
    5664                 if (player) //prevent crash with creature as target 
     5676        if (player) //prevent crash with creature as target 
    56655677        {    
    56665678           name = player->GetName(); 
     
    56975709        {         
    56985710            //check for offline players 
    5699                     QueryResult *result = CharacterDatabase.PQuery("SELECT characters.guid FROM `characters` WHERE characters.name = '%s'",name.c_str()); 
     5711            QueryResult *result = CharacterDatabase.PQuery("SELECT characters.guid FROM `characters` WHERE characters.name = '%s'",name.c_str()); 
    57005712            if(!result) 
    5701                     { 
    5702                             SendSysMessage(LANG_COMMAND_FREEZE_WRONG); 
     5713            { 
     5714                SendSysMessage(LANG_COMMAND_FREEZE_WRONG); 
    57035715                return true; 
    5704                     } 
    5705                     //if player found: delete his freeze aura 
    5706                     Field *fields=result->Fetch(); 
     5716            } 
     5717            //if player found: delete his freeze aura 
     5718            Field *fields=result->Fetch(); 
    57075719            uint64 pguid = fields[0].GetUInt64(); 
    5708                     delete result; 
     5720            delete result; 
    57095721            CharacterDatabase.PQuery("DELETE FROM `character_aura` WHERE character_aura.spell = 9454 AND character_aura.guid = '%u'",pguid); 
    57105722            PSendSysMessage(LANG_COMMAND_UNFREEZE,name.c_str()); 
    57115723            return true; 
    5712                 } 
    5713                 else 
    5714         { 
    5715                 SendSysMessage(LANG_COMMAND_FREEZE_WRONG); 
     5724        } 
     5725        else 
     5726        { 
     5727            SendSysMessage(LANG_COMMAND_FREEZE_WRONG); 
    57165728            return true; 
    5717                 } 
     5729        } 
    57185730    } 
    57195731