Spells: What's Left?

EQ2Emulator Development forum.

Moderator: Team Members

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

Spells: What's Left?

Post by thefoof » Fri Feb 28, 2014 7:33 pm

Making this thread so we can try to establish exactly "what else" we need to do code wise to enable, at least creating totally live-like spells. Obviously the mechanics side stuff that won't depend on DB entries/scripts can wait, a couple things I can think off of the top of my head are:

*Separate value to allow casting while running, but still able to be interrupted through combat - DONE

*"Requires Caster" some buffs with a duration require that you remain near the caster to receive it's benefits, others simply last until the timer runs out (Example : Spirit of the Wolf), these kind of spells also don't show up in the caster's maintained. - DONE

*I think we need support for triggers as well? Forgot about those. - DONE

*Intercept Spells

*Scaling spell levels

*Stoneskin (aborbs all damage, only damage of a certain type, only damage > or < a certain amount)

*AOE Blocks - DONE

*Cast while under control effect - DONE

*Spell resource upkeep



I'd also like us to make a list of what some of the spell values are meant to represent exactly. Example: group spell - kind of vague. I know most spells use this to determine if it's a group buff, but I haven't seen anywhere where we explicitly list what each value is supposed to be for, in all likelihood we have values being used to represent two different things, or totally repetitive values used to do the same thing. Basically I want to get clear definitions for these so we can see what needs to be changed :) and it will make it easier to determine what else to add as well.

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

Re: Spells: What's Left?

Post by Jabantiz » Mon Mar 03, 2014 4:28 pm

Off the top of my head the only thing I can think of is intercept spells.

User avatar
Zcoretri
Team Member
Posts: 1642
Joined: Fri Jul 27, 2007 12:55 pm
Location: SoCal

Re: Spells: What's Left?

Post by Zcoretri » Tue Mar 04, 2014 10:23 am

What about spells that scale as you level? Or is that different than what you are asking here.

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

Re: Spells: What's Left?

Post by thefoof » Fri Mar 07, 2014 10:31 pm

Zcoretri wrote:What about spells that scale as you level? Or is that different than what you are asking here.
That might be something to add to the list, but getting the actual guts of the spell to scale will probably be a pretty big job. One thing I know we're going to have to do eventually in the future is add some kind of formatting for the spell effect descriptions (spell damage amount ect) and that's going to be an absolute nightmare

Notes about my commit just now:
Added: Support for triggers to spells
Added: UI Support for the maintained window elements (uses and damage remaining)
Fixed: a couple possible crashes/deadlocks
Added: LUA function CopySpawnAppearance
Fixed: Spell effects will now correctly be removed from a dead spawn
Added: New proc types (damaged = 15, damaged_melee = 16, damaged_magic = 16)

Here's the syntax/usage for the 4 LUA functions I added:

SetSpellTriggerCount(int16 new_triggercount, [int8] cancel_after_triggers) - First param is self explanatory, it's how many triggers you want to assign to a spell. The second param is a bool, if set to 1 the spell will cancel after all triggers are used. - This must be used in a spell script.

GetSpellTriggerCount() - This returns the current trigger count of the spell. - This must be used in a spell script.

RemoveTriggerFromSpell([int8] remove_amount) - The only param here is just how many triggers you want to remove from this spell, defaults to 1 if not set. - This must be used in a spell script.

CopySpawnAppearance(Spawn* first_spawn, Spawn* second_spawn) - This function will copy the appearance from one spawn to another (model type, colors, appearance gear ect). First param is the spawn you want to copy the appearance to, second param is the spawn you want to copy.

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

Re: Spells: What's Left?

Post by Jabantiz » Mon Mar 10, 2014 11:10 pm

thefoof wrote:*Stoneskin (aborbs all damage, only damage of a certain type, only damage > or < a certain amount)
We may be able to handle this with the ward code. Wards still need to be expanded some but stoneskin is essentially a ward.

Couple more things I stumbled across.

Ability to cast a spell/combat art while stifled or stunned, like Indomitable Will,
Dispels hostile mental effects. This ability can be used while stifled or stunned.
Also a way to flag a mob to be excluded from a true AoE (Blue AE), this one will be simple.

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

Re: Spells: What's Left?

Post by thefoof » Mon Mar 10, 2014 11:50 pm

Jabantiz wrote:Ability to cast a spell/combat art while stifled or stunned, like Indomitable Will,
Dispels hostile mental effects. This ability can be used while stifled or stunned.
Ok will add those to the list, I also just created control effects for fear/roots and will have those committed tomorrow.

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

Re: Spells: What's Left?

Post by thefoof » Thu Mar 13, 2014 3:49 am

New commit.

Fixed: harvest spells should work again
Added: four new control effects to use with lua: Walk Underwater = 7, Moonjump Underwater = 8, Root = 5, Fear = 6
Added: a class to keep track of server control flags on players
Note: Fear only works for players right now
Changed: The target param on the interrupt function is now optional, if this param is not used in a spellscript it will interrupt the spell's targets
Changed: Added a param to AddProc(), if set to 1 AddProc will use the spell's targets


Just a few notes from this, the full new syntax for the two lua functions I changed are Interrupt(Spawn* caster, [Spawn*] target) - the target param being optional there, using spell targets if not set, and AddProc(Spawn* spawn, int8 proc_type, float chance, Item* item, [int8] use_all_spelltargets), if use_all_spelltargets is set to 1 the proc will be added to all spell targets.

Also all of our previous control effects that didn't work right should work fine now, fear I haven't decided how to handle for NPCs yet (for players it just involved sending a control packet). Thinking the best way would be to create a rule that is a filepath to an LUA script and have it called when fear becomes active.


I'll update the wiki for these and the functions from my last commit in the next couple days :D

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

Re: Spells: What's Left?

Post by thefoof » Tue Mar 18, 2014 11:16 pm

=== THIS COMMIT MADE CHANGES TO THE SPELLS TABLE ===


Just committed my code for immunities and casting while under control effects. Here are the two new LUA functions to support this:

AddImmunitySpell(int8 type, [Spawn*] target_overrride)
- The type param is required and is the type of immunity this spell is adding. The target_override param is optional, if used only this param will have the immunity added, otherwise all spell targets will.

RemoveImmunitySpell(int8 type, [Spawn*] target_override) - The type param is required and is the type of immunity this spell function is removing. The target_override param is optional, if used only this param will have the immunity removed, otherwise all spell targets will.

The current type defines are as follows:

IMMUNITY_TYPE_MEZ 1
IMMUNITY_TYPE_STIFLE 2
IMMUNITY_TYPE_DAZE 3
IMMUNITY_TYPE_STUN 4
IMMUNITY_TYPE_ROOT 5
IMMUNITY_TYPE_FEAR 6
IMMUNITY_TYPE_AOE 7


Note: We don't send the immunity packet for the combat text and combat bubble popups, not sure which packet this is. Jab found the packet so I'll add this into my next commit :)


Casting while under control effects uses a new bitmask field called 'casting_flags' in the spells table. Just add these values together for each field you want to enable.

CASTING_FLAG_MEZZED 1
CASTING_FLAG_STIFLED 2
CASTING_FLAG_STUNNED 4
CASTING_FLAG_FEARED 8


Note: If we come across anything else that modifies casting it would be easy to just add another define then all you have to do is code the check in.

Also added were fields in the spells table for 'cast_while_moving', 'not_maintained', and 'persist_through_death'. Just set these fields as value 1 to enable them.

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

Re: Spells: What's Left?

Post by Jabantiz » Tue Mar 25, 2014 4:53 pm

Worked on roots and snares based off of what foof did with control effects. For a root all you need to do is use AddControlEffect

Code: Select all

function cast(Caster, Target)
    AddControlEffect(Target, 5)
end

function remove(Caster, Target)
    RemoveControlEffect(Target, 5)
end
All I did here was make it work on NPC's and check for snares upon removal.

For snares you need to use a new lua function, SetSpellSnareValue(), before you use AddControlEffect.

Code: Select all

function cast(Caster, Target)
    SetSpellSnareValue(37.5)
    AddControlEffect(Target, 11)
end

function remove(Caster, Target)
    RemoveControlEffect(Target, 11)
end
SetSpellSnareValue must be called before or else it won't have an effect, also the value you pass will be the same value you see in the description.

There does seem to be an issue with snares, when removing them the speed isn't always reset, must be a logic error some where but I can't find it. Roots seem to completely work.

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: Spells: What's Left?

Post by John Adams » Wed Mar 26, 2014 7:10 pm

Cool Jab. I've been meaning to ask (and likely did before, knowing me) but is there any way to turn those numerics into readable text? Lots of stuff being added to LUA that is a mystery, and you know no one reads docs :) If 5 = ROOT, maybe using english (enums?) for the values would be less intimidating.

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

Re: Spells: What's Left?

Post by thefoof » Thu Mar 27, 2014 5:08 am

Another commit, this one was pretty light on features.

1. Added three new control effects, flight = 12, 13 = glide, 14 = safefall.

2. Tweaked how spellbonuses are applied so that they don't conflict with eachother on different casts of the same spell. The general rule I added to this though is that only the higher tiered spellbonuses apply (from one cast only if the same tier). The same will need to be done with skills eventually, but not touching that code until we support NPC skills as well.

The rest of the commit was just server side workings, nothing major. Couple more memory fixes ect.

As far as enums John, they could be changed to string params, but that's about all you can do in LUA as everything is treated as a string anyway I believe. If some fool isn't reading docs on the function they're using they can prepare to be intimidated by me regardless :twisted:

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: Spells: What's Left?

Post by John Adams » Thu Mar 27, 2014 12:13 pm

thefoof wrote:If some fool isn't reading docs on the function they're using they can prepare to be intimidated by me regardless :twisted:
Image

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

Re: Spells: What's Left?

Post by Jabantiz » Thu Mar 27, 2014 2:14 pm

Pretty much what foof said, if we did change it from numbers to strings we would also have to go through all scripts and change it as well. The best suggestion I have is a global file with defines the we could include and use the defines, would still require people to know what file to include though so same issue, so lets just let foof deal with them :D

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: Spells: What's Left?

Post by John Adams » Sun Mar 30, 2014 1:51 am

Haha, okay then nevermind :) I just prefer to speak English, not Machine. But realistically, I don't see scripters lining up at the door.

User avatar
Zcoretri
Team Member
Posts: 1642
Joined: Fri Jul 27, 2007 12:55 pm
Location: SoCal

Re: Spells: What's Left?

Post by Zcoretri » Thu Apr 03, 2014 12:46 pm

I try to put comments inside the script to describe what the number means.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest