ArcEmu: Select Location? - 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

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

Select Location?

#1 User is offline   avatarscape 

  • Member
  • Pip
  • Group: Members
  • Posts: 18
  • Joined: 30-September 08

Posted 07 June 2011 - 12:18 PM

Hi,
What I want is for LUA to trigger something like this:
http://www.wowhead.com/spell=6757
So when for instance a gossip option is clicked, the cursor is set, and then handling it.
How is this handled? I've tried finding it in the documentation (setting cursor etc) but I'm not sure what it would be called;
Thanks in advance

I don't think I was quite clear enough;
What I'm trying to do, is get the AoE target for a spell using the server hook 10 (Spell Cast).
Is this possible in LUA?
0

#2 User is offline   dfighter 

  • Titles are overrated
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Administrator
  • Posts: 5,189
  • Joined: 14-June 08
  • IRC:dfighter
  • Gender:Male
  • Server OS:Linux

Posted 07 June 2011 - 01:08 PM

You were pretty clear tbh, it's just probably no one knew the answer, the only two people who'd really know this is Hypersniper and Paroxysm since they work with the Lua engines.
I bet when they see your post they will reply :P
"The demand for free goods is infinite."
0

#3 User is offline   QQrofll 

  • Member
  • Pip
  • Group: Members
  • Posts: 11
  • Joined: 07-June 11
  • IRC:QQrofl
  • Gender:Male
  • Location:Tennessee
  • Server OS:Windows

Posted 07 June 2011 - 01:38 PM

This actually seems like a very bright idea; I never noticed that spell even existing until now, good luck. I might tinker with it some too. :D
I can see no knowledge in you.
0

#4 User is offline   avatarscape 

  • Member
  • Pip
  • Group: Members
  • Posts: 18
  • Joined: 30-September 08

Posted 25 June 2011 - 04:38 PM

Honestly, No dev knows if/how this is possible? :S
0

#5 User is offline   dfighter 

  • Titles are overrated
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Administrator
  • Posts: 5,189
  • Joined: 14-June 08
  • IRC:dfighter
  • Gender:Male
  • Server OS:Linux

Posted 25 June 2011 - 04:46 PM

It's probably just not possible, seeing how the client presents you the targeting cursor for spells before casting them, using a hook that is used AFTER the cast itself it just way too late...
"The demand for free goods is infinite."
0

#6 User is offline   salamanda 

  • Enthusiast
  • PipPipPip
  • Group: Members
  • Posts: 161
  • Joined: 10-July 08

Posted 26 June 2011 - 04:13 AM

It is possible because I've played on a server that used dummy spells so that when you click an item -> you cursor changes -> a object is placed where you click. In later versions they even changed it so that the cursor is changed from the green circle to the actual object you want to place.

However, it used a custom AddOn and MPQ edit for the server, so it was probably handled client side, sending a packet to the server requesting for the object to be placed or something?
0

#7 User is offline   hypersniper 

  • Advanced Member
  • Group: Retired
  • Posts: 227
  • Joined: 21-November 08
  • Gender:Male

Posted 26 June 2011 - 05:10 AM

Yeah, this is not possible in Lua at the moment, but if you scripted it C++ side, I believe the coordinates of a targetted AoE spell are stored in spell->m_target->m_destX, Y and Z, where spell is the spell object provided by the server hook ON_CAST_SPELL.

Eventually I will try to get these extra spell properties exposed Lua side :blink:
Please don't PM me asking to fix, correct or look-over your scripts. Please post a new thread in the Lua Scripting section so others can learn and help.
0

#8 User is offline   avatarscape 

  • Member
  • Pip
  • Group: Members
  • Posts: 18
  • Joined: 30-September 08

Posted 04 July 2011 - 01:29 PM

