[PreRelease] Domination Event menu

Shout-Out

User Tag List

Results 1 to 9 of 9
  1. #1
    Ballwinkle's Avatar Contributor Authenticator enabled
    Reputation
    124
    Join Date
    Mar 2007
    Posts
    662
    Thanks G/R
    0/12
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [PreRelease] Domination Event

    For those of you who never played UT,
    Domination is a game where two teams fight over control points (CP).
    Every X seconds the game ticks, and each team gets points for each CP they control at that moment.

    CODE
    Code:
    //------------------
    // Title:    Domination
    // Desc:    ???
    // Author:  Spidey
    //------------------
    
    #include "StdAfx.h"
    #include "Setup.h"
    
    #define DOM_TICK 30000;            
    //Every how many ms would we get points?
    
    static uint32 dom_cp1 = -1;        //control points
    static uint32 dom_cp2 = -1;
    static uint32 dom_cp3 = -1;        
    static uint32 dom_alliance = 0; //alliance points
    static uint32 dom_horde = 0;    //horde points
    static bool dom_enabled = false;//is the game in progress?
    static TimedEvent * te;
    
    
    
    class DOMTick
    {
    public:
        void Run();
    };
    
    void DOMTick::Run()
    {
        if(!dom_enabled)
            return;
    
        if(dom_cp1 == 0){
            dom_alliance++;
        } else if (dom_cp1 == 1){
            dom_horde++;
        }
        if(dom_cp2 == 0){
            dom_alliance++;
        } else if (dom_cp2 == 1){
            dom_horde++;
        }
        if(dom_cp3 == 0){
            dom_alliance++;
        } else if (dom_cp3 == 1){
            dom_horde++;
        }
        char scr[1024];
        sprintf(scr, "Domination ticked! Alliance: %u | Horde: %u. Next tick in 20 seconds!", dom_alliance, dom_horde);
        sWorld.SendWorldWideScreenText(scr);
    }
    
    void DOMStart(){
        dom_enabled = true;
        dom_alliance = 0;
        dom_horde = 0;
        dom_cp1 = -1;
        dom_cp2 = -1;
        dom_cp3 = -1;
        sWorld.SendWorldWideScreenText("Domination event started!");
    }
    
    void DOMEnd(){
        dom_enabled = false;
        char msg[1024];
        //calculate score
        if(dom_horde == dom_alliance){
            //Tie!
            sprintf(msg, "Domination event ended in a tie! Final score: %u", dom_horde);
        } else if (dom_horde > dom_alliance){
            //Hordies win
            sprintf(msg, "Domination event ended: HORDE WINS! Horde %u : Alliance %u", dom_horde, dom_alliance);
        } else {
            //allies win
            sprintf(msg, "Domination event ended: ALLIANCE WINS! Horde %u : Alliance %u", dom_horde, dom_alliance);
        }
        sWorld.SendWorldWideScreenText(msg);
    }
    
    class DOMStarter : public GameObjectAIScript
    {
    public:
        DOMStarter(GameObject* goinstance) : GameObjectAIScript(goinstance) {}
        static GameObjectAIScript *Create(GameObject * GO) { return new DOMStarter(GO); }
    
        void OnActivate(Player * pPlayer)
        {
            if(pPlayer->GetSession()->HasGMPermissions())
            {
                if(dom_enabled)
                    DOMEnd();
                else
                    DOMStart();
            } else {
                pPlayer->BroadcastMessage("Can't touch this");
            } 
        }
    };
    
    class CP1 : public GameObjectAIScript
    {
    public:
        CP1(GameObject* goinstance) : GameObjectAIScript(goinstance) {}
        static GameObjectAIScript *Create(GameObject * GO) { return new CP1(GO); }
        void OnActivate(Player * pPlayer)
        {
            if(dom_enabled)
            {
                dom_cp1 = pPlayer->GetTeam();
                            char msg[100];
                            sprintf("[%s]%s captured control point 1!", pPlayer->GetTeam() ? "Alliance" : "Horde", pPlayer->GetName();
                            sWorld.SendWorldWideScreenText(msg);
            }
        }
    };
    
    class CP2 : public GameObjectAIScript
    {
    public:
        CP2(GameObject* goinstance) : GameObjectAIScript(goinstance) {}
        static GameObjectAIScript *Create(GameObject * GO) { return new CP2(GO); }
        void OnActivate(Player * pPlayer)
        {
            if(dom_enabled)
            {
                dom_cp2 = pPlayer->GetTeam();
                            char msg[100];
                            sprintf("[%s]%s captured control point 2!", pPlayer->GetTeam() ? "Alliance" : "Horde", pPlayer->GetName();
                            sWorld.SendWorldWideScreenText(msg);
            }
        }
    };
    
    class CP3 : public GameObjectAIScript
    {
    public:
        CP3(GameObject* goinstance) : GameObjectAIScript(goinstance) {}
        static GameObjectAIScript *Create(GameObject * GO) { return new CP3(GO); }
        void OnActivate(Player * pPlayer)
        {
            if(dom_enabled)
            {
                dom_cp3 = pPlayer->GetTeam();
                            char msg[100];
                            sprintf("[%s]%s captured control point 3!", pPlayer->GetTeam() ? "Alliance" : "Horde", pPlayer->GetName();
                            sWorld.SendWorldWideScreenText(msg);
            }
        }
    };
    
    void SetupDomination(ScriptMgr *mgr){
        DOMTick dt;
        time_t ms = DOM_TICK;
        te = TimedEvent::Allocate(&dt, new CallbackP0<DOMTick>(&dt, &DOMTick::Run), 1, ms, 0);
        sWorld.event_AddEvent(te);
        mgr->register_gameobject_script(92000 , &DOMStarter::Create);
        mgr->register_gameobject_script(92001 , &CP1::Create);
        mgr->register_gameobject_script(92002 , &CP2::Create);
        mgr->register_gameobject_script(92003 , &CP3::Create);
        sLog.outString("Domination script loaded.");
    }

    SQL:
    CODE
    Code:
    INSERT INTO `gameobject_names` (`entry`,`Type`,`DisplayID`,`Name`) VALUES ('92000','10','6605','Domination Assistant');
    INSERT INTO `gameobject_names` (`entry`,`Type`,`DisplayID`,`Name`) VALUES ('92001','3','1337','Control Point 1');
    INSERT INTO `gameobject_names` (`entry`,`Type`,`DisplayID`,`Name`) VALUES ('92002','3','1337','Control Point 2');
    INSERT INTO `gameobject_names` (`entry`,`Type`,`DisplayID`,`Name`) VALUES ('92003','3','1337','Control Point 3');

    Credits to Ultra Spidey

    [PreRelease] Domination Event
  2. #2
    Gastricpenguin's Avatar Legendary
    Reputation
    980
    Join Date
    Feb 2007
    Posts
    2,236
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Last time i checked it crashed all servers.
    Life Puzzler WoW - Website | Forums

  3. #3
    Ballwinkle's Avatar Contributor Authenticator enabled
    Reputation
    124
    Join Date
    Mar 2007
    Posts
    662
    Thanks G/R
    0/12
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    works for me

  4. #4
    Creepfold's Avatar Contributor
    Reputation
    176
    Join Date
    Jul 2007
    Posts
    536
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    more information bout this please ^.^ like how it works !
    RickAstley LUA Boss! (Rickroll)
    mmowned.com/forums/emulator-server-releases/171755-epic-release-rick-astley-rickroll-boss-lua.html#post1119442

  5. #5
    Ballwinkle's Avatar Contributor Authenticator enabled
    Reputation
    124
    Join Date
    Mar 2007
    Posts
    662
    Thanks G/R
    0/12
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    spawn the CP somwere

    when the event starts and a player clicks on the CP it says 'Ally capture conrtol point 1'

    and every 30 secs the ally get 1 point per CP they have

  6. #6
    2dgreengiant's Avatar ★ Elder ★


    Reputation
    1192
    Join Date
    Feb 2007
    Posts
    7,129
    Thanks G/R
    1/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    u get it in COD4 also, nice release tho
    If you need me you have my skype, if you don't have my skype then you don't need me.

  7. #7
    Ballwinkle's Avatar Contributor Authenticator enabled
    Reputation
    124
    Join Date
    Mar 2007
    Posts
    662
    Thanks G/R
    0/12
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i gona put some of this in for project undermine

  8. #8
    Creepfold's Avatar Contributor
    Reputation
    176
    Join Date
    Jul 2007
    Posts
    536
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    undermine is stil active? cool! well go for it, 2 rep cookies for me cause this is an exelent way to replace arathi basin ! :P
    RickAstley LUA Boss! (Rickroll)
    mmowned.com/forums/emulator-server-releases/171755-epic-release-rick-astley-rickroll-boss-lua.html#post1119442

  9. #9
    Ballwinkle's Avatar Contributor Authenticator enabled
    Reputation
    124
    Join Date
    Mar 2007
    Posts
    662
    Thanks G/R
    0/12
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yay 2 rep power xD

    yea im working on undermine in my spare time

Similar Threads

  1. Doing Chess Event in Fresh Instance
    By IrishOsirus in forum World of Warcraft Exploits
    Replies: 324
    Last Post: 09-04-2007, 05:13 PM
  2. EVENT: The Final Model Edit
    By Fault in forum World of Warcraft Model Editing
    Replies: 40
    Last Post: 01-29-2007, 06:44 AM
  3. Ending Beta Event
    By Paperboi in forum World of Warcraft General
    Replies: 0
    Last Post: 01-13-2007, 04:53 PM
  4. UBRS Rend event bug.
    By issuesbunny in forum World of Warcraft Exploits
    Replies: 4
    Last Post: 01-07-2007, 05:39 AM
  5. Gold Duping Event
    By Ensui in forum World of Warcraft General
    Replies: 1
    Last Post: 12-12-2006, 04:23 PM
All times are GMT -5. The time now is 10:11 PM. 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