Arena Script menu

Shout-Out

User Tag List

Thread: Arena Script

Page 1 of 3 123 LastLast
Results 1 to 15 of 45
  1. #1
    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)

    Arena Script

    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);
    		}
    		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<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!
    Last edited by Jotox; 07-12-2009 at 08:54 PM.

    Arena Script
  2. #2
    y2kss66's Avatar Member
    Reputation
    104
    Join Date
    Jan 2008
    Posts
    778
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nice contribution!

    1st post

    will +Rep after 24 hour cooldown is up.

  3. #3
    Link_S's Avatar Member
    Reputation
    125
    Join Date
    Dec 2008
    Posts
    293
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice one, +Rep
    Why do I need a signature?

  4. #4
    Sandile's Avatar Member
    Reputation
    32
    Join Date
    Aug 2008
    Posts
    314
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Very nice, I'm probably going to test it later. +Rep
    "i downloaded it in "pirates bay", can you tell me how to download it in steam, pls"

  5. #5
    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)
    Anyone tested yet?

  6. #6
    larzzon's Avatar Member
    Reputation
    6
    Join Date
    May 2008
    Posts
    70
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i think im gonan try it out

  7. #7
    xX EPIC Xx's Avatar Active Member
    Reputation
    37
    Join Date
    Apr 2008
    Posts
    238
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nice hehe e
    https://Fileusher.com

  8. #8
    kaato's Avatar Member
    Reputation
    12
    Join Date
    Dec 2007
    Posts
    95
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is the real shit!
    Releases like this is worth to have here!


    Edit:

    Code:
    1>ArenaPoint.cpp
    1>..\src\ArenaScript\ArenaPoint.cpp(33) : warning C4018: '>' : signed/unsigned mismatch
    1>..\src\ArenaScript\ArenaPoint.cpp(37) : error C2143: syntax error : missing ';' before '}'
    1>..\src\ArenaScript\ArenaPoint.cpp(75) : error C2065: 'itr2' : undeclared identifier
    1>..\src\ArenaScript\ArenaPoint.cpp(86) : error C2664: 'GivePoints' : cannot convert parameter 1 from 'std::_Tree<_Traits>::iterator' to 'Player *'
    1>        with
    1>        [
    1>            _Traits=std::_Tset_traits<Player *,std::less<Player *>,std::allocator<Player *>,false>
    1>        ]
    1>        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
    1>..\src\ArenaScript\ArenaPoint.cpp(95) : error C2146: syntax error : missing ';' before identifier 'GivePoints'
    
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    Did i do something wrong or is it anything wrong with it?
    Fixfixchopchop <3

    +rep when fixed
    Last edited by kaato; 04-07-2009 at 11:28 AM.

  9. #9
    InvaderGir's Avatar Banned
    Reputation
    3
    Join Date
    Mar 2009
    Posts
    161
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    "missing ';' before identifier 'GivePoints'" See this ? Add ";" Before 'GivePoints' and your done


  10. #10
    kaato's Avatar Member
    Reputation
    12
    Join Date
    Dec 2007
    Posts
    95
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Still don't work, it's still the other errors -_-

  11. #11
    lesone's Avatar Member
    Reputation
    1
    Join Date
    Dec 2007
    Posts
    52
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nah this code is a bit messed lol xd

    Code:
    GivePoints( pVictim, (-1)*(int32)POINTS_DEATH);
    isn't correct

    but it easy to fix it by the way

  12. #12
    kaato's Avatar Member
    Reputation
    12
    Join Date
    Dec 2007
    Posts
    95
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    so fix it
    i have no idea how -.-

  13. #13
    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)
    Fixed, updated original script.

  14. #14
    kaato's Avatar Member
    Reputation
    12
    Join Date
    Dec 2007
    Posts
    95
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I only got this now:
    Code:
    1>..\src\KatoScript\ArenaPoint.cpp(85) : error C2664: 'GivePoints' : cannot convert parameter 1 from 'std::_Tree<_Traits>::iterator' to 'Player *'
    1>        with
    1>        [
    1>            _Traits=std::_Tset_traits<Player *,std::less<Player *>,std::allocator<Player *>,false>
    1>        ]
    1>        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
    1>..\src\KatoScript\ArenaPoint.cpp(94) : error C2146: syntax error : missing ';' before identifier 'GivePoints'
    But still failed

  15. #15
    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)
    GAH. lol. Okay. fixed, forreal now.

Page 1 of 3 123 LastLast

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 12:42 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