Jump to content

kaotik

Members
  • Posts

    13
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Posts posted by kaotik

  1. Here is an update. Works for rev. 10079 (patched manually).

    Change this:

    -    QueryResult* result = loginDatabase.PQuery("SELECT username,gmlevel,last_ip,last_login FROM account WHERE id = '%u'",accId);
    +    QueryResult* result = loginDatabase.PQuery("SELECT a.username, a.gmlevel, a.last_ip, a.last_login, a_fp.accountid, a_fp.security, a_fp.realmid FROM account AS a LEFT JOIN account_forcepermission AS a_fp on a.id = a_fp.accountid WHERE a.id = '%u' ORDER BY FIELD(a_fp.realmid,'%u') DESC", accId, realmID);
        if(result)
        {
            Field* fields = result->Fetch();
            username = fields[0].GetCppString();
    -        security = fields[1].GetUInt32();
    +
    +        if( fields[4].GetUInt32() != NULL && fields[4].GetUInt32() == accId )                // checking to see if account has forced perms
    +        {
    +            if( fields[6].GetUInt32() != NULL && fields[6].GetUInt32() == realmID )            // if it does, check to see if it has it on the realm
    +                security = fields[5].GetUInt16();                                            // if it does, apply forced perm
    +            else
    +                security = fields[1].GetUInt32();                                            // if it doesn't for realm, apply regular perms
    +        }
    +        else
    +            security = fields[1].GetUInt32();                                                // if it doesn't for account, apply regular perms
    
            if(!m_session || m_session->GetSecurity() >= security)
            {
    

    To:

    -    QueryResult* result = loginDatabase.PQuery("SELECT username,gmlevel,last_ip,last_login FROM account WHERE id = '%u'",accId);
    +    QueryResult* result = loginDatabase.PQuery("SELECT a.username, a.gmlevel, a.last_ip, a.last_login, a_fp.accountid, a_fp.security, a_fp.realmid FROM account AS a LEFT JOIN account_forcepermission AS a_fp on a.id = a_fp.accountid WHERE a.id = '%u' ORDER BY FIELD(a_fp.realmid,'%u') DESC", accId, realmID);
        if(result)
        {
            Field* fields = result->Fetch();
            username = fields[0].GetCppString();
    -        security = fields[1].GetUInt32();
    +
    +        if( fields[4].GetUInt32() != NULL && fields[4].GetUInt32() == accId )                // checking to see if account has forced perms
    +        {
    +            if( fields[6].GetUInt32() != NULL && fields[6].GetUInt32() == realmID )            // if it does, check to see if it has it on the realm
    +                security = (AccountTypes)fields[5].GetUInt16();                                            // if it does, apply forced perm
    +            else
    +                security = (AccountTypes)fields[1].GetUInt32();                                            // if it doesn't for realm, apply regular perms
    +        }
    +        else
    +            security = (AccountTypes)fields[1].GetUInt32();                                                // if it doesn't for account, apply regular perms
    
            if(!m_session || m_session->GetSecurity() >= security)
            {
    

    Thanks to Putra for originally supplying the patch.

  2. Figured it out using EventAI:

    DELETE FROM `creature_ai_scripts` WHERE (`creature_id`=25244);
    INSERT INTO `creature_ai_scripts` VALUES 
    ( 2680227, 25244, 1, 0, 100, 6, 0, 0, 0, 0, 21, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 'Warsong Marksman - Prevent Combat Movement and Prevent Melee on Spawn'),
    ( 2680228, 25244, 4, 0, 100, 6, 0, 0, 0, 0, 28, 0, 47543, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Warsong Marksman - Remove Frozen Prison on Aggro'),
    ( 2680229, 25244, 4, 0, 100, 2, 0, 0, 0, 0, 11, 15620, 1, 0, 23, 1, 0, 0, 0, 0, 0, 0, 'Warsong Marksman (Normal) - Cast Shoot and Set Phase 1 on Aggro'),
    ( 2680230, 25244, 9, 1, 100, 3, 5, 30, 2300, 3800, 11, 15620, 1, 0, 40, 2, 0, 0, 0, 0, 0, 0, 'Warsong Marksman (Normal) - Cast Shoot and Set Ranged Weapon Model (Phase 1)'),
    ( 2680231, 25244, 4, 0, 100, 4, 0, 0, 0, 0, 11, 22907, 1, 0, 23, 1, 0, 0, 0, 0, 0, 0, 'Warsong Marksman (Heroic) - Cast Shoot and Set Phase 1 on Aggro'),
    ( 2680232, 25244, 9, 1, 100, 5, 5, 30, 2300, 3800, 11, 22907, 1, 0, 40, 2, 0, 0, 0, 0, 0, 0, 'Warsong Marksman (Heroic) - Cast Shoot and Set Ranged Weapon Model (Phase 1)'),
    ( 2680233, 25244, 9, 1, 100, 6, 25, 80, 0, 0, 21, 1, 1, 0, 20, 1, 0, 0, 0, 0, 0, 0, 'Warsong Marksman - Start Combat Movement and Start Melee at 25 Yards (Phase 1)'),
    ( 2680234, 25244, 9, 1, 100, 6, 0, 5, 0, 0, 21, 1, 0, 0, 40, 1, 0, 0, 20, 1, 0, 0, 'Warsong Marksman - Start Combat Movement and Set Melee Weapon Model and Start Melee Below 5 Yards (Phase 1)'),
    ( 2680235, 25244, 9, 1, 100, 6, 5, 15, 0, 0, 21, 0, 1, 0, 20, 0, 0, 0, 0, 0, 0, 0, 'Warsong Marksman - Prevent Combat Movement and Prevent Melee at 15 Yards (Phase 1)'),
    ( 2680236, 25244, 9, 0, 100, 3, 5, 45, 9500, 10000, 11, 47777, 1, 1, 40, 2, 0, 0, 0, 0, 0, 0, 'Warsong Marksman (Normal) - Cast Incendiary Shot and Set Ranged Weapon Model'),
    ( 2680237, 25244, 9, 0, 100, 5, 5, 45, 9500, 10000, 11, 56933, 1, 1, 40, 2, 0, 0, 0, 0, 0, 0, 'Warsong Marksman (Heroic) - Cast Incendiary Shot and Set Ranged Weapon Model'),
    ( 2680238, 25244, 0, 0, 100, 7, 12000, 15000, 16100, 19000, 11, 48191, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 'Warsong Marksman - Cast Rapid Shot'),
    (2680239, 25244, 7, 0, 100, 6, 0, 0, 0, 0, 22, 0, 0, 0, 40, 1, 0, 0, 0, 0, 0, 0, 'Warsong Marksman - Set Phase to 0 and Set Melee Weapon Model on Evade');

    P.S.- Also figured out why WP's were erroring... core was corrupt. fresh x64 build solved it.

  3. Ah ok thanks :D sending the patch to the powers-that-be for review and implementation. Another quick question. I was able to get melee and bows equipped on the npc's, but on a select npc I am trying to get it to just stand there and shoot at the target. Tried various commands through .wp for it to just shoot, but it error's out. Making the target hostile, the npc shoots once, and runs in and autoattacks. o.O just thought of it while writing this, hehe, maybe autoshot? Not sure how else to get him to stay ranged, short of freezing him to the ground, but that's not restart-proof.

  4. Here is an sql to very easily make all spells that are given by any trainer free. Be careful though be cause this make all class, profession, and pet trainer spells free.

    [color="DeepSkyBlue"]ALTER TABLE[/color] npc_trainer [color="DeepSkyBlue"]DROP COLUMN[/color] spellcost; 
    [color="DeepSkyBlue"]ALTER TABLE[/color] npc_trainer [color="DeepSkyBlue"]ADD[/color] spellcost [color="DeepSkyBlue"]VARCHAR[/color][color="DarkRed"](60)[/color] [color="DeepSkyBlue"]AFTER[/color] spell;
    

  5. Actually this is due to either not applying sql updates in the right order, skipping a few, or the sql update you are trying to use has been tampered with.

    2010-03-14 19:42:12 ERROR:Table `db_version` have field `required_9539_01_mangos_spell_bonus_data` but expected `required_9385_01_mangos_command`! Not all sql updates applied?

    As you can see here, the sql update you are probably trying to apply is 9450_01_mangos_spell_proc_event.sql, but you already have a DB with 9539_01_mangos_spell_bonus_data.sql applied to it.

  6. Can someone finish cleaning this please? Not too savvy with it. I think the Language.h part is good, just need level2.cpp fixed. Mangos rev. 9849.

    Index: src/game/Language.h
    ===================================================================
    --- a/src/game/Language.h
    +++ b/src/game/Language.h
    @@ -24,6 +24,16 @@ enum MangosStrings
       // for chat commands
       LANG_SELECT_CHAR_OR_CREATURE        = 1,
       LANG_SELECT_CREATURE                = 2,
    +    LANG_ANNOUNCE_KICK                  = 70,               //Selected Player Kick
    +    LANG_ANNOUNCE_KICK1                 = 71,               //.kick Command
    
       // level 0 chat
       LANG_SYSTEMMESSAGE                  = 3,
       LANG_EVENTMESSAGE                   = 4,
    Index: src/game/Level2.cpp
    ===================================================================
    --- src/game/Level2.cpp
    +++ src/game/Level2.cpp
    @@ -1712,6 +1712,10 @@
    bool ChatHandler::HandleKickPlayerCommand(const char *args)
    {
       char* kickName = strtok((char*)args, " ");
    +    char* reason * * = strtok(NULL,"");
    +    if(!reason)
    +        return false;
    +    char str[1024];
       if (!kickName)
    {
       Player* player = getSelectedPlayer();
    @@ -1722,15 +1726,15 @@
       SetSentErrorMessage(true);
       return false;
    }
    -
       if(player==m_session->GetPlayer())
    {
       SendSysMessage(LANG_COMMAND_KICKSELF);
       SetSentErrorMessage(true);
       return false;
    }
    -
       player->GetSession()->KickPlayer();
    +    sprintf(str, GetMangosString(LANG_ANNOUNCE_KICK), player->GetName(), m_session->GetPlayer()->GetName());
    +    sWorld.SendWorldText(str, NULL);
    }
    else
    {
    @@ -1748,10 +1752,11 @@
       SetSentErrorMessage(true);
       return false;
    }
    -
       if(sWorld.KickPlayer(name))
    {
       PSendSysMessage(LANG_COMMAND_KICKMESSAGE,name.c_str());
    +    sprintf(str, GetMangosString(LANG_ANNOUNCE_KICK1), name.c_str(), m_session->GetPlayer()->GetName(), reason);
    +    sWorld.SendWorldText(str, NULL);
    }
       else
       PSendSysMessage(LANG_COMMAND_KICKNOTFOUNDPLAYER,name.c_str());

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use