Jump to content

Feel the Power

Members
  • Posts

    19
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Posts posted by Feel the Power

  1. Scriptdev part of this patch on svn(not git).

    Index: scripts/eastern_kingdoms/scarlet_enclave/ebon_hold.cpp
    ===================================================================
    --- scripts/eastern_kingdoms/scarlet_enclave/ebon_hold.cpp    (revision 1587)
    +++ scripts/eastern_kingdoms/scarlet_enclave/ebon_hold.cpp    (working copy)
    @@ -1100,6 +1100,113 @@
        return false;
    }
    
    +/*######
    +## npc_eye_of_acherus
    +######*/
    +
    +struct MANGOS_DLL_DECL npc_eye_of_acherusAI : public ScriptedAI
    +{
    +    npc_eye_of_acherusAI(Creature *pCreature) : ScriptedAI(pCreature)
    +    {
    +        m_creature->SetActiveObjectState(true);
    +        Reset();
    +    }
    +
    +    uint64 EyeGuid;
    +    uint32 StartTimer;
    +    bool Active;
    +
    +    void Reset()
    +    {
    +        EyeGuid = 0;
    +        StartTimer = 2000;
    +        Active = false;
    +    }
    +
    +    void JustDied(Unit*u)
    +    {
    +        if(m_creature->GetCharmer()->GetTypeId()!= TYPEID_PLAYER)return;
    +        Player* pl = ((Player*)m_creature->GetCharmer());
    +
    +            m_creature->GetMap()->CreatureRelocation(m_creature, 2325.0f, -5660.0f, 427.0f, 3.83f);
    +            pl->RemoveAurasDueToSpell(51852);
    +            pl->InterruptSpell(CURRENT_CHANNELED_SPELL);
    +            pl->SetClientControl(m_creature, 0);
    +            pl->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED);
    +            pl->SetCharm(NULL);
    +            pl->SetFarSightGUID(0);
    +            pl->SetMover(NULL);
    +            pl->RemovePetActionBar();
    +            m_creature->SetCharmerGUID(0);
    +    }
    +
    +    void AttackStart(Unit *)
    +    {
    +        m_creature->AttackStop();
    +        m_creature->SetInCombatState(false)    ;
    +    }
    +
    +    void MovementInform(uint32 uiType, uint32 uiPointId)
    +    {
    +        if (uiType != POINT_MOTION_TYPE)
    +            return;
    +
    +        if (uiPointId == 0)
    +        {
    +        Unit *Eye1 = Unit::GetUnit((*m_creature), m_creature->GetGUID());
    +        if (Eye1)
    +            {
    +            char * text1 = "The Eye of Acherus is in your control";
    +            Eye1->MonsterTextEmote(text1, Eye1->GetGUID(), true);
    +            //m_creature->RemoveMonsterMoveFlag(MONSTER_MOVE_SPLINE_FLY);
    +            m_creature->SetSpeedRate(MOVE_FLIGHT, 2.8f, true);
    +            m_creature->CastSpell(m_creature, 51890, true);
    +            }
    +        }
    +
    +    }
    +
    +    void UpdateAI(const uint32 uiDiff)
    +    {
    +        if (StartTimer < uiDiff && !Active)
    +        {
    +            EyeGuid = m_creature->GetGUID();
    +            Unit *Eye = Unit::GetUnit((*m_creature), EyeGuid);
    +            if (Eye)
    +            {
    +                char * text = "The Eye of Acherus launches towards its destination";
    +                Eye->MonsterTextEmote(text, Eye->GetGUID(), true);
    +                //m_creature->SetMonsterMoveFlags(MONSTER_MOVE_SPLINE_FLY);
    +                m_creature->SetSpeedRate(MOVE_FLIGHT, 6.8f, true);
    +                m_creature->SetSpeedRate(MOVE_WALK, 6.8f, true);
    +                m_creature->GetMotionMaster()->MovePoint(0, 1711.0f, -5820.0f, 147.0f);
    +                Active = true;
    +            }
    +        }
    +        else StartTimer -= uiDiff;
    +
    +        DoMeleeAttackIfReady();
    +    }
    +};
    +
    +CreatureAI* GetAI_npc_eye_of_acherus(Creature* pCreature)
    +{
    +    return new npc_eye_of_acherusAI(pCreature);
    +}
    +
    +/*######
    +## go_eye_of_acherus
    +######*/
    +
    +bool GOHello_go_eye_of_acherus(Player *player, GameObject* _GO)
    +{
    +    if (player->GetQuestStatus(12641) == QUEST_STATUS_INCOMPLETE)
    +     player->CastSpell(player, 51852, true);
    +
    +    return true;
    +}
    +
    +
    void AddSC_ebon_hold()
    {
        Script *newscript;
    @@ -1136,4 +1243,14 @@
        newscript->Name = "go_acherus_soul_prison";
        newscript->pGOHello = &GOHello_go_acherus_soul_prison;
        newscript->RegisterSelf();
    +
    +    newscript = new Script;
    +    newscript->Name = "npc_eye_of_acherus";
    +    newscript->GetAI = &GetAI_npc_eye_of_acherus;
    +    newscript->RegisterSelf();
    +
    +    newscript = new Script;
    +    newscript->Name = "go_eye_of_acherus";
    +    newscript->pGOHello = &GOHello_go_eye_of_acherus;
    +    newscript->RegisterSelf();
    }
    

  2. Updated for 9428 (after 8399) + some cosmetic changes.

    diff --git a/src/game/DuelHandler.cpp b/src/game/DuelHandler.cpp
    index a73be6f..0f8669a 100644
    --- a/src/game/DuelHandler.cpp
    +++ b/src/game/DuelHandler.cpp
    @@ -23,6 +23,7 @@
    #include "Opcodes.h"
    #include "UpdateData.h"
    #include "Player.h"
    +#include "World.h"
    
    void WorldSession::HandleDuelAcceptedOpcode(WorldPacket& recvPacket)
    {
    @@ -49,6 +50,16 @@ void WorldSession::HandleDuelAcceptedOpcode(WorldPacket& recvPacket)
        pl->duel->startTimer = now;
        plTarget->duel->startTimer = now;
    
    +    ///reset hp, mana and cooldown
    +    if(sWorld.getConfig(CONFIG_BOOL_DUEL_RESET))
    +    {
    +    pl->SetHealth(pl->GetMaxHealth());
    +    plTarget->SetHealth(plTarget->GetMaxHealth());
    +    if (pl->getPowerType() == POWER_MANA) pl->SetPower(POWER_MANA, pl->GetMaxPower(POWER_MANA));
    +    if (plTarget->getPowerType() == POWER_MANA) plTarget->SetPower(POWER_MANA, plTarget->GetMaxPower(POWER_MANA));
    +    if (!pl->GetMap()->IsDungeon())
    +    { pl->RemoveArenaSpellCooldowns(); plTarget->RemoveArenaSpellCooldowns(); }
    +    }
        pl->SendDuelCountdown(3000);
        plTarget->SendDuelCountdown(3000);
    }
    diff --git a/src/game/Level0.cpp b/src/game/Level0.cpp
    index a265405..f2c1b31 100644
    --- a/src/game/Level0.cpp
    +++ b/src/game/Level0.cpp
    @@ -91,6 +91,8 @@ bool ChatHandler::HandleServerInfoCommand(const char* /*args*/)
        uint32 maxQueuedClientsNum = sWorld.GetMaxQueuedSessionCount();
        std::string str = secsToTimeString(sWorld.GetUptime());
    
    +    if(sWorld.getConfig(CONFIG_BOOL_SERVER_INFO))
    +    {
        char const* full;
        if(m_session)
            full = _FULLVERSION(REVISION_DATE,REVISION_TIME,REVISION_NR,"|cffffffff|Hurl:" REVISION_ID "|h" REVISION_ID "|h|r");
    @@ -101,6 +103,7 @@ bool ChatHandler::HandleServerInfoCommand(const char* /*args*/)
        PSendSysMessage(LANG_USING_SCRIPT_LIB,sWorld.GetScriptsVersion());
        PSendSysMessage(LANG_USING_WORLD_DB,sWorld.GetDBVersion());
        PSendSysMessage(LANG_USING_EVENT_AI,sWorld.GetCreatureEventAIVersion());
    +    }
        PSendSysMessage(LANG_CONNECTED_USERS, activeClientsNum, maxActiveClientsNum, queuedClientsNum, maxQueuedClientsNum);
        PSendSysMessage(LANG_UPTIME, str.c_str());
    
    diff --git a/src/game/World.cpp b/src/game/World.cpp
    index 7516899..c4528fb 100644
    --- a/src/game/World.cpp
    +++ b/src/game/World.cpp
    @@ -514,6 +514,10 @@ void World::LoadConfigSettings(bool reload)
        setConfigPos(CONFIG_FLOAT_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS, "CreatureFamilyFleeAssistanceRadius", 30.0f);
    
        ///- Read other configuration items from the config file
    +    ///modifications_begin
    +    setConfig(CONFIG_BOOL_SERVER_INFO, "ServerInfo", true);
    +    setConfig(CONFIG_BOOL_DUEL_RESET, "DuelReset", false);
    +    ///modifications_end
        setConfigMinMax(CONFIG_UINT32_COMPRESSION, "Compression", 1, 1, 9);
        setConfig(CONFIG_BOOL_ADDON_CHANNEL, "AddonChannel", true);
        setConfig(CONFIG_BOOL_GRID_UNLOAD, "GridUnload", true);
    diff --git a/src/game/World.h b/src/game/World.h
    index e6a8357..7d7a961 100644
    --- a/src/game/World.h
    +++ b/src/game/World.h
    @@ -300,7 +300,10 @@ enum eConfigBoolValues
        CONFIG_BOOL_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY,
        CONFIG_BOOL_ARENA_AUTO_DISTRIBUTE_POINTS,
        CONFIG_BOOL_ARENA_QUEUE_ANNOUNCER_ENABLE,
    -    CONFIG_BOOL_VALUE_COUNT
    +    CONFIG_BOOL_VALUE_COUNT,
    +    //modifications
    +    CONFIG_BOOL_SERVER_INFO,
    +    CONFIG_BOOL_DUEL_RESET
    };
    
    /// Type of server
    diff --git a/src/mangosd/mangosd.conf.dist.in b/src/mangosd/mangosd.conf.dist.in
    index 8cfc258..01d98f5 100644
    --- a/src/mangosd/mangosd.conf.dist.in
    +++ b/src/mangosd/mangosd.conf.dist.in
    @@ -1381,3 +1381,21 @@ Ra.IP = 0.0.0.0
    Ra.Port = 3443
    Ra.MinLevel = 3
    Ra.Secure = 1
    +
    +##################################################################################################################
    +# MODIFICATIONS
    +#
    +#    ServerInfo 
    +#        Enable show server version (.server info)
    +#        Default: 1 - on
    +#                 0 - off (show current and max online and uptime only)
    +#
    +#    DuelReset 
    +#        Enable reset hp, mana and cooldown after duel begin
    +#        Default: 0 - off
    +#                 1 - on
    +#
    +###################################################################################################################
    +
    +ServerInfo = 1
    +DuelReset = 0
    \\ No newline at end of file
    -- 
    

  3. The second patch looks awesome, but I would to know if it's possible to reset cooldown at the end of the duel only if the player has been really defeated and not with a "/forfeit" command.

    Well done and thank you for sharing !

    I'll work on it, but it will not be quick, because I do not even the author of this patch.

  4. А смысл, что-то сюда выкладывать? Я самую первую версию выложил патча и в течении 2-х дней ни кто ни чего не написал, тока тупо качали (180 закачек за 2 дня)! Помощи о которой я просил, я не получил! Пришлось все самому делать! И на счет понтов, я не такой человек, что бы понты гонять в отличии от некоторых! Смотрю тут кучу репозитарий наделали и чем же они отличаются? все друг у друга взяли и один копия другого! Ну выложу я его сюда и что? Сразу же воткнешь в свой репозитарий?

    И чем тебя не устраиват та версия, которая выложена!

    Интересно, что бы было бы, если бы Владимир не делился своими коммитами с сообществом? Может быть тогда все вместе уйдём в закрытую разработку и будем сидеть по углам, каждый со своими помидорами? Мангос - проект с открытым исходным кодом, и вы должны быть благодарны всем, кто участвует в разработке данного проекта. Лучшая ваша благодарность - ваша помощь и активность.

    I wonder what would happen would be if Vladimir does not share his commit to the community, maybe then all leave together in a closed development and will sit in the corners, each with their own tomatoes? Mangos - an open-source project, and you should be grateful to everyone who participates in the development of this project. Best your thanks - your help and activity.

  5. Core: Clear core 9082.

    How it SHOULD work: You jump back. Can only be used while in combat.

    This spell.

    How it DOES work: You can jump back in combat and when you are not in combat.

    I could not find a place in the source code processing this spell, as well as similar spells. But apparently, the processing must be done in spell.cpp

  6. I found the error.

    It's because of this lines :

        if(!cId && m_session->GetPlayer()->GetSelectedObject() != 0)
           guid = m_session->GetPlayer()->GetSelectedObject();
       if(cId)
           guid = atoi(cId);

    or

        if(!cId && m_session->GetPlayer()->GetSelectedObject() != 0)
           lowguid = m_session->GetPlayer()->GetSelectedObject();
       if(cId)
           lowguid = atoi(cId);

    Replace it by :

        if(cId)
           guid = atoi(cId);
       else
           guid = m_session->GetPlayer()->GetSelectedObject();

    and

        if(cId)
           lowguid = atoi(cId);
       else
           lowguid = m_session->GetPlayer()->GetSelectedObject();

    Give me a patch file, because there are several similar places in the code for this:

    if(!cId && m_session->GetPlayer()->GetSelectedObject() != 0)
           lowguid = m_session->GetPlayer()->GetSelectedObject();
       if(cId)
           lowguid = atoi(cId);

  7. Yes, I forgot it.

    You can modify the table "commands" to change the command's description, too.

    And the patch doesn't work ?

    Did you really put ".gobject target" and after ".gobject del" ?

    No, you misunderstood me. When I store an object (.goject target), and then try to move me (.gobject move), then first he just disappears for a split second and then a second, I lose "remembering" of the object. Other commands (.gobject delete and gobject turn work).

  8. how is this correct over what i had mate? it's doing a left join between account (table 1, primary table that has to have data) and account_forcepermission (table 2, secondary table that doesn't have to have data). correct me if i'm wrong, but when doing a left join it pulls it from the one on the left of the = in your ON... the table that has to have the data to begin with.... which in the case of what i had would be the account table and in the case of what you have is the account_forcepermission table

    granted, i haven't done joins on a daily basis since my oracle cource back in highschool until the past few months since i haven't had a real need for joins until i started working on trying to get the forced permission functionality back

    i even checked out w3's stuff to see if i'm correct in what i said:

    http://www.w3schools.com/sql/sql_join_left.asp

    edit - also, i've noticed that if you have more than 1 realm with forced permissions on an account that the code will completely ignore your 2nd, 3rd, 4th, etc realm's specific permissions and assign the account to have whatever your administrator level is... that it's only using the first record returned if there are more than 1 on an account.

    of course you can't add in on the where condition to check for the realm's id when it's pulling the authentication data, since that will make the account "not exist" for any account that doesn't have a forced permission on that realm

    since it only reads the first record returned on the sql (within the 12 array elements) you can order the sql by the realm id retrieved from the config files:

     order by field(a_fp.realmid,#) desc;

    replace the # with '%u' and make it use the realm number given from the config and that will make the realm you're trying to log into with a forced account be the first record. i'll do some code testing tonight when i get home from work to see if that will actually work correctly with it, the sql returns the values in the order that we'd want it but that doesn't necessarily mean that the c++ will interpret it the way we want it.

    I had errors in the console and so I added it to the query.

    "ON a_fp.AccountID = a.id WHERE `username` = '%s'  "

    I do not have sufficient knowledge of SQL, so do not quite understand you. Please show how to be more correct.

  9. Here are a few misprints.

    +        {
    +            if( fields[6].GetU[color="Red"]I[/color]nt32() == realmID )            // checks to see if there are forced permissions on the realm
    +                security = fields[5].GetUInt16();            // sets forced permissions
    +        }

    +    {
    +        if ( fields[11].GetU[color="Red"]I[/color]nt32 () == realmID )            // check to see if the realm has any forced permissions
    +            security = fields[12].GetUInt16 ();                // set forced permission if so
    +    }
    

    It was GetUint32 instead of GetUInt32.

    And I also corrected the mistake that I had in sql query during the login.

    "[color="Red"]ON a_fp.AccountID = a.id[/color] WHERE [color="Red"]`[/color]username[color="Red"]`[/color] = '%s'  "

    Here's the full patch. It's works for me at 8887.

    From e460a2939ec40bab15a67c96e25944a59fe38c0b Mon Sep 17 00:00:00 2001
    From: unknown <Feel_the_Power@.(none)>
    Date: Mon, 30 Nov 2009 15:39:13 +0200
    Subject: [PATCH] realm account permission
    
    ---
    sql/realm_account_permission.sql |    7 +++++++
    src/game/Level2.cpp              |   18 ++++++++++++++----
    src/game/WorldSocket.cpp         |   38 +++++++++++++++++++++++++-------------
    3 files changed, 46 insertions(+), 17 deletions(-)
    create mode 100644 sql/realm_account_permission.sql
    
    diff --git a/sql/realm_account_permission.sql b/sql/realm_account_permission.sql
    new file mode 100644
    index 0000000..e96b393
    --- /dev/null
    +++ b/sql/realm_account_permission.sql
    @@ -0,0 +1,7 @@
    +CREATE TABLE `account_forcepermission` (
    +  `AccountID` int(11) unsigned NOT NULL DEFAULT '0',
    +  `realmID` int(3) unsigned NOT NULL DEFAULT '0',
    +  `Security` int(3) unsigned NOT NULL DEFAULT '0',
    +  `Comment` varchar(32) NOT NULL DEFAULT '',
    +  PRIMARY KEY (`AccountID`,`realmID`)
    +) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    \\ No newline at end of file
    diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp
    index f928709..200a5c3 100644
    --- a/src/game/Level2.cpp
    +++ b/src/game/Level2.cpp
    @@ -42,6 +42,7 @@
    #include <fstream>
    #include <map>
    #include "GlobalEvents.h"
    +#include "Config/ConfigEnv.h"
    
    #include "TargetedMovementGenerator.h"                      // for HandleNpcUnFollowCommand
    
    @@ -2122,7 +2123,8 @@ bool ChatHandler::HandlePInfoCommand(const char* args)
        uint32 total_player_time = 0;
        uint32 level = 0;
        uint32 latency = 0;
    -
    +    uint32 realmID = sConfig.GetIntDefault("RealmId", 0);
    +    
        // get additional information from Player object
        if(target)
        {
    @@ -2160,13 +2162,21 @@ bool ChatHandler::HandlePInfoCommand(const char* args)
        std::string last_ip = GetMangosString(LANG_ERROR);
        uint32 security = 0;
        std::string last_login = GetMangosString(LANG_ERROR);
    -
    -    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'", accId);
        if(result)
        {
            Field* fields = result->Fetch();
            username = fields[0].GetCppString();
    -        security = fields[1].GetUInt32();
    +
    +        if( fields[4].GetUInt32() != NULL )                    // checking to see if there is any data in the account_forcepermission for account
    +    {
    +      if( fields[6].GetUInt32() == realmID )            // checks to see if there are forced permissions on the realm
    +                security = fields[5].GetUInt16();            // sets forced permissions
    +        }
    +        else
    +      security = fields[1].GetUInt32();                // otherwise sets account permissions
    + 
    
            if(!m_session || m_session->GetSecurity() >= security)
            {
    diff --git a/src/game/WorldSocket.cpp b/src/game/WorldSocket.cpp
    index f93804e..e20474e 100644
    --- a/src/game/WorldSocket.cpp
    +++ b/src/game/WorldSocket.cpp
    @@ -767,18 +767,22 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
    
        QueryResult *result =
              loginDatabase.PQuery ("SELECT "
    -                                "id, "                      //0
    -                                "gmlevel, "                 //1
    -                                "sessionkey, "              //2
    -                                "last_ip, "                 //3
    -                                "locked, "                  //4
    -                                "v, "                       //5
    -                                "s, "                       //6
    -                                "expansion, "               //7
    -                                "mutetime, "                //8
    -                                "locale "                   //9
    -                                "FROM account "
    -                                "WHERE username = '%s'",
    +                                "a.id, "                      //0
    +                                "a.gmlevel, "                 //1
    +                                "a.sessionkey, "              //2
    +                                "a.last_ip, "                 //3
    +                                "a.locked, "                  //4
    +                                "a.v, "                       //5
    +                                "a.s, "                       //6
    +                                "a.expansion, "               //7
    +                                "a.mutetime, "                //8
    +                                "a.locale, "                  //9
    +                                "a_fp.accountid, "              //10
    +                                "a_fp.realmID, "              //11
    +                                "a_fp.security "              //12
    +                                "FROM account AS a "
    +                                "LEFT JOIN account_forcepermission AS a_fp "
    +                                "ON a_fp.AccountID = a.id WHERE `username` = '%s'  ",
                                    safe_account.c_str ());
    
        // Stop if the account is not found
    @@ -829,7 +833,15 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
        }
    
        id = fields[0].GetUInt32 ();
    -    security = fields[1].GetUInt16 ();
    +
    +    if ( fields[10].GetUInt32 () != NULL )                    // check to see if data is in account_forcepermission table for account
    +    {
    +        if ( fields[11].GetUInt32 () == realmID )            // check to see if the realm has any forced permissions
    +            security = fields[12].GetUInt16 ();                // set forced permission if so
    +    }
    +    else
    +        security = fields[1].GetUInt16 ();                    // otherwise set the account's permission
    +
        if(security > SEC_ADMINISTRATOR)                        // prevent invalid security settings in DB
            security = SEC_ADMINISTRATOR;
    

  10. What bug does the patch fix? What features does the patch add?

    Grammatical error in 8833 commit.

    8833_01_mangos_mangos_string.sql

    (355,'Title %u (%s) set as current [color="Red"]seelcted[/color] title for player %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),

    For which repository revision was the patch created?

    Any after 8833.

    Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread.

    No.

    Who has been writing this patch? Please include either forum user names or email addresses.

    me.

    diff --git a/sql/updates/8833_01_mangos_mangos_string.sql b/sql/updates/8833_01_mangos_mangos_string.sql
    index 2c9b69a..018779f 100644
    --- a/sql/updates/8833_01_mangos_mangos_string.sql
    +++ b/sql/updates/8833_01_mangos_mangos_string.sql
    @@ -9,5 +9,5 @@ INSERT INTO mangos_string VALUES
     (352,'Invalid title id: %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
     (353,'Title %u (%s) added to known titles list for player %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
     (354,'Title %u (%s) removed from known titles list for player %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
    - (355,'Title %u (%s) set as current seelcted title for player %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
    + (355,'Title %u (%s) set as current selected title for player %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
     (356,'Current selected title for player %s reset as not known now.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);

×
×
  • 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