ArcEmu: [lua] Spell Abyssalshatter 69412 - 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

[lua] Spell Abyssalshatter 69412

#1 User is offline   Magnifikator 

  • Interested
  • PipPipPipPip
  • Group: Members
  • Posts: 398
  • Joined: 05-October 11
  • Gender:Male
  • Location:Switzerland
  • Server OS:Windows

Posted 30 September 2012 - 07:19 AM

Looking to the problems I had written in the previous 2 posts, here's the full story:

If you have Enchanting (445) you are able to do the spell AbyssalShatter (69412) that cracks 1 Abyss Crystal (34057) into some random generated amount of either Infinite Dust or Greater Cosmic Essences.
http://old.wowhead.com/spell=69412

At the moment if you apply this spell it only removes you 1 pieces of Abyss Crystal. That's all. And I even don't know who is removing it: the client or the server core.

Because I don't have any idea to do that in the core I tried it in Lua:

However it's a bad hack because it adds the items immediately, not controlling if the spell is runnig till its end. So the player can abort the spell, got the items and have still his piece of crystal :lol:
But my idea with the timer was not working nor the spell methodes I was trying.

-- AbyssalShatter
-- Brechung der Tiefe
-- needs item 34057 Abyss Crystal and 1 Runed Eternium Rod and Requires Enchanting (445)


function Spell_69412(event, pPlayer, SpellId, pSpellObject)
		
	-- Brechung der Tiefe
	if ( SpellId == 69412 ) then

	local rate = 1
	local qty = 0
	local rand = math.random(100)
	
	if ( rand < 35 ) then
		qty = math.random(14)+5
		pPlayer:AddItem(34054, qty*rate)	-- Infinite Dust (max stack 20)
	else
		qty = math.random(4)+1
		pPlayer:AddItem(34055, qty*rate)	-- Greater Cosmic Essences (max stack 10)
	end
	
	print("Abyssal Shatter")


	end

end

RegisterServerHook(SERVER_HOOK_CAST_SPELL, "Spell_69412")

Try out the LoE ArcEmu World database. Please visit dev.LandOfElves.net.

Posted Image


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 30 September 2012 - 08:05 AM

It's always the server that removes stuff.
Also your idea with the timer was working, it was just crashing your server :P
Btw you should use http://wotlk.openwow.com/?spell=69412 instead imo, wowhead has been showing cataclysm data even in the "old.wowhead.com" site, for a very very long time.
"The demand for free goods is infinite."
0

#3 User is offline   Magnifikator 

  • Interested
  • PipPipPipPip
  • Group: Members
  • Posts: 398
  • Joined: 05-October 11
  • Gender:Male
  • Location:Switzerland
  • Server OS:Windows

Posted 30 September 2012 - 08:58 AM

View Postdfighter, on 30 September 2012 - 08:05 AM, said:

It's always the server that removes stuff.
Also your idea with the timer was working, it was just crashing your server :P
Btw you should use http://wotlk.openwow.com/?spell=69412 instead imo, wowhead has been showing cataclysm data even in the "old.wowhead.com" site, for a very very long time.

But on openwow I see less information than on wowhead. But you are right wowhead shows some strange information here. The only way to get the information is to read all the user comments in wowhead.

And the timer idea is also only a hack, because it's using a fixed time.

For me the only correct way would be first to check if the spell is finished and than doing some actions. However I couldn't manage the Lua spell methods.

And the question:
If the server reduces 1 piece, is there already code prepared for exactly this spell ? Or why does the server know that he has to reduce 1 pieces Abyss Crystal and not f. ex. 2 pcs of an apple ?
As I understand this information is NOT saved in the database. Do you check them from the DBC ?
Try out the LoE ArcEmu World database. Please visit dev.LandOfElves.net.

Posted Image


0

#4 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 30 September 2012 - 09:31 AM

View PostMagnifikator, on 30 September 2012 - 08:58 AM, said:

As I understand this information is NOT saved in the database. Do you check them from the DBC ?

Such information usually can be found in the spell.dbc file, since the client needs to know it too ( so it can display it in the tooltip for example ).
"The demand for free goods is infinite."
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