Jump to content

[Zero] Reset CD's mana and hp after dueling.


Agency

Recommended Posts

Posted

Anyone has a script to reset cooldowns,mana and hp after a duel?

This would allow my beta testing team to test faster and more efficient.

Thanks in advance,

Titan.

Posted

Actually .cooldown already reset all cooldown.

I don't know if there are commands for life and mana (but you could modify the amount by doing .mod hp <my_value> or .mod mana <my_value>).

Posted
I can write you a lua script to do the above :)

Would be appreciated, and it should just happen whenever a duel ends.

( i know theirs commands todo this, but should function for every player not only for gamemasters )

Posted

The below should work, however I have not had the chance to test it. Save it as a .lua file within your lua_script folder and either reload the Lua engine (.reload eluna) or restart the server. Let me know how it turns out for you :)

function OnDuelReset(event, winner, loser)    
   -- Reset winner cooldowns, health and power
   winner:ResetAllCooldowns()
   winner:SetHealth(winner:GetMaxHealth())
   winner:SetPower(winner:GetPowerType(), winner:GetMaxPower())

   -- Reset loser cooldowns, health and power
   loser:ResetAllCooldowns()
   loser:SetHealth(loser:GetMaxHealth())
   loser:SetPower(loser:GetPowerType(), loser:GetMaxPower())
end


RegisterPlayerEvent(11, OnDuelReset)

Posted

@Foereaper

I thought deeper into this and came to the conlusion, that you were able to reset your cool downs and trinkets, after you wiped in a raid (just going outside and do a duel).

Is there a possibility to exclude all other regions but Durotar, Dun Morogh and Elwynn Forest and the tauren start zone (I forgot the name :D) (since there would be the most duels happening)?

Posted

Here you go, zones can be edited and added in the top most Lua table :) Have a whirl and let me know how it works. It requires both loser and winner to be within the same allowed zone to work, to prevent any form of teleport abuse etc. This can be changed if you wish.

local AllowedZones = {12, 1, 14, 215};

local function OnDuelReset(event, winner, loser)
local winnerZone, loserZone = winner:GetZoneId(), loser:GetZoneId()

-- Loop through allowed zones specified above
for _, zone in pairs(AllowedZones) do
	-- Reset winner and loser cooldowns, health and power if winner and loser is within allowed Zone
	if(winnerZone == zone) and (loserZone == zone) then
		winner:ResetAllCooldowns()
		winner:SetHealth(winner:GetMaxHealth())
		winner:SetPower(winner:GetPowerType(), winner:GetMaxPower())

		loser:ResetAllCooldowns()
		loser:SetHealth(loser:GetMaxHealth())
		loser:SetPower(loser:GetPowerType(), loser:GetMaxPower())
	end
end
end


RegisterPlayerEvent(11, OnDuelReset)

Posted

Wow, i'll use the updated script if it works. Then i can use a seperate duel zone.. since my intire server is based around world pvp - Dueling would break it.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use