Will this work:
bool LuaHookOnCastSpell(Player * pPlayer, SpellEntry* pSpell, Spell* spell)
{
	int[] dest = {spell->m_targets.m_destX,spell->m_targets.m_destY,spell->m_targets.m_destZ};
	if(lua_instance == NULL) return true;
	GET_LOCK;
	PLUA_INSTANCE ref = lua_instance.get();
	bool result = true;
	std::pair< li::HookFRefMap::iterator,li::HookFRefMap::iterator> hooks = ref->m_hooks.equal_range(SERVER_HOOK_EVENT_ON_CAST_SPELL);
	for(; hooks.first != hooks.second; ++hooks.first)
	{
		lua_engine::BeginLuaFunctionCall(hooks.first->second);
		push_int(SERVER_HOOK_EVENT_ON_CAST_SPELL);
		push_player(pPlayer);
		push_int(pSpell->Id);
		push_spell(spell);
		push_int(dest[0]);
		push_int(dest[1]);
		push_int(dest[2]);

0

#9 User is offline   dfighter 

  • Titles are overrated
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Administrator
  • Posts: 5,189
  • Joined: 14-June 08
  • IRC:dfighter
  • Gender:Male
  • Server OS:Linux

Posted 04 July 2011 - 01:57 PM

View Postavatarscape, on 04 July 2011 - 01:29 PM, said:

Will this work:
bool LuaHookOnCastSpell(Player * pPlayer, SpellEntry* pSpell, Spell* spell)
{
	int[] dest = {spell->m_targets.m_destX,spell->m_targets.m_destY,spell->m_targets.m_destZ};
	if(lua_instance == NULL) return true;
	GET_LOCK;
	PLUA_INSTANCE ref = lua_instance.get();
	bool result = true;
	std::pair< li::HookFRefMap::iterator,li::HookFRefMap::iterator> hooks = ref->m_hooks.equal_range(SERVER_HOOK_EVENT_ON_CAST_SPELL);
	for(; hooks.first != hooks.second; ++hooks.first)
	{
		lua_engine::BeginLuaFunctionCall(hooks.first->second);
		push_int(SERVER_HOOK_EVENT_ON_CAST_SPELL);
		push_player(pPlayer);
		push_int(pSpell->Id);
		push_spell(spell);
		push_int(dest[0]);
		push_int(dest[1]);
		push_int(dest[2]);



Did you not read these replies?

View Postdfighter, on 25 June 2011 - 04:46 PM, said:

It's probably just not possible, seeing how the client presents you the targeting cursor for spells before casting them, using a hook that is used AFTER the cast itself it just way too late...



View Postsalamanda, on 26 June 2011 - 04:13 AM, said:

It is possible because I've played on a server that used dummy spells so that when you click an item -> you cursor changes -> a object is placed where you click. In later versions they even changed it so that the cursor is changed from the green circle to the actual object you want to place.

However, it used a custom AddOn and MPQ edit for the server, so it was probably handled client side, sending a packet to the server requesting for the object to be placed or something?


...or are you just dealing with the client later? :lol:
"The demand for free goods is infinite."
0

#10 User is offline   avatarscape 

  • Member
  • Pip
  • Group: Members
  • Posts: 18
  • Joined: 30-September 08

Posted 04 July 2011 - 02:24 PM

This is wrong; AoE's are used to detect the position on the server side. Just think about it; This is simply adding it to the hook to get the position.
0

#11 User is offline   dfighter 

  • Titles are overrated
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Administrator
  • Posts: 5,189
  • Joined: 14-June 08
  • IRC:dfighter
  • Gender:Male
  • Server OS:Linux

Posted 04 July 2011 - 02:35 PM

View Postavatarscape, on 04 July 2011 - 02:24 PM, said:

This is wrong; AoE's are used to detect the position on the server side. Just think about it; This is simply adding it to the hook to get the position.

Yes but the client sends the position that you targeted with the cursor.... your original problem was that you didn't know how to get that cursor... That's what we are talking about
"The demand for free goods is infinite."
0

#12 User is offline   avatarscape 

  • Member
  • Pip
  • Group: Members
  • Posts: 18
  • Joined: 30-September 08

Posted 04 July 2011 - 03:05 PM

I know, but m_targets.m_dest* are what the server uses to process AoE's, So...... It should work, I'm going to try. The reason I didn't know how to do it is because this didn't exist in the engine before.
0

#13 User is offline   dfighter 

  • Titles are overrated
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Administrator
  • Posts: 5,189
  • Joined: 14-June 08
  • IRC:dfighter
  • Gender:Male
  • Server OS:Linux

Posted 04 July 2011 - 04:01 PM

View Postavatarscape, on 04 July 2011 - 03:05 PM, said:

I know, but m_targets.m_dest* are what the server uses to process AoE's, So...... It should work, I'm going to try. The reason I didn't know how to do it is because this didn't exist in the engine before.

However that is filled in from the data that the client sends..... Which won't be sent unless you get that cursor and select the location, get it now?
"The demand for free goods is infinite."
0

#14 User is offline   paroxysm 

  • Chatty Cathy
  • Group: Retired
  • Posts: 320
  • Joined: 25-June 08
  • Gender:Male
  • Server OS:Windows

Posted 05 July 2011 - 08:27 AM

I wouldn't recommend that modification because you essentially force it to push coordinates for all spells regardless of whether it's an AoE or not. A more elegant approach would be to retrieve those coords from the Spell* that it pushes to Lua, it would be simply a matter of exposing those members or exposing the whole SpellTargets class and those members.
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