Deleveling

Creating the Spells and Abilities for EQ2Emulator

Moderator: Team Members

Post Reply
User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Deleveling

Post by Gangrenous » Sat Jun 04, 2016 1:24 pm

I notice when you de-level you never lose your spells and can cast them at any level. Testing, make yourself level 60, get your spells and then de-level to 1 and you can still cast your 60 spells.
Resident Dirty Hippy

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

Re: Deleveling

Post by Jabantiz » Sat Jun 04, 2016 4:00 pm

I don't think we ever added any support for removing spells, also with EQ2's death penalty it was impossible to loose a level as you never lost xp you just got that debt. Thinking about this would we really want to remove the spells from the player or hide them, cause if they got a level and scribed a master tier spell then lost the level it would suck for them to loose that spell.

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: Deleveling

Post by Gangrenous » Sat Jun 04, 2016 5:35 pm

I will have to on my end, it may not be needed on the official source. Disable the spell that is, not remove it.
Resident Dirty Hippy

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: Deleveling

Post by Gangrenous » Sun Jun 05, 2016 8:36 am

I noticed that when you level it iterates through all your spells and if new ones are found it just adds them.
Does this actually lock a spell from being cast (greys it out)?

Code: Select all

Player::LockSpell(Spell* spell, int16 recast)
If so would this be a viable method of disabling them?
Resident Dirty Hippy

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: Deleveling

Post by Gangrenous » Sun Jun 05, 2016 9:15 am

Okay I got it, just an else statement and moving some code around. I am going to create a rule on my end to disable them on de-leveling. Also on

Code: Select all

ModifySpellStatus(0, 66, true);
What is the significance on the 66 versus -66?
Resident Dirty Hippy

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

Re: Deleveling

Post by Jabantiz » Sun Jun 05, 2016 4:07 pm

Couldn't tell you, 66 is just a magic number that we got from packets to make it work, we haven't been able to figure out anything else outside of the packets, I had assumed it was a bitmask but tests on that a ways back didn't result in anything useful. As for -66 it just removes the value, basically restoring it to default after 66 was used.

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: Deleveling

Post by Gangrenous » Mon Jun 06, 2016 6:35 am

Well I should say this is almost working, almost. The first time I set my level, lets say level 8, I have my level 8 spells and anything higher level shows as disabled. If I set my level again I have all spells. If I set it one more time I have just my level 8 spells. It is strange. I have went through the code twice and nothing is just jumping out at me so I am thinking it is something I am not understanding about the spells. I actually wrote my own routines and left the original routines intact. Basically I am looping through all the spells and checking to see if the player has the spell. If the player has the spell I am disabling the spell when the spell is above his level, otherwise I enable the spell. Thoughts?
Resident Dirty Hippy

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

Re: Deleveling

Post by Jabantiz » Mon Jun 06, 2016 3:49 pm

Off the top of my head I would suggest putting level checks in the spell book packet and if the spell level is higher then the player level skip it so it doesn't show in the spell book, if it doesn't show in the spell book then the player shouldn't be able to cast it. This is just in theory though, as the spell book packet is an update packet by just skipping the spell might not remove it from the spell book.

As for your method, when you use modify it adds the value, so if you are level 9 and do /level 8 it will disable the spells, if you then do /level 7 and you just use modify again with out checking if they are already disable it will add the value on top and probably enable the lvl 9 spells while disabling the lvl 8 spells. That is my best guess at least from what you described.

User avatar
Gangrenous
Posts: 812
Joined: Sun Apr 24, 2016 6:54 am
Characters: Dinsmoor

Re: Deleveling

Post by Gangrenous » Fri Jun 24, 2016 4:23 pm

Jabantiz wrote: putting level checks in the spell book packet a.
Can you give me a quick direction on where to find this? I might revisit this tonight.
Resident Dirty Hippy

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

Re: Deleveling

Post by Jabantiz » Fri Jun 24, 2016 5:46 pm

In player.cpp, this function

Code: Select all

EQ2Packet* Player::GetSpellBookUpdatePacket(int16 version){
The main thing is count needs to be the total number of spells being sent in the packet so you would need to filter out the ones of a higher level first before the if (count > 0)

This is also an update packet so there is no guarantee it will work.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests