Brainstorming ideas for examine windows (amounts)

EQ2Emulator Development forum.

Moderator: Team Members

Post Reply
User avatar
Ememjr
Team Member
Posts: 975
Joined: Wed Mar 15, 2017 9:41 am
EQ2Emu Server: Perseverance

Brainstorming ideas for examine windows (amounts)

Post by Ememjr » Sun Apr 14, 2019 4:06 am

so when you show an examine window most have things like

inflicts 10-20 cold damage or
Increases Mitigation of caster vs physical damage by 80 ( level 53 toon)
but many things alter these values such as players level on some, other stats on others
so the mitigation one is 1.5 points per level
well the script can easily take care of that and apply the proper amount the examine still shows the amount we put in the spell_display_effects table for that tier

i am thinking and brainstorming for ideas on how we incorporate the amounts being dynamic instead of static on the display to be more like live

my idea parts of it anyway is to have a %i in the effect description line such as Increases Mitigation of caster vs physical damage by %i
the %i then could be populate with the correct value

we could add a column or 2 to the spell_data table that would identify which effect it applied to and the type of adjuster ie Damage, level,healing etc basically any of the stats we have

modifyer = "level"
effect = 1
data is a float at 1.5

when the examine gets to the effects line and it has a %i then it could look in the data portion of spell and determine how to create
gets info for data effect 1 sees the 1.5 adnd that its by level so take the level(53) * 1.5 get 79.5 round it up and send 80 instead of %i

for damage we could have
modifier = "damage"
effect 1
data is value 1 100 value 2 200

then when examine run the Get damage routine you would run when casting the spell but dont cast, just get the 2 return values

needs some thoughts

User avatar
Ememjr
Team Member
Posts: 975
Joined: Wed Mar 15, 2017 9:41 am
EQ2Emu Server: Perseverance

Re: Brainstorming ideas for examine windows (amounts)

Post by Ememjr » Sun Apr 14, 2019 7:20 am

well i have a working tested idea with stats, and it looks fairly easy and so far with no DB alters required
with the code change here but everywhere in code that prints the effects(spells),

Code: Select all

string effect_message;
			if (next_spell->effects[i]->description.length() > 0) {
				effect_message = next_spell->effects[i]->description;
				if (effect_message.find("%t") < 0xFFFFFFFF) {
					if (next_spell->lua_data[i]->string_value == "level") { // rught now only support level but we code support any stat here, 
						float value = stof(next_spell->lua_data[i]->string_value2) * client->GetPlayer()->GetLevel();
						effect_message.replace(effect_message.find("%t"), 2, to_string(value));
					}
				}
				
			}
			packet->setArrayDataByName("next_effect", effect_message.c_str(), i);
and a change to the way spell_data is entered for a dynamic line
our example AA Spell increase defense by .05 per player level per tier
for each tier i entered a string for the type, "level" in value for the catagory of what makes it dynamic, and .05 in value 2

this works but is crude
what i would like to do is add 1 field to spell_dat for dynamic catergory with drop down options to choose what the dynamic data is or a code for level mulitplier or what ever
then the remaining colums filed out like before
this will keep it to 1 spell_data line per spell/tier/index like must are
the key will be if you want a dynamic effect then the effect index must be the same as the spell_data index

tyrbo
Team Member
Posts: 271
Joined: Thu Feb 18, 2016 12:33 pm

Re: Brainstorming ideas for examine windows (amounts)

Post by tyrbo » Sun Apr 14, 2019 3:34 pm

With my code, both spell data and spell effects (and others, but those are the relevant pieces) were modified to scale by level or by tier.
Scaling by tier and by level is optional and configurable for each individual spell data.
Since it's all dynamic, the effects are dynamic too.

So, basically, let's say we have a spell called Fireball.
The spell data for that spell has two entries, one as 1.3, and one as 1.5.

We then take those values, multiply them by level, and you have your damage.
There are some other fields for like flat damage values, so maybe it should have +5 flat damage, then the rest is scaled based on level or tier of the ability.

Now, with effects, rather than saying:

Inflicts 13 - 23 damage on target.

we say:

Inflicts %1 - %2 damage on target.

And much like what you showed below, we search for %1, %2, etc, and replaced them with the dynamically calculated spell data values.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests