ArcEmu: Group Reward - ArcEmu

Jump to content

Toggle shoutbox Lastest Announcements

dfighter  : (07 December 2014 - 12:06 PM) Arcemu is in hibernation mode, please read http://arcemu.org/fo...showtopic=26903
dfighter  : (01 January 2013 - 05:56 PM) Arcemu wishes you all a happy new year!
Hasbro  : (12 September 2012 - 10:01 AM) Please excuse our outage from the web! Our web host had a major malfunction!
dfighter  : (01 September 2012 - 04:05 PM) Since the spam bots just don't want to stop, I've enabled admin verification when registering.
dfighter  : (23 January 2012 - 09:56 PM) Please note that from now on you will need to confirm your email on the wiki in order to edit it!
Hasbro  : (31 December 2011 - 12:50 PM) Happy New Years all!
Navid  : (26 December 2011 - 04:09 AM) Merry Christmas !!!!!! Happy holidays all :)
WAmadeus  : (24 December 2011 - 03:54 PM) Merry Christmas to all!
dfighter  : (24 December 2011 - 11:05 AM) The Arcemu team wishes y'all a Merry Christmukkah!
Hasbro  : (05 October 2011 - 12:53 PM) Looking for web designers for upcoming web related project. If you're interested in designing user interfaces contact me
dfighter  : (02 September 2011 - 03:47 PM) So who here wants vehicles in Arcemu? :P http://arcemu.org/fo...showtopic=25440
Hasbro  : (14 August 2011 - 03:25 PM) Join us on irc, grab an irc client and connect to irc.freenode.net join channel #arcemu /server irc.freenode.net:6667 /join #arcemu
jackpoz  : (03 August 2011 - 05:33 AM) to all Lua Engine (old one) users: please check http://arcemu.org/fo...showtopic=25274
Hasbro  : (20 May 2011 - 05:27 PM) Looking for people experienced with CMake configuration and setup! Contact me asap
Hasbro  : (15 May 2011 - 05:03 PM) ArcEmu is recruiting C++ programmers, contact Hasbro if interested.
paroxysm  : (03 May 2011 - 06:26 PM) Updated luabridge gossip example to describe the whole gossip creation process rather than just how to create menu. Gossip tutorial
paroxysm  : (23 April 2011 - 11:35 AM) Lua writers can refer to the Luabridge Tutorials section in the Wiki to learn how to write gossip code correctly.
Hasbro  : (20 April 2011 - 05:22 PM) Thank you for your continuous contribution of bug reports, we are working on them.
Hasbro  : (17 April 2011 - 03:20 AM) Please consider donating to support our bills. Donations can be sent using PayPal to donations@arcemu.org - Thank you for your support.
paroxysm  : (10 April 2011 - 12:43 AM) Refer to the Luabridge Tutorials section in the Wiki to learn the new syntax of luabridge.
Resize Shouts Area

Labels

Make sure when posting a help or release topic you put [c++] or [lua] BEFORE your topic title!
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Group Reward Rewarding Assist

#1 User is offline   nucle0 

  • Newbie
  • Group: Members
  • Posts: 7
  • Joined: 02-August 14
  • IRC:nucle0
  • Gender:Male
  • Location:Romania
  • Server OS:Windows

Posted 08 August 2014 - 05:49 AM

Hello

I try to make a custom server related on battlegrounds and so far I managed to award the killer with gold and xp but i was thinking about assisters like healer who need also xp and gold.

