User Tag List

Results 1 to 6 of 6

Thread: Duel reset

  1. #1
    Member
    Join Date
    Sep 2016
    Posts
    21
    XP
    230
    Level
    2
    Thanks
    0
    Thanked 1 Time in 1 Post

    Duel reset

    Code:
    function DuelDone(event, pWinner, pLoser)
    pWinner:ResetAllCooldowns()
    pLoser:ResetAllCooldowns()
    pWinner:SetHealth(pWinner:GetMaxHealth())
    pLoser:SetHealth(pLoser:GetMaxHealth())
    end
    
    RegisterPlayerEvent(11, DuelDone)
    That's the script I use it works but I want to add on duel start reset too and reset for mana

  2. #2
    Mad Scientist <span style='color: #008000'><span class='glow_006400'>slp13at420</span></span>'s Avatar



    Join Date
    Dec 2013
    Location
    Idaho
    Posts
    2,497
    XP
    20,134,837
    Level
    500
    Thanks
    1,092
    Thanked 333 Times in 213 Posts
    Code:
    
    function DuelDone(event, pWinner, pLoser)
    -- reset cd's
    	pWinner:ResetAllCooldowns();
    	pLoser:ResetAllCooldowns();
    
    -- reset hp
    	pWinner:SetHealth(pWinner:GetMaxHealth());
    	pLoser:SetHealth(pLoser:GetMaxHealth());
    
    -- reset mana . power_id 0
    	pWinner:SetMaxPower(0, pWinner:GetMaxPower(0));
    	pLoser:SetMaxPower(0, pLoser:GetMaxPower(0));
    
    end
    
    RegisterPlayerEvent(10, DuelDone) -- duel starts
    RegisterPlayerEvent(11, DuelDone) -- duel ends
    
    http://eluna.emudevs.com/Unit/SetMaxPower.html

    you might be able to replace Power_ID:0 with Power_ID:127 and just reset ALL powers for player class including hp..
    Last edited by slp13at420; 09-24-2016 at 06:34 PM.
    Achievements:
    Shopper Got a Sticky! Member 1 year registered Level XL Level D
    Awards:
    Pot Head LOL Raffle Winner Top Tagger Donator Hangman Scripter Repacker Drunk Support Member of Staff Da Bomb!
    "Cuz PvP's better with a bag 'o' weed"
    !! King Spade !!

    -Guild Plot System-
    Grumbo'z Guild Warz


    -VIP System-
    Grumbo'z VIP System

  3. #3
    Mad Scientist <span style='color: #008000'><span class='glow_006400'>slp13at420</span></span>'s Avatar



    Join Date
    Dec 2013
    Location
    Idaho
    Posts
    2,497
    XP
    20,134,837
    Level
    500
    Thanks
    1,092
    Thanked 333 Times in 213 Posts
    you may also want to experiment with unit:GetPowerType();
    Achievements:
    Shopper Got a Sticky! Member 1 year registered Level XL Level D
    Awards:
    Pot Head LOL Raffle Winner Top Tagger Donator Hangman Scripter Repacker Drunk Support Member of Staff Da Bomb!
    "Cuz PvP's better with a bag 'o' weed"
    !! King Spade !!

    -Guild Plot System-
    Grumbo'z Guild Warz


    -VIP System-
    Grumbo'z VIP System

  4. #4
    Original Poster
    Member
    Join Date
    Sep 2016
    Posts
    21
    XP
    230
    Level
    2
    Thanks
    0
    Thanked 1 Time in 1 Post
    Thanks i will test tomorrow

  5. The Following User Says Thank You to Zalvia For This Useful Post:


  6. #5
    Original Poster
    Member
    Join Date
    Sep 2016
    Posts
    21
    XP
    230
    Level
    2
    Thanks
    0
    Thanked 1 Time in 1 Post
    Mana reset doesnt work. I tried to set to 127 and it again doesnt reset

  7. #6
    Moderator <span style='color: #FF1493'><span class='glow_000000'>Vitrex</span></span>'s Avatar

    Join Date
    Sep 2013
    Location
    Vilnius , Lithuania
    Posts
    1,049
    XP
    1,000,667
    Level
    174
    Thanks
    283
    Thanked 137 Times in 97 Posts
    Quote Originally Posted by Zalvia View Post
    Mana reset doesnt work. I tried to set to 127 and it again doesnt reset
    Try to use 0 instead of 127 and other values defined including HP.
    Code:
    enum Powers{
        POWER_MANA        = 0,
        POWER_RAGE        = 1,
        POWER_FOCUS       = 2,
        POWER_ENERGY      = 3,
        POWER_HAPPINESS   = 4,
        POWER_RUNE        = 5,
        POWER_RUNIC_POWER = 6,
        MAX_POWERS        = 7,
        POWER_ALL         = 127,         // default for class?
        POWER_HEALTH      = 0xFFFFFFFE   // (-2 as signed value)
    };
    Something like :
    Code:
    if ( pWinner->getPowerType() == 0 )
    pWinner->SetMaxPower((0, pWinner->GetMaxPower(0));
    read more about this :
    Get max power - http://eluna.emudevs.com/Unit/GetMaxPower.html
    Get power Type - http://eluna.emudevs.com/Unit/GetPowerType.html
    Set Max Power - http://eluna.emudevs.com/Unit/SetMaxPower.html
    Achievements:
    Shopper Got a Sticky! 1 year registered Member Level XL Level C Referrer
    Awards:
    Raffle Winner Donator Member of Staff Pot Head
    I won't create anything for you, i can only guide you to right direction.
    Don't forget to read rules before posting.
    Forum Rules
    Need and assistance with your issue? use this section to ask for assistance !
    -----
    My Portfolio
    Wanna learn PHP ? check out my One-Page project


  8. The Following User Says Thank You to Vitrex For This Useful Post:


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •