Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

Reply
 
Thread Tools Display Modes
  #1  
Old 10-05-2009, 04:06 PM
nilbog
Hill Giant
 
Join Date: Nov 2007
Posts: 198
Default

All the credit for this comes from Ladoth, from project 1999, not myself :o
Here is how we have it set up. Still more work to be done when we hit kunark.. because there are full duration invisibilities, but I hope this helps you out!


around line 100 in spdat.cpp

Code:
///////////////////////////////////////////////////////////////////////////////
// spell property testing functions

// @LADOTH 07182009 Is invis type spell
bool IsInvisibilitySpell(int16 spell_id)
{
	bool bResult = false;

	if( IsValidSpell(spell_id) && 
		(IsEffectInSpell(spell_id, SE_Invisibility) ||
		 IsEffectInSpell(spell_id, SE_Invisibility2) ||
		 IsEffectInSpell(spell_id, SE_InvisVsAnimals) ||
		 IsEffectInSpell(spell_id, SE_InvisVsUndead) ||
		 IsEffectInSpell(spell_id, SE_InvisVsUndead2))
		 )
	{
		bResult = true;
	}

	return bResult;
}
around line 610 of spdat.h

Code:
#endif
// @LADOTH 07182009 Is invis type spell
bool IsInvisibilitySpell(int16 spell_id);
bool IsTargetableAESpell(int16 spell_id);
around line 500 in spell_effects.cpp

Code:
#ifdef SPELL_EFFECT_SPAM
				snprintf(effect_desc, _EDLEN, "Invisibility");
#endif
				// solar: TODO already invis message and spell kill from SpellOnTarget
				SetInvisible(true);
				// @LADOTH 07252009 randomize time remaining for invis type spell
				float randscale = MakeRandomInt(1, 100) / 100.0f;
				buffs[buffslot].ticsremaining *= randscale;
around line 520 in spell_effects.cpp

Code:
#ifdef SPELL_EFFECT_SPAM
				snprintf(effect_desc, _EDLEN, "Invisibility to Animals");
#endif

				// @LADOTH 07252009 randomize time remaining for invis type spell
				float randscale = MakeRandomInt(1, 100) / 100.0f;
				buffs[buffslot].ticsremaining *= randscale;
around line 540 in spell_effects.cpp

Code:
#ifdef SPELL_EFFECT_SPAM
				snprintf(effect_desc, _EDLEN, "Invisibility to Undead");
#endif
				// @LADOTH 07252009 randomize time remaining for invis type spell
				float randscale = MakeRandomInt(1, 100) / 100.0f;
				buffs[buffslot].ticsremaining *= randscale;
Reply With Quote
  #2  
Old 10-05-2009, 04:19 PM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

Honestly you were overthinking it just a bit.

Easiest and most accurate implementation:

on tic if tics > 2 then a % chance to reduce tics to 2 and update buffduration client side.
Reply With Quote
  #3  
Old 10-05-2009, 04:30 PM
So_1337
Dragon
 
Join Date: May 2006
Location: Cincinnati, OH
Posts: 689
Default

Is that reply to Ladoth's code, or to Null's variation that I've been working on, KLS? If in regards to Null's, I actually liked that casting skill level (comparative to the skill cap) played a role in his version, and he also included the various "You feel yourself starting to appear" messages for the different invisibility types and gave two tics from that point before it faded. The only part I disagreed with was that he'd had them yellow originally (message type 15), and I seem to remember them being red.

However, this was all commented out of the TZVZ code as "needs work", and Ladoth seems to have a working version active on Project 1999. Working beats non-working any day =)

Either way, thanks for looking over this, KLS, and thanks for the alternate idea, backwards goblin. I do intend to keep hammering away at this, and all of these ideas really help.
Reply With Quote
  #4  
Old 10-05-2009, 05:12 PM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

The first mostly, the 2nd implementation has it's own problems as well.
Reply With Quote
  #5  
Old 10-06-2009, 02:39 AM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

Hopefully you don't mind that I sorta hijacked this too much. Should be implemented tonight though.
Reply With Quote
  #6  
Old 10-06-2009, 08:17 AM
So_1337
Dragon
 
Join Date: May 2006
Location: Cincinnati, OH
Posts: 689
Default

Haha, not at all. I know you're very skilled and spread too thin, so if anything, thank you for taking time away from your other projects to check this out. I'll pull the latest code and give it a look, I'm sure I can learn a lot from it.

Besides, you have pretty high standards for what goes in (as well you should, same as anyone else who contributes). I'd much rather save my first true submission for when I can give a diff for something better than a hack job =P And don't take that as any insult to Null's code, it's self-directed, haha.
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 01:30 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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3