for kills I used the second server hook : SERVER_HOOK_KILL_PLAYER = 2
and it worked but for assists I tryed to use the UnitEvent and unfortunetly is not working :(, this is my file for assist script

on_assist.lua
*************************
local Unit=8888880

function On_Assist(pUnit, event, pAssistTarget)
pUnit:DealGoldMerit(30000)
pUnit:GiveXp(5000)
Unit=pUnit:GetEntry()
end

RegisterUnitEvent(Unit,14,"On_Assist")
*************************

I initialized Unit with an existing npc id cuz otherwise it would give me error cuz i will say it will be nil when i try to register event, so i tought it will go trough function anyway and it will change it, still doesn't work.

I was thinking to use: SERVER_HOOK_PRE_DIE = 28 --(event, pKiller, pDied) and inside that function to return all players who did threat to Pdied whit this :GetAITargets()--Returns all units with threat on the Unit's threat table. but as i saw on http://arcemu.org/wi...ua_GetAITargets ::-->>
NOTICE: This command is NOT working in ArcEmu's Lua Engine. Also if it would work i don;t even know how to go trough all that table and reward each unit on it.

I hope you guys have an ideea of what i need and mby you can help me or mby i did smth wrong and you can spot my mistakes.
I hope to hear neews from you soon!

Thanks!

Did at least any1 tested the UNIT_EVENT_ON_ASSIST_TARGET_DIED = 14 --(pUnit, event, pAssistTarget) ? Is it working for any1 ?
0

#2 User is offline   Satanail 

  • Enthusiast
  • PipPipPip
  • Group: Members
  • Posts: 150
  • Joined: 11-March 12
  • Gender:Male
  • Location:Absurdistan
  • Server OS:Windows

Posted 08 August 2014 - 06:57 AM

"UNIT_EVENT_ON_ASSIST_TARGET_DIED = 14 --(pUnit, event, pAssistTarget)" will not help you in this case because this is an event, registered by npc ID. And in the pvp script mentioned you don't have any npc involved.
The best you can do with LUA is to use SERVER_HOOK_KILL_PLAYER and check weather the in range players are the same team as the killer and are they in combat. Maybe also check the selection of all in range players. I tried to return the killed player threat list but it does not work. Maybe it is reset before the server hook is activated or something. Otherwise this script would have been easy and would have worked perfectly.
0

#3 User is offline   nucle0 

  • Newbie
  • Group: Members
  • Posts: 7
  • Joined: 02-August 14
  • IRC:nucle0
  • Gender:Male
  • Location:Romania
  • Server OS:Windows

Posted 08 August 2014 - 08:28 AM

View PostSatanail, on 08 August 2014 - 06:57 AM, said:

"UNIT_EVENT_ON_ASSIST_TARGET_DIED = 14 --(pUnit, event, pAssistTarget)" will not help you in this case because this is an event, registered by npc ID. And in the pvp script mentioned you don't have any npc involved.
The best you can do with LUA is to use SERVER_HOOK_KILL_PLAYER and check weather the in range players are the same team as the killer and are they in combat. Maybe also check the selection of all in range players. I tried to return the killed player threat list but it does not work. Maybe it is reset before the server hook is activated or something. Otherwise this script would have been easy and would have worked perfectly.




That's why i was thinking to use SERVER_HOOK_PRE_DIE = 28 cuz I didn't wanted to lose any infos about anyone, i also tought long time ago about you sayed "check weather the in range players are the same team as the killer and are they in combat" but I considered this like a expoit breche if the killer is close to the graveyard (IPOTHETIC) and his mates are afk-ing in graveyard and somehow they are hited with spells like blizzard (i mean aoe spells, they will all be in combat), but the point is that their teamats are afk-ing and they will get xp and gold cuz they met the creteria of being in range and being in combat. I thought in many ways how to deal with it but giving xp and money to every1 close and in combat is not very professional and it's not very acurate it's gonna be a mass gain xp, even for players that didn;t contribuite to kill. I apreciate your effort and your idea thx a lot sir :)
0

#4 User is offline   Satanail 

  • Enthusiast
  • PipPipPip
  • Group: Members
  • Posts: 150
  • Joined: 11-March 12
  • Gender:Male
  • Location:Absurdistan
  • Server OS:Windows

Posted 08 August 2014 - 08:41 AM

I'm not even sure if you can get the player threat list via LUA command. I've tried to also script something with SERVER_HOOK_PRE_DIE a while ago and the hook got triggered many times during a single fight. Guess it calculates weather there is a chance that the unit will get killed with the current melle/spell attack and can trigger several times due to that reason.
0

#5 User is offline   nucle0 

  • Newbie
  • Group: Members
  • Posts: 7
  • Joined: 02-August 14
  • IRC:nucle0
  • Gender:Male
  • Location:Romania
  • Server OS:Windows

Posted 09 August 2014 - 05:52 AM

View PostSatanail, on 08 August 2014 - 08:41 AM, said:

I'm not even sure if you can get the player threat list via LUA command. I've tried to also script something with SERVER_HOOK_PRE_DIE a while ago and the hook got triggered many times during a single fight. Guess it calculates weather there is a chance that the unit will get killed with the current melle/spell attack and can trigger several times due to that reason.


Triggering that hook more than 1 time in a fight is not good for me *_*. Thx for info, i'll think about another ideea...
Anyone who have ideeas related to the topic pls feel free to share.
Thx for your support :)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users