Page 2 of 4
Re: CoE Spells Validation
Posted: Sun Nov 24, 2013 3:52 pm
by Jabantiz
I was starting to think the same thing as looping through all equipped items and active spells is just to much. I am currently debating the actual "proc" function in the script as I had the first param as item/spell, however we don't have spells really exposed to lua like we do items. I was trying to keep the functions similar to each other but starting to think they will have to be different. I like your idea of a Proc struct though, I was leaning towards a map<int8, LuaSpell*> when I started thinking about adding the map.
Another question about procs, is there more then offensive/defensive? I seem to remember a proc that will only go off on spell attacks, so that doesn't really fit into offensive. Is that actually in the game still and is there other procs that don't really fit into offensive or defensive?
PS - John, all this proc stuff should probably be broken off into a new topic, maybe in the public forums?
Re: CoE Spells Validation
Posted: Sun Nov 24, 2013 4:03 pm
by thefoof
That's where the proc type portion of the map comes in, you could create many different categories and for things like spell attack, block ect, and just check for them where needed in the code.
Re: CoE Spells Validation
Posted: Sun Nov 24, 2013 5:19 pm
by Jabantiz
This is what I got so far design wise
Lua:
Code: Select all
AddProc(Spawn, (int8)Type, (float)chance, [Item]) --Item only needs to be set if it is a proc from an item
RemoveProc(Spawn, [Item]) -- Again, only set item if it is a proc from an item
proc((Spawn)Caster, (Spawn)Target) -- proc function for a spell, can add lua spell data after if we want
proc(Item, (Spawn)Caster, (Spawn)Target) -- proc function for an item
As for proc types I have come up with this
- Offensive
- Defensive
- Physical Offensive
- Physical Defensive
- Magical Offensive
- Magical Defensive
- Block
- Parry
- Riposte
- Evade
Any other situations you want a proc to go off that I missed?
Re: CoE Spells Validation
Posted: Sun Nov 24, 2013 6:23 pm
by thefoof
On healing spell/on beneficial but looks like a pretty good list to start
Re: Implementing: Procs
Posted: Mon Nov 25, 2013 7:42 am
by John Adams
Split the Procs topic off into it's own.
Re: Implementing: Procs
Posted: Mon Nov 25, 2013 4:13 pm
by Jabantiz
Started coding this and came up with another question, is it possible for a single item/spell to have a proc of different types, so can there be a offensive and defensive proc on the same item/spell?
Re: Implementing: Procs
Posted: Mon Nov 25, 2013 4:28 pm
by xinux
http://eq2.wikia.com/wiki/Proc
Doesn't really answer your question but came across it
Re: Implementing: Procs
Posted: Mon Nov 25, 2013 4:36 pm
by John Adams
"This has all the info you need, unless it doesn't." ~Xinux
PS: I'm done trusting eq2.wikia for anything. That article history: 10:42, November 11, 2007 FzyBot
Re: Implementing: Procs
Posted: Mon Nov 25, 2013 6:13 pm
by thefoof
Took me awhile to find this but I used to have this belt
http://eq2.wikia.com/wiki/Belt_of_Resilience
Re: Implementing: Procs
Posted: Mon Nov 25, 2013 6:23 pm
by thefoof
Also while I'm thinking about it, I think defensive procs can go off on multi attacks as well. Offensive only go off on the first attack. Just to clarify what I said above about triggers.
Re: Implementing: Procs
Posted: Mon Nov 25, 2013 6:53 pm
by John Adams
Ugh, that is kinda swinging the vote for "separated spells" again. Unless the proc implementation can be managed from within the item/spell script itself as discussed.
Re: Implementing: Procs
Posted: Mon Nov 25, 2013 6:57 pm
by Jabantiz
I will pass the type of proc to the lua function so it can be handled in the script. I have noticed a problem however, SpellDamage and SpellHeal functions can only be called from a spell script, so those functions which would probably be the most likely to be used in procs can't be used in item scripts...
Re: Implementing: Procs
Posted: Mon Nov 25, 2013 7:55 pm
by John Adams
I guess you will just have to invent ItemDamage and ItemHeal LUA's then

unless what you mean to say is there's no way for swinging an item, it proc'ing, and interacting with the Spells functions. That would be a bummer.
Re: Implementing: Procs
Posted: Mon Nov 25, 2013 7:58 pm
by Jabantiz
I could make functions like that, was also debating a way to allow SpellDamage/SpellHeal to work for items, going to see if I can get procs working at all in general with a generic Say() for the proc first though.
Another issue I just ran into, items don't have an equip and unequip lua function calls like I thought they did. While this shouldn't be hard to implement I doubt I will be able to get it tested enough to commit tonight like I had originally planned.
Re: Implementing: Procs
Posted: Mon Nov 25, 2013 10:45 pm
by Jabantiz
Added the equipped and unequipped functions for items and got procs working, mostly, here is the test item script I have been using.
Code: Select all
function equipped(Item, Player)
AddProc(Player, 1, 50, Item)
Say(Player, "Equipped")
end
function unequipped(Item, Player)
RemoveProc(Player, Item)
Say(Player, "UnEquiped")
end
function proc(Item, Caster, Target, Type)
Say(Caster, "Proc type: " .. Type)
end
There is a client crash issue with RemoveProc however so I am unable to commit it at this time, hopefully I will have it figured out tomorrow.