Implementing: Procs

EQ2Emulator Development forum.

Moderator: Team Members

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: CoE Spells Validation

Post by Jabantiz » Sun Nov 24, 2013 3:52 pm

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?

User avatar
thefoof
Retired
Posts: 630
Joined: Wed Nov 07, 2012 7:36 pm
Location: Florida

Re: CoE Spells Validation

Post by thefoof » Sun Nov 24, 2013 4:03 pm

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.

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: CoE Spells Validation

Post by Jabantiz » Sun Nov 24, 2013 5:19 pm

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?

User avatar
thefoof
Retired
Posts: 630
Joined: Wed Nov 07, 2012 7:36 pm
Location: Florida

Re: CoE Spells Validation

Post by thefoof » Sun Nov 24, 2013 6:23 pm

On healing spell/on beneficial but looks like a pretty good list to start

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Implementing: Procs

Post by John Adams » Mon Nov 25, 2013 7:42 am

Split the Procs topic off into it's own.

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Implementing: Procs

Post by Jabantiz » Mon Nov 25, 2013 4:13 pm

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?

User avatar
xinux
Team Member
Posts: 680
Joined: Wed Mar 10, 2010 11:10 am
Location: Destroyer of Servers

Re: Implementing: Procs

Post by xinux » Mon Nov 25, 2013 4:28 pm

http://eq2.wikia.com/wiki/Proc

Doesn't really answer your question but came across it
EQ II - Build=1360 (Orig) - Build=1360 (DoF) - Build=2654 (KoS) - Build=3375 (Classic) - Build=3554 (EoF)
EQ II - Build=4412 (RoK) - Build=5122 (TSO) - Build=6118 (SF) - Build=7628 (DoV) - Build=8295 (Aod)

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Implementing: Procs

Post by John Adams » Mon Nov 25, 2013 4:36 pm

"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

User avatar
thefoof
Retired
Posts: 630
Joined: Wed Nov 07, 2012 7:36 pm
Location: Florida

Re: Implementing: Procs

Post by thefoof » Mon Nov 25, 2013 6:13 pm

Took me awhile to find this but I used to have this belt http://eq2.wikia.com/wiki/Belt_of_Resilience

User avatar
thefoof
Retired
Posts: 630
Joined: Wed Nov 07, 2012 7:36 pm
Location: Florida

Re: Implementing: Procs

Post by thefoof » Mon Nov 25, 2013 6:23 pm

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.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Implementing: Procs

Post by John Adams » Mon Nov 25, 2013 6:53 pm

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.

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Implementing: Procs

Post by Jabantiz » Mon Nov 25, 2013 6:57 pm

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...

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Implementing: Procs

Post by John Adams » Mon Nov 25, 2013 7:55 pm

I guess you will just have to invent ItemDamage and ItemHeal LUA's then :mrgreen: 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.

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Implementing: Procs

Post by Jabantiz » Mon Nov 25, 2013 7:58 pm

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.

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Implementing: Procs

Post by Jabantiz » Mon Nov 25, 2013 10:45 pm

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.
Last edited by Jabantiz on Wed Nov 27, 2013 1:56 pm, edited 1 time in total.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests