pvp reward need help menu

User Tag List

Results 1 to 14 of 14
  1. #1
    shahin's Avatar Member
    Reputation
    1
    Join Date
    Feb 2020
    Posts
    9
    Thanks G/R
    4/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    pvp reward need help

    Hello
    i use this script
    Code:
    -- Variables
    local gold = math.random(200,250)
    local goldonkill = true -- use true or false for on or off
    local lvlforkill = true -- use true to give gold by player killed level or false to go by fixed rate
    local rate = 1
    local xp = math.random(30,40)
    local xponkill = true -- use true or false for on or off
    
    function OnKill(event, pPlayer, pKilled)
    	if(pKilled:IsPlayer()) then
    		if(goldonkill == true) then
    			if(lvlforkill == true) then
    				killedlevel = pKilled:GetPlayerLevel()
    				pPlayer:DealGoldMerit(gold*killedlevel)
    			elseif(lvlforkill == false) then
    				pPlayer:DealGoldMerit(gold*rate)
                end
    		end
    		if(xponkill == true) then
    						pPlayer:GiveXp(xp)
    						pPlayer:SendAreaTriggerMessage("add xp = "..xp.." ")
    
    		end
    	end
    end
    
    
    if (GetLuaEngine() ~= "LuaHypArc") then
    	print("[LuaHypArc]: [Stats] not loaded.")
    else
    	-- Keep one commented out the other or when a player gets and honorable kill, both will execute.
    	--RegisterServerHook(23, "OnKill") -- Hook for honorable kills
    	RegisterServerHook(2, "OnKill") -- Hook for killing a player
    	print("[LuaHypArc]: [Stats] loaded.")
    end

    but it's for single player . how i can add pAssist on this ?
    i want after kill player give xp all group member nearest killed .

    and how i can change battleground reward with lua ?

    pvp reward need help
  2. #2
    shahin's Avatar Member
    Reputation
    1
    Join Date
    Feb 2020
    Posts
    9
    Thanks G/R
    4/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    why all send spam ?!

  3. #3
    stoneharry's Avatar Moderator Harry

    Authenticator enabled
    Reputation
    1613
    Join Date
    Sep 2007
    Posts
    4,554
    Thanks G/R
    151/146
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    WorldObject:GetPlayersInRange - Eluna
    Player:IsInSameGroupWith - Eluna
    Player:GiveXP - Eluna

    Something like:
    Code:
    for _,plr in pairs(pPlayer:GetPlayersInRange(40)) do
        if pPlayer:IsInSameGroupWith(plr) then
    		plr:GiveXP(xp)
    	end
    end

  4. Thanks shahin (1 members gave Thanks to stoneharry for this useful post)
  5. #4
    shahin's Avatar Member
    Reputation
    1
    Join Date
    Feb 2020
    Posts
    9
    Thanks G/R
    4/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thank you for answer . it's best list of object's
    i use you'r code but give some error
    it's : attempt to call method 'GetPlayersInRange' (a nil value)
    second question :
    Is there a list of valid function?
    Last edited by shahin; 02-14-2020 at 08:03 AM.

  6. #5
    stoneharry's Avatar Moderator Harry

    Authenticator enabled
    Reputation
    1613
    Join Date
    Sep 2007
    Posts
    4,554
    Thanks G/R
    151/146
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by shahin View Post
    thank you for answer . it's best list of object's
    i use you'r code but give some error
    it's : attempt to call method 'GetPlayersInRange' (a nil value)
    second question :
    Is there a list of valid function?
    Please share the code you are using. Also what emulator and Lua engine are you using?

    I use this function in this script: ZombiesProject/1_Entrance.lua at master . stoneharry/ZombiesProject . GitHub
    Eluna - 3.3.5a TrinityCore
    Code:
    local function SiegeGossip1(event, player, pUnit)
        player:GossipMenuAddItem(9, "We are ready.", 0, 1)
        player:GossipMenuAddItem(0, "Nevermind.", 0, 0)
        player:GossipSendMenu(90000, pUnit)
    end
    
    local function SiegeGossip2(event, player, pUnit, sender, initid, code)
    	if initid == 1 then
    		local t = pUnit:GetPlayersInRange(40)
    		if #t >= 5 or _debug then
    			pUnit:SetNPCFlags(0)
    			pUnit:RegisterEvent(StartEvent, 1000, 1)
    		else
    			player:SendBroadcastMessage("There are not enough players nearby to start the event. There needs to be five people minimum.")
    		end
    	end
    	player:GossipComplete()
    end
    
    RegisterCreatureGossipEvent(90071, 1, SiegeGossip1)
    RegisterCreatureGossipEvent(90071, 2, SiegeGossip2)
    Only starts the event if there are 5 players within 40 yards or debug mode is enabled.

    It may be that this method is not available on a player object, but that seems unlikely.
    Last edited by stoneharry; 02-14-2020 at 02:25 PM.

  7. Thanks shahin (1 members gave Thanks to stoneharry for this useful post)
  8. #6
    shahin's Avatar Member
    Reputation
    1
    Join Date
    Feb 2020
    Posts
    9
    Thanks G/R
    4/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i use you'r code on my script
    Code:
    -- Variables
    local gold = math.random(200,250)
    local goldonkill = true -- use true or false for on or off
    local lvlforkill = true -- use true to give gold by player killed level or false to go by fixed rate
    local rate = 1
    local xp = math.random(30,40)
    local xponkill = true -- use true or false for on or off
    
    function OnKill(event, pPlayer, pKilled)
    	if(pKilled:IsPlayer()) then
    		if(goldonkill == true) then
    			if(lvlforkill == true) then
    				killedlevel = pKilled:GetPlayerLevel()
    				pPlayer:DealGoldMerit(gold*killedlevel)
    			elseif(lvlforkill == false) then
    				pPlayer:DealGoldMerit(gold*rate)
                end
    		end
    		if(xponkill == true) then
    		    pPlayer:GiveXp(xp)
    		    pPlayer:SendAreaTriggerMessage("add xp = "..xp.." ")
    			for _,plr in pairs(pPlayer:GetPlayersInRange(100,2,1)) do
    		       if pPlayer:IsInSameGroupWith(plr) then
    		      	plr:GiveXp(xp)
    		      	plr:SendAreaTriggerMessage("add xp = "..xp.." ")
    			   end
    			end
    		end
    	end
    end
    
    
    if (GetLuaEngine() ~= "LuaHypArc") then
    	print("[LuaHypArc]: [Stats] not loaded.")
    else
    	-- Keep one commented out the other or when a player gets and honorable kill, both will execute.
    	--RegisterServerHook(23, "OnKill") -- Hook for honorable kills
    	RegisterServerHook(2, "OnKill") -- Hook for killing a player
    	print("[LuaHypArc]: [Stats] loaded.")
    end
    Last edited by shahin; 02-14-2020 at 02:45 PM.

  9. #7
    shahin's Avatar Member
    Reputation
    1
    Join Date
    Feb 2020
    Posts
    9
    Thanks G/R
    4/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've been looking for these for a long time. thank you!
    Please share the code you are using. Also what emulator and Lua engine are you using?

    I use this function in this script: ZombiesProject/1_Entrance.lua at master . stoneharry/ZombiesProject . GitHub
    Eluna - 3.3.5a TrinityCore
    i use arcemu . Because I think it's much easier than Trinity

  10. #8
    stoneharry's Avatar Moderator Harry

    Authenticator enabled
    Reputation
    1613
    Join Date
    Sep 2007
    Posts
    4,554
    Thanks G/R
    151/146
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by shahin View Post
    I've been looking for these for a long time. thank you!

    i use arcemu . Because I think it's much easier than Trinity
    ArcEmu has a different API. Example: Misc-WoW-Stuff/CoT-TheHunt.lua at master . stoneharry/Misc-WoW-Stuff . GitHub
    Code:
    	local found = false
    	for _,v in pairs(pUnit:GetInRangePlayers()) do
    		if v:IsAlive() and v:GetDistanceYards(pUnit) < 50 then
    			found = true
    			if v:GetZ() < 36.8 then
    				v:Teleport(429, 815, 478, 37.4)
    				v:CastSpell(64446)
    			end
    		end
    	end
    I do not recommend using ArcEmu. It's not been actively developed in many years and is light years behind other emulators now. It was very unstable and buggy, as sad as that is to say. I had to abandon a project I worked on for years because I used ArcEmu. It would be too much work to migrate it to another emulator.

    TrinityCore has Eluna Lua support which allows for the scripting of content in a very similar way to ArcEmu's Lua. AzerothCore allows you to use C++ modules, another possible way to script.

  11. Thanks shahin (1 members gave Thanks to stoneharry for this useful post)
  12. #9
    shahin's Avatar Member
    Reputation
    1
    Join Date
    Feb 2020
    Posts
    9
    Thanks G/R
    4/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can I have a Trinity Core download link without a problem? The Trinity Core I downloaded has problems

  13. #10
    shahin's Avatar Member
    Reputation
    1
    Join Date
    Feb 2020
    Posts
    9
    Thanks G/R
    4/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    like your help i change GetPlayersInRange to GetInRangePlayers and fix it !
    but i cant find equivalent IsInSameGroupWith

  14. #11
    stoneharry's Avatar Moderator Harry

    Authenticator enabled
    Reputation
    1613
    Join Date
    Sep 2007
    Posts
    4,554
    Thanks G/R
    151/146
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    It has this: Edge-of-Chaos/UnitFunctions.h at master . stoneharry/Edge-of-Chaos . GitHub

    Code:
    		static int GetGroupPlayers(lua_State* L, Unit* ptr)
    		{
    			TEST_PLAYER()
    			Player* _player = TO_PLAYER(ptr);
    			Group* party = _player->GetGroup();
    			uint32 count = 0;
    			lua_newtable(L);
    			if(party)
    			{
    				GroupMembersSet::iterator itr;
    				SubGroup* sgrp;
    				party->getLock().Acquire();
    				for(uint32 i = 0; i < party->GetSubGroupCount(); i++)
    				{
    					sgrp = party->GetSubGroup(i);
    					for(itr = sgrp->GetGroupMembersBegin(); itr != sgrp->GetGroupMembersEnd(); ++itr)
    					{
    						if((*itr)->m_loggedInPlayer && (*itr)->m_loggedInPlayer->GetZoneId() == _player->GetZoneId() && _player->GetInstanceID() == (*itr)->m_loggedInPlayer->GetInstanceID())
    						{
    							count++,
    							      lua_pushinteger(L, count);
    							PUSH_UNIT(L, (*itr)->m_loggedInPlayer);
    							lua_rawset(L, -3);
    						}
    					}
    				}
    				party->getLock().Release();
    			}
    			return 1;
    		}
    So:

    Code:
    local group = player:GetGroupPlayers()
    for _,partyPlr in pairs(group) do
        partyPlr:GiveXp(100)
    end
    On TrinityCore: TrinityCore Collaboration Platform
    TrinityCore Collaboration Platform

    Eluna can be got here: ElunaLuaEngine . GitHub
    GitHub - ElunaLuaEngine/ElunaTrinityWotlk: Eluna Lua Engine merged with Trinity 3.3.5

  15. Thanks shahin (1 members gave Thanks to stoneharry for this useful post)
  16. #12
    shahin's Avatar Member
    Reputation
    1
    Join Date
    Feb 2020
    Posts
    9
    Thanks G/R
    4/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It was really great ! Thank you for your help
    Is it possible to build a Honor vendor with eluna ?

  17. #13
    stoneharry's Avatar Moderator Harry

    Authenticator enabled
    Reputation
    1613
    Join Date
    Sep 2007
    Posts
    4,554
    Thanks G/R
    151/146
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by shahin View Post
    It was really great ! Thank you for your help
    Is it possible to build a Honor vendor with eluna ?
    I don't see why not: Eluna API

  18. #14
    shahin's Avatar Member
    Reputation
    1
    Join Date
    Feb 2020
    Posts
    9
    Thanks G/R
    4/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for taking the time for me.
    i cant find it .
    Can you write an example ?
    item buy and decrease 1000 honor

Similar Threads

  1. [Request] PvP kill reward system for healers [Need help]
    By eleon8 in forum WoW EMU Questions & Requests
    Replies: 1
    Last Post: 05-15-2019, 12:40 PM
  2. I want to buy PVP rating need help
    By rwolfe1988 in forum WoW PvP & Battlegrounds
    Replies: 2
    Last Post: 04-21-2015, 01:26 PM
  3. [Buying] I want to buy PVP rating need help
    By rwolfe1988 in forum World of Warcraft Buy Sell Trade
    Replies: 1
    Last Post: 04-15-2015, 06:32 AM
  4. I need help T.T with pvp trigger things
    By Tankotron in forum World of Warcraft Emulator Servers
    Replies: 0
    Last Post: 09-09-2007, 03:21 PM
All times are GMT -5. The time now is 04:00 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search