Revive Script On PvpKill menu

Shout-Out

User Tag List

Results 1 to 5 of 5
  1. #1
    mager1794's Avatar Member
    Reputation
    356
    Join Date
    Feb 2008
    Posts
    703
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Revive Script On PvpKill

    I've been trying everything i could to get this script to work, finally after masking my pride i decided to post about it

    Code:
    #include "StdAfx.h"
    #include "Setup.h"
    
    void PvpKill(Player* Attacker, Player* Vct)
    {
    
            Vct->SetMovement(MOVE_UNROOT, 1);
            if (Vct->getDeathState() == 1) // Just died
                             Vct->RemoteRevive();
                    if (Vct->getDeathState() != 0) // Not alive
                            Vct->ResurrectPlayer();
    
                Vct->SetUInt32Value(UNIT_FIELD_HEALTH, Vct->GetUInt32Value(UNIT_FIELD_MAXHEALTH));
                 Vct->SetUInt32Value(UNIT_FIELD_POWER1, Vct->GetUInt32Value(UNIT_FIELD_MAXPOWER1));
                 Vct->SetUInt32Value(UNIT_FIELD_POWER4, Vct->GetUInt32Value(UNIT_FIELD_MAXPOWER4));
            Vct->EventTeleport(0, -13240.040039f, 214.115387f, 31.001734f);
    
    
    }
    
    void SetupPvPSystem(ScriptMgr *mgr)
    {
        mgr->register_hook(SERVER_HOOK_EVENT_ON_KILL_PLAYER, (void*)PvpKill);
    }
    Ive ran checks to make sure the event occurs and it does, it even teleports as it should. The only problem is the players never revive.
    Last edited by Ground Zero; 07-09-2010 at 07:47 AM.
    Lunar Gaming - Reaching For The Stars

    Revive Script On PvpKill
  2. #2
    TheSpidey's Avatar Elite User
    Reputation
    365
    Join Date
    Jan 2008
    Posts
    2,200
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's because in Player.cpp, OnKillPlayer is called before the victim dies (Line ~13130).

    Why don't you use OnRepop for this?

  3. #3
    mager1794's Avatar Member
    Reputation
    356
    Join Date
    Feb 2008
    Posts
    703
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    When does on Repop occur? like after they revive or what?
    Lunar Gaming - Reaching For The Stars

  4. #4
    Matis02's Avatar Contributor CoreCoins Purchaser
    Reputation
    154
    Join Date
    Mar 2007
    Posts
    378
    Thanks G/R
    2/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here is my event reviver. Its has a lot of defines but you can see what iv done. Use it how ever you like.

    If you dont understand it then read below:

    If you die in the allocated area, you will receive a system msg countdown timer that will revive you and send you back to the start of the event.

    Code:
    //    ||:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:||
    //    ||                                  _________              ||
    //    ||  \ \                          / /________  \        S   ||
    //    ||   \ \  Founder: Paul Walsh   / /|         \ \       C   ||
    //    ||    \ \                      / / |          | |      R   ||
    //    ||     \ \                    / /| |          | |      I   ||
    //    ||      \ \      / /\ \      / / | |          | |      P   ||
    //    ||       \ \    / /  \ \    / /  | |_________/ /       T   ||
    //    ||        \ \==/ /    \ \==/ /   | |_________ /        S   ||
    //    ||     Walshie Developments                                ||
    //    ||                      www.walshiedevelopments.com        ||
    //    ||:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:||
    
    
    #include "StdAfx.h"
    #include "..\..\WDev_Controller\Setup.h"
    #include "..\..\WDev_Controller\Defines.h"
    //                                            ::Script Start::
    class ResHandler
    {
        public:
            void Res(Player *Plr)
            {
                if (Plr->getDeathState() != CORPSE)
                    return;
                Plr->ResurrectPlayer();
                ST(1, 0, 16201.511, 16205.163, 0.1330, 0.0);
                Plr->SetUInt32Value(UNIT_FIELD_HEALTH, Plr->GetUInt32Value(UNIT_FIELD_MAXHEALTH));
                Plr->SetUInt32Value(UNIT_FIELD_POWER1, Plr->GetUInt32Value(UNIT_FIELD_MAXPOWER1));
                CastSpell(46165, 0);
            }
    };
    class Count10
    {
        public:
            void C10(Player *Plr)
            {
                Bcast("Ressurect in: %s10 sec|r", TEXT_WHITE);
            }
    };
    class Count3
    {
        public:
            void C3(Player *Plr)
            {
                Bcast("Ressurect in: %s3 sec|r", TEXT_WHITE);
            }
    };
    class Count2
    {
        public:
            void C2(Player *Plr)
            {
                Bcast("Ressurect in: %s2 sec|r", TEXT_WHITE);
            }
    };
    class Count1
    {
        public:
            void C1(Player *Plr)
            {
                Bcast("Ressurect in: %s1 sec|r", TEXT_WHITE);
            }
    };
    void Release(Player *Plr)
    {
        if (pX() >= 15620 && pX() >= 15630 && pX() <= 16920 && pX() <= 16900)
        {
            ResHandler mc0;
                TimedEvent *te0 = TimedEvent::Allocate(&mc0, new CallbackP1<ResHandler, Player*>(&mc0, &ResHandler::Res, Plr), 0, 20000, 1);
            Count10 mc10;
                TimedEvent *te10 = TimedEvent::Allocate(&mc10, new CallbackP1<Count10, Player*>(&mc10, &Count10::C10, Plr), 0, 10000, 1);
            Count3 mc3;
                TimedEvent *te3 = TimedEvent::Allocate(&mc3, new CallbackP1<Count3, Player*>(&mc3, &Count3::C3, Plr), 0, 17000, 1);
            Count2 mc2;
                TimedEvent *te2 = TimedEvent::Allocate(&mc2, new CallbackP1<Count2, Player*>(&mc2, &Count2::C2, Plr), 0, 18000, 1);
            Count1 mc1;
                TimedEvent *te1 = TimedEvent::Allocate(&mc1, new CallbackP1<Count1, Player*>(&mc1, &Count1::C1, Plr), 0, 19000, 1);
            AddEvent(te0);
            AddEvent(te10);
            AddEvent(te3);
            AddEvent(te2);
            AddEvent(te1);
            Bcast("[%sWorld Event|r] This Event will automatically resurrect you in %s20 seconds|r.", TEXT_GREEN, TEXT_WHITE);
        }
    }
                                            //    ::Handlers::
    void SetupSCResurrectHandler(ScriptMgr * mgr)
    {
        sLog.outColor(TBLUE, "[Loaded] Staircase: Resurrect Handler LU10.0611");
        sLog.outColor(TNORMAL, "\n");
        mgr->register_hook(SERVER_HOOK_EVENT_ON_REPOP, Release);
    }
    Last edited by Matis02; 07-10-2010 at 12:49 AM.


  5. #5
    TheSpidey's Avatar Elite User
    Reputation
    365
    Join Date
    Jan 2008
    Posts
    2,200
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by mager1794 View Post
    When does on Repop occur? like after they revive or what?
    Repop occurs after the player releases spirit. If I remember correctly, in Ascent it occurs after the core searches for a suitable graveyard and ports the player there in spirit form, so you'll have to resurrect and port him.

    I just modified that whole part to make OnRepop a bool, so when it returns true it means the graveyard/spirit-form part is overridden and never executed. You'd might want to do that too

Similar Threads

  1. [Lua] Revive script.
    By Daimyo2704 in forum WoW EMU General Releases
    Replies: 1
    Last Post: 02-12-2010, 04:58 PM
  2. I got banned by using that, Anti AFK auto queue script or w/e
    By julian_in in forum World of Warcraft General
    Replies: 22
    Last Post: 11-03-2006, 02:30 PM
  3. Im Looking For A /script Macro... Plz Help
    By codycondame in forum World of Warcraft General
    Replies: 0
    Last Post: 10-05-2006, 02:04 PM
  4. Any Anti AFK Scripts available?
    By paboee in forum World of Warcraft General
    Replies: 2
    Last Post: 08-30-2006, 09:11 AM
  5. [Program] WoW Jumper AntiAFK Script
    By Cypher in forum World of Warcraft Bots and Programs
    Replies: 5
    Last Post: 06-23-2006, 10:38 PM
All times are GMT -5. The time now is 06:06 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