Go Back   EQEmulator Home > EQEmulator Forums > Support > Spell Support

Spell Support Broken Spells? Want them Fixed? Request it here.

Reply
 
Thread Tools Display Modes
  #1  
Old 05-02-2016, 04:16 PM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

Quote:
After testing some more,I found that bard's songs could cause bugs ("you missed a note" instead of "your spell fizzle"), not sure for tanks tomes but better remove it too ..
Not exactly sure what you mean by this statement.


Quote:
Also when you put 65535 as item.class for spells scroll it shows ingame on it with all classes and a bunch of 255 for those that can't use it.
`item`.`classes` is a bitmask of the allowed classes and not an actual class value.

By changing `item`.`class` .. you are altering what classes can 'access' the item..but, not what classes can use the spell. This would explain the '255'
values you are seeing and is not unexpected.

To properly create a bitmask (in this case,) you would take the class id and subtract 1 (since it is a 1-based index,) then left bit-shift 1 by that
amount. Finally, you would bitwise-or each value to attain the final result.

Code:
int final_bitmask = 0;
int warrior_id = 1, warrior_bit = 0;
int paladin_id = 3, paladin_bit = 0;
int shadowknight_id = 5, shadowknight_bit = 0;

warrior_bit = (1 << (warrior_id - 1)); // 1 << 0 = 1
paladin_bit = (1 << (paladin_id - 1)); // 1 << 2 = 4
shadowknight_bit = (1 << (shadowknight_bit - 1)); // 1 << 4 = 16

final_bitmask = (warrior_bit | paladin_bit | shadowknight_bit); // 1 | 4 | 16 = 21

[(final_bitmask == 21) = true]

Code:
update items, spells_new set classes=classes+4096 WHERE
items.scrolleffect = spells_new.id AND
items.classes <> 4096 AND
spells_new.classes13 = 255 AND
items.`Name` LIKE '%spell:%'
Scenario:

`item`.`classes` = 4097 (warrior and magician)

[update triggered because `classes` > 4096]
4097 + 4096 = 8193 (warrior and enchanter)


Also, by setting the item to be usable by class '4096' where `classes13` = 255, you only allow them access to the item, not the spell.

You would need to change `classes13`to a usable level for them to be able to use the actual spell and not just the item.
__________________
Uleat of Bertoxxulous

Compilin' Dirty
Reply With Quote
  #2  
Old 05-03-2016, 02:15 PM
alberto667
Fire Beetle
 
Join Date: Apr 2010
Posts: 4
Default

Sorry it was not very clear, read a foreign language is one thing, writing is another
To sum up, when i tested the code Zaela_S shared, it was what I was looking for ( a way to make spells available to other classes at the appropriate level )
But once in game I had a couple issues like 'you missed a note' as fizzle message when casting spells instead of 'your spell fizzles' ( I thing i read somewhere bard songs could cause that bug ), as well as pet's focus effects not working anymore, so i removed all non caster classes from Zaela's code.
Then it was perfect.

When it came time to change scrolls in game to be writable by all classes, I just put 65535 in the item table for spell scrolls. It worked but you could see all the classes in the description of the scroll with those who cant use it, like war(255),rog(255) etc..

For cosmetic purposes I went with that (bruteforce) method to add the class bitmask, 4096 for mage for example, excluding the spells mages already known and also excluding the spells mages shared with other classes ( like invisibility ) because when I added the bitmask the way i did it messed up those spells.

That solution worked for me, hence the excitement to share it ( I bet you guys write miles of lines of code in a finger snape ), but I couldn't figure out how the class bitmask worked .. Thanks for the help on that Uleat !
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 10:47 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3