[Request] Lua Function: Cast(Target, SpellID) [Working]
Moderator: Team Members
-
bolly
- Retired
- Posts: 389
- Joined: Mon Sep 21, 2009 3:03 pm
- Location: Leeds, UK
[Request] Lua Function: Cast(Target, SpellID) [Working]
Cast(Target, SpellID) - Casts a spell on the target
We need to be able to have effects on items that can take use of spells remove() at the end of the spell duration. Ie to remove the effect that the item has placed on them. Spells seem like the best way to implement this to me?
We need to be able to have effects on items that can take use of spells remove() at the end of the spell duration. Ie to remove the effect that the item has placed on them. Spells seem like the best way to implement this to me?
Last edited by bolly on Mon Dec 07, 2009 6:52 am, edited 1 time in total.
-
LethalEncounter
- Team: Zombie
- Posts: 2717
- Joined: Wed Jul 25, 2007 10:10 pm
Re: [Request] Lua Function: Cast(Target, SpellID)
Added as CastSpell(Target, SpellID, SpellTier, Caster), spell tier and caster are optional but if not given spell tier will default to 1 and caster will default to the target.
-
bolly
- Retired
- Posts: 389
- Joined: Mon Sep 21, 2009 3:03 pm
- Location: Leeds, UK
Re: [Request] Lua Function: Cast(Target, SpellID)
Omg sweet! Can't wait for the co tommorow
-
LethalEncounter
- Team: Zombie
- Posts: 2717
- Joined: Wed Jul 25, 2007 10:10 pm
Re: [Request] Lua Function: Cast(Target, SpellID)
Its in tonights release as well although I haven't tested it yet
It *should* work though if you want to try it.
-
bolly
- Retired
- Posts: 389
- Joined: Mon Sep 21, 2009 3:03 pm
- Location: Leeds, UK
Re: [Request] Lua Function: Cast(Target, SpellID)
Works!!! Sweet!
I tested it out with flaming embrace from the other thread and it works a charm but for some bizarre reason it needed a target still. Which is great cause I was wondering how the item was going to get the target for non-self only spells.
The question now is why did it want a target if CastSpell had Player as the target?! I don't care as this will work nice for me but I thought i'd mention it
Thanks again LE you rock to give us both these two functions in one update
I tested it out with flaming embrace from the other thread and it works a charm but for some bizarre reason it needed a target still. Which is great cause I was wondering how the item was going to get the target for non-self only spells.
The question now is why did it want a target if CastSpell had Player as the target?! I don't care as this will work nice for me but I thought i'd mention it
Thanks again LE you rock to give us both these two functions in one update
Code: Select all
function used(Item, Player)
CastSpell(Player, 12)
end-
LethalEncounter
- Team: Zombie
- Posts: 2717
- Joined: Wed Jul 25, 2007 10:10 pm
Re: [Request] Lua Function: Cast(Target, SpellID)
Hmm, that is strange. Did it not cast at all or did it give you an error message? If so, what message did it say?bolly wrote:Works!!! Sweet!
I tested it out with flaming embrace from the other thread and it works a charm but for some bizarre reason it needed a target still. Which is great cause I was wondering how the item was going to get the target for non-self only spells.
The question now is why did it want a target if CastSpell had Player as the target?! I don't care as this will work nice for me but I thought i'd mention it
-
LethalEncounter
- Team: Zombie
- Posts: 2717
- Joined: Wed Jul 25, 2007 10:10 pm
Re: [Request] Lua Function: Cast(Target, SpellID)
Nevermind, I got it fixed. It was just trying to use the caster's target regardless. Btw to answer your previous question, to proc an item's spell on the players target (or himself if no target) you could do something like this:
Target = GetTarget(Spawn)
if Target ~= nil then
CastSpell(Target, 12, 1, Spawn)
else
CastSpell(Spawn, 12)
end
Target = GetTarget(Spawn)
if Target ~= nil then
CastSpell(Target, 12, 1, Spawn)
else
CastSpell(Spawn, 12)
end
-
bolly
- Retired
- Posts: 389
- Joined: Mon Sep 21, 2009 3:03 pm
- Location: Leeds, UK
Re: [Request] Lua Function: Cast(Target, SpellID)
That's wonderful mate cheers for the heads up on GetTarget()!
This opens so many possibilities its unreal! My levitation spell and hp buffs are working perfectly!
This opens so many possibilities its unreal! My levitation spell and hp buffs are working perfectly!
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
Re: [Request] Lua Function: Cast(Target, SpellID)
My question is, how come Bolly can get so many spells working and we cannot?
~grin~
~runs~
~hides~
Nice work, both of ya.
~grin~
~runs~
~hides~
Nice work, both of ya.
-
bolly
- Retired
- Posts: 389
- Joined: Mon Sep 21, 2009 3:03 pm
- Location: Leeds, UK
Re: [Request] Lua Function: Cast(Target, SpellID)
kick some ass john!!
Who is online
Users browsing this forum: No registered users and 1 guest