View Full Version : Need Help!About "CastCustomSpell" Method in Unit Methods!

08-13-2014, 12:12 PM
i can't sloved the overflow after use "CastCustomSpell" in my lua script
does anywhere has a tutorial about how to use the “CastCustomSpell(in unit methods)” method? like a example lua script?
if you can write a example script,plz help me ..

forgive my bad english

08-13-2014, 02:23 PM
You will need newest Eluna.
Here is an example:

local function OnCommand(event, player, command)
if (command == "ccs") then
player:CastCustomSpell( player:GetSelection() or player, 11, true, 500 )
return false

RegisterPlayerEvent(42, OnCommand)

When using .ccs ingame, you cast spell (triggered) entry 11 (frostbolt) on your target (or yourself if no target).
The spell has spell effect 0 set to &Spell::EffectSchoolDMG, // 2 SPELL_EFFECT_SCHOOL_DAMAGE
I checked this in the DBC files. See http://www.pxr.dk/wowdev/wiki/index.php?title=Spell.dbc#
By default this spell will do damage of 1000 and the basepoints0 are 1000 (999 in DBC file)

The function use here will have bp0 set to 500, so the damage output will be 500.

Read more:

08-13-2014, 05:07 PM
thanks rochet2,i think i can slove my problem.

08-13-2014, 05:45 PM
Future advice: You don't need to put 'Lua' in your title since you're already in the Eluna section. Marking as solved.