Arena Script menu

User Tag List

Thread: Arena Script

Page 3 of 3 FirstFirst 123
Results 31 to 45 of 45
  1. #31
    fresh's Avatar Member
    Reputation
    23
    Join Date
    Oct 2007
    Posts
    121
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    13 Thread(s)
    Originally Posted by Jotox1 View Post
    This script turns all FFA Arenas (gurubashi, ring of blood, dire maul) into a custom arena.

    If a player is killed in an FFA arena, the killer and the killer's group are awarded arena points.

    The player who was killed is deducted pvp points.

    You can edit the configs in ArenaScript.cpp to change the number of points awarded/deducted.


    For those of you who have ever played on Chaos Crusade Funserver, this is the script that I wrote for the Ring of Blood arena (slightly modified).


    Here's the script.

    ArenaScript.cpp
    Code:
    //Arena PvP Script
    //Made By Jotox/Classic
     
    //------------------------------
    //Configs.
    //------------------------------
    //Level required to participate.
    #define REQUIRED_LEVEL 80
     
    //Base amount of points awarded
    #define NUM_POINTS 40
     
    //Number of points lost on death
    #define POINTS_DEATH 10
     
    //Allow parties to PvP (0 for no)
    #define PARTY_ALLOWED 1
     
    //Allow Raids to PvP (0 for no) Default: no (It results in 30 vs 1)
    #define RAIDS_ALLOWED 0
     
    //---------------------------
    //End Config.
    //---------------------------
     
     
    #include "StdAfx.h"
    #include "Setup.h"
     
    void GivePoints( Player* player, int32 points)
    {
        if( points < 0 )
            player->m_arenaPoints = ((int32)player->m_arenaPoints > (-1)*(points)) ? player->m_arenaPoints + points : 0;//Subtract points, or set to 0 if they don't have enough.
        else
            player->m_arenaPoints += points;
        player->SetUInt32Value(PLAYER_FIELD_ARENA_CURRENCY, player->m_arenaPoints);
    }
     
    void OnPlayerKill(Player * pPlayer, Player * pVictim)
    {
        if( pPlayer->getLevel() < REQUIRED_LEVEL || pVictim->getLevel() < REQUIRED_LEVEL)
            return;
        if( !pPlayer->HasFlag(PLAYER_FLAGS, PLAYER_FLAG_FREE_FOR_ALL_PVP) || !pVictim->HasFlag(PLAYER_FLAGS, PLAYER_FLAG_FREE_FOR_ALL_PVP) )
            return;
     
        Group *pGroup = pPlayer->GetGroup();
        if( pGroup && pGroup->GetGroupType() == GROUP_TYPE_RAID && RAIDS_ALLOWED==0)
        {
            SubGroup * sgr;
            for(uint32 i = 0; i < pPlayer->GetGroup()->GetSubGroupCount(); ++i)
            {
                sgr = pPlayer->GetGroup()->GetSubGroup(i);
                pPlayer->GetGroup()->Lock();
                for(GroupMembersSet::iterator itr = sgr->GetGroupMembersBegin(); itr != sgr->GetGroupMembersEnd(); ++itr)
                {
                    if((*itr)->m_loggedInPlayer)
                        (*itr)->m_loggedInPlayer->BroadcastMessage("%sYou cannot gain arena points while in a raid group.", "|cffff0000");
                }
                pPlayer->GetGroup()->Unlock();
            }
            return;
        }
     
        int32 Points = NUM_POINTS;
     
        if( PARTY_ALLOWED!=0 && pPlayer->GetGroup() )
        {
            set<Player*> group_members;
            Group * Group = pPlayer->GetGroup();
            SubGroup * SubGroup = pGroup->GetSubGroup(pPlayer->GetSubGroup());
            if( !Group || !SubGroup )
                return;//Just in case.
            for(GroupMembersSet::iterator itr = SubGroup->GetGroupMembersBegin(); itr != SubGroup->GetGroupMembersEnd(); itr++)
            {
                PlayerInfo * pi = (*itr);
                Player * gm = objmgr.GetPlayer(pi->guid);
                if( !gm || gm == pPlayer)
                    continue;
                if(gm->isInRange(pPlayer, 100.0f) && gm->CombatStatus.IsInCombat())
                    group_members.insert(gm);
            }
            Points = (Points / group_members.size());//Divide by group members.
            Points += 5 - (Points % 5);//Round up to the nearest 5.
            for(set<Player*>::iterator itr = group_members.begin(); itr != group_members.end(); itr++)
            {
                GivePoints((*itr), Points);
                (*itr)->BroadcastMessage("You have gained %u Arena Points from a party member's kill.", Points);
            }
        }
     
        GivePoints( pPlayer, Points );
        if( pPlayer->GetSession() )
            pPlayer->GetSession()->SendNotification("%sYou gain %u Arena Points.", "|cff00ff00", Points);
     
        GivePoints( pVictim, (-1)*(int32)POINTS_DEATH);
        if(pVictim->GetSession())
            pVictim->GetSession()->SendNotification("%sYou lose %u Arena Points.", "|cffff0000", POINTS_DEATH);
    }
     
     
    void SetupArenaPvP(ScriptMgr * mgr)
    {
       mgr->register_hook(SERVER_HOOK_EVENT_ON_KILL_PLAYER, &OnPlayerKill);
    }
    Setup.cpp:
    Code:
    #include "StdAfx.h"
    #include "Setup.h"
    #define SKIP_ALLOCATOR_SHARING 1
    #include <ScriptSetup.h>
     
    extern "C" SCRIPT_DECL uint32 _exp_get_script_type()
    {
        return SCRIPT_TYPE_MISC;
    }
     
    extern "C" SCRIPT_DECL void _exp_script_register(ScriptMgr* mgr)
    {
        SetupArenaPvP(mgr);
    }
     
    #ifdef WIN32
     
    BOOL APIENTRY DllMain( HANDLE hModule, DWORD  ul_reason_for_call, LPVOID lpReserved )
    {
        return TRUE;
    }
     
    #endif
    Setup.h:
    Code:
    void OnPlayerKill(Player * pPlayer, Player * pVictim);
    void SetupArenaPvP(ScriptMgr * mgr);
    Hope you guys like!


    how about a Hearthstone CONFIG

    Arena Script
  2. #32
    AngelSandy's Avatar Member
    Reputation
    19
    Join Date
    Jan 2009
    Posts
    330
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would like to see some pictures if possible?

  3. #33
    Jotox's Avatar Contributor
    Reputation
    250
    Join Date
    Mar 2008
    Posts
    282
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anybody have any screenies? I don't have a server

  4. #34
    Megosh's Avatar Member
    Reputation
    1
    Join Date
    Mar 2008
    Posts
    12
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Alright I've been testing this for a few days on a server.... and I've come across a few problems.

    1) When a paladin kills someone with a judgment and has 2/2(26016) or 1/2 (9452) Vindication, it causes the server to crash.

    The error is something about dividing an integer by 0.

    When I place the same core on the server without the script and have a paladin kill someone, there is no crash. Looking through the core and script, I can't find anything that does this. If I was to guess it would be that when applying Vindication to a target, it doesn't check if it's dead. Why would it start crashing when using this script and not when its excluded.


    2) There is a warlock spell that causes it to crash as well. I have been unable to determine exactly what one. (destro)


    Any ideas? I love this script and I really want to use it, but there's no way I can if the server crashes constantly.

  5. #35
    Trle94's Avatar Contributor
    Reputation
    167
    Join Date
    May 2009
    Posts
    329
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Its Perfect +Rep

  6. #36
    gotiefan's Avatar Sergeant
    Reputation
    1
    Join Date
    Jan 2008
    Posts
    54
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This part of the code gives me errors:
    Code:
    for(GroupMembersSet::iterator itr = SubGroup->GetGroupMembersBegin(); itr != SubGroup->GetGroupMembersEnd(); itr++)
    		{
    			PlayerInfo * pi = (*itr);
    			Player * gm = objmgr.GetPlayer(pi->guid);
    			if( !gm || gm == pPlayer)
    				continue;
    			if(gm->isInRange(pPlayer, 100.0f) && gm->CombatStatus.IsInCombat())
    				group_members.insert(gm);
    		}
    Error:
    Code:
    1>..\src\WorldPvPScripts\[CUSTOM]PvP.cpp(69) : error C2440: 'initializing' : cannot convert from 'PlayerPointer' to 'Player *'
    1>        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
    1>..\src\WorldPvPScripts\[CUSTOM]PvP.cpp(72) : error C2664: 'Object::isInRange' : cannot convert parameter 1 from 'Player *' to 'ObjectPointer'
    1>        Constructor for class 'std::tr1::shared_ptr<_Ty>' is declared 'explicit'
    1>        with
    1>        [
    1>            _Ty=Object
    1>        ]
    Already tried changing
    Code:
    Player * gm = objmgr.GetPlayer(pi->guid);
    To

    Code:
    PlayerPointer gm = objmgr.GetPlayer(pi->guid);
    No success.

    Anyone?

  7. #37
    Jotox's Avatar Contributor
    Reputation
    250
    Join Date
    Mar 2008
    Posts
    282
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Megosh: fixed the crash.

    Bump!
    Any feedback?

  8. #38
    kylr303's Avatar Member
    Reputation
    3
    Join Date
    Dec 2007
    Posts
    8
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Screenie or it didnt happen!

  9. #39
    Death_Master's Avatar Member
    Reputation
    4
    Join Date
    Mar 2009
    Posts
    27
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nice! +Rep

  10. #40
    Megosh's Avatar Member
    Reputation
    1
    Join Date
    Mar 2008
    Posts
    12
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Jotox1 View Post
    Megosh: fixed the crash.

    Bump!
    Any feedback?
    HOW!? :P

    I've been looking into this for a while... with no success.

    I've recently turned to the dark side... mangos. I'm working on attempting to port it over, it'll be fun! XD

  11. #41
    Jotox's Avatar Contributor
    Reputation
    250
    Join Date
    Mar 2008
    Posts
    282
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Megosh: I updated the original script that I posted.

  12. #42
    Megosh's Avatar Member
    Reputation
    1
    Join Date
    Mar 2008
    Posts
    12
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well... I just realized that one of the reasons why this was causing a crash had something to do with the library's messing up when I first posted. I completely forgot that I resolved the issue a while back.

    It's just been so long since I looked at this. Those checks wouldn't have fixed the issue I had, but better safe than sorry. XD

    Still, epic script.
    Last edited by Megosh; 07-15-2009 at 07:48 PM.

  13. #43
    www5th's Avatar Member
    Reputation
    2
    Join Date
    Jan 2008
    Posts
    16
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by tim4 View Post
    Can you update your script for hearthstone?
    i done this for hs's sharedpointer

    Code:
    //************************************
    // Method:    GivePoints
    // FullName:  GivePoints
    // Access:    public 
    // Returns:   void
    // Qualifier:
    // Parameter: PlayerPointer player
    // Parameter: int32 points
    //************************************
    void GivePoints( PlayerPointer player, int32 points)
    {
     if( points < 0 )
      player->m_arenaPoints = ((int32)player->m_arenaPoints > (-1)*(points)) ? player->m_arenaPoints + points : 0;//Subtract points, or set to 0 if they don't have enough.
     else
      player->m_arenaPoints += points;
     player->SetUInt32Value(PLAYER_FIELD_ARENA_CURRENCY, player->m_arenaPoints);
    }
    //************************************
    // Method:    OnPlayerKill
    // FullName:  OnPlayerKill
    // Access:    public 
    // Returns:   void
    // Qualifier:
    // Parameter: PlayerPointer pPlayer
    // Parameter: PlayerPointer pVictim
    //************************************
    void OnPlayerKill(PlayerPointer pPlayer, PlayerPointer pVictim)
    {
     if( pPlayer->getLevel() < REQUIRED_LEVEL || pVictim->getLevel() < REQUIRED_LEVEL)
      return;
     if( !pPlayer->HasFlag(PLAYER_FLAGS, PLAYER_FLAG_FREE_FOR_ALL_PVP) || !pVictim->HasFlag(PLAYER_FLAGS, PLAYER_FLAG_FREE_FOR_ALL_PVP) )
      return;
     Group *pGroup = pPlayer->GetGroup();
     if( pGroup && pGroup->GetGroupType() == GROUP_TYPE_RAID && RAIDS_ALLOWED==0)
     {
      SubGroup * sgr;
      for(uint32 i = 0; i < pPlayer->GetGroup()->GetSubGroupCount(); ++i)
      {
       sgr = pPlayer->GetGroup()->GetSubGroup(i);
       pPlayer->GetGroup()->Lock();
       for(GroupMembersSet::iterator itr = sgr->GetGroupMembersBegin(); itr != sgr->GetGroupMembersEnd(); ++itr)
       {
        if((*itr)->m_loggedInPlayer)
         (*itr)->m_loggedInPlayer->BroadcastMessage("%sYou cannot gain arena points while in a raid group.", "|cffff0000");
       }
       pPlayer->GetGroup()->Unlock();
      }
      return;
     }
     int32 Points = NUM_POINTS;
     if( PARTY_ALLOWED!=0 && pPlayer->GetGroup() )
     {
      set<PlayerPointer> group_members;
      Group * Group = pPlayer->GetGroup();
      SubGroup * SubGroup = pGroup->GetSubGroup(pPlayer->GetSubGroup());
      if( !Group || !SubGroup )
       return;//Just in case.
      for(GroupMembersSet::iterator itr = SubGroup->GetGroupMembersBegin(); itr != SubGroup->GetGroupMembersEnd(); itr++)
      {
       PlayerInfo * pi = (*itr);
       PlayerPointer gm = objmgr.GetPlayer(pi->guid);
       if( !gm || gm == pPlayer)
        continue;
       if(gm->isInRange(pPlayer, 100.0f) && gm->CombatStatus.IsInCombat())
        group_members.insert(gm);
      }
      if( group_members.size() )
       Points = (Points / group_members.size());//Divide by group members.
      if( Points % 5)
       Points += 5 - (Points % 5);//Round up to the nearest 5.
      for(set<PlayerPointer>::iterator itr = group_members.begin(); itr != group_members.end(); itr++)
      {
       GivePoints((*itr), Points);
       (*itr)->BroadcastMessage("You have gained %u Arena Points from a party member's kill.", Points);
      }
     }
     GivePoints( pPlayer, Points );
     if( pPlayer->GetSession() )
      pPlayer->GetSession()->SendNotification("%sYou gain %u Arena Points.", "|cff00ff00", Points);
     GivePoints( pVictim, (-1)*(int32)POINTS_DEATH);
     if(pVictim->GetSession())
      pVictim->GetSession()->SendNotification("%sYou lose %u Arena Points.", "|cffff0000", POINTS_DEATH);
    }
    
    void SetupArenaPvP(ScriptMgr * mgr)
    {
     mgr->register_hook(SERVER_HOOK_EVENT_ON_KILL_PLAYER, &OnPlayerKill);
    }
    tested. no error.

  14. #44
    Exacute's Avatar Active Member
    Reputation
    67
    Join Date
    Mar 2008
    Posts
    337
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    +Rep x1 100 rep straight..
    well.. to topic..
    Epic..
    Surely going to use this.

    EDIT; gah! can't rep your post..
    Last edited by Exacute; 07-23-2009 at 04:29 AM.
    [/COLOR]

  15. #45
    Jotox's Avatar Contributor
    Reputation
    250
    Join Date
    Mar 2008
    Posts
    282
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    www5th... What program did you use for that?

Page 3 of 3 FirstFirst 123

Similar Threads

  1. [Trading] Lazy Larry Arena Scripts for WoD CD Key
    By WoWtRaDeR662 in forum World of Warcraft Buy Sell Trade
    Replies: 0
    Last Post: 05-31-2015, 09:48 AM
  2. [Lua-Release] Zul'Drak Arena Boss Scripts
    By Kaidos in forum WoW EMU General Releases
    Replies: 15
    Last Post: 07-04-2009, 06:42 PM
  3. [Compiling Custom Scripts] Arena Event
    By Pwntzyou in forum WoW EMU Guides & Tutorials
    Replies: 26
    Last Post: 06-14-2009, 07:17 AM
  4. [Frost Team]Php Arena Caclulator Script!
    By bsod-staff14 in forum WoW EMU General Releases
    Replies: 15
    Last Post: 11-30-2008, 03:48 PM
  5. Arena script!
    By Skavhaug in forum WoW EMU Questions & Requests
    Replies: 6
    Last Post: 09-12-2008, 06:55 PM
All times are GMT -5. The time now is 09:50 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search