Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

Reply
 
Thread Tools Display Modes
  #1  
Old 09-24-2008, 08:59 AM
seveianrex
Sarnak
 
Join Date: Sep 2008
Location: asdf
Posts: 60
Default Project Illusion AA

Hello. Here is my completed Project Illusion AA code. I have tested it. I apologize for not having that nifty .patch format but I couldn't get WinMerge to work :P

{spdat.h}
At bottom of file, add:
Code:
bool IsPlayerIllusionSpell(int16 spell_id); // seveian 2008-09-23
{spdat.cpp}
At bottom of file, add:
Code:
// seveian 2008-09-23
bool IsPlayerIllusionSpell(int16 spell_id) {
	return (spells[spell_id].effectdescnum == 49);
}
{AA.h}
In the enum aaEffectType, add a new item
Code:
aaEffectProjectIllusion // seveian 2008-09-23
{AA.cpp}
in the void Client::HandleAAAction(aaID activate), locate the switch(caa->action) and add the following case statement
Code:
		// seveian 2008-09-23
		case aaActionProjectIllusion:
			EnableAAEffect(aaEffectProjectIllusion, 3600);
			Message(10, "The power of your next illusion spell will flow to your grouped target in your place.");
			break;
{spells.cpp}
in the bool Mob:etermineSpellTargets, after the line "bodyType target_bt = BT_Humanoid;", add the following (NOTE: The switch I ended off with in my snippet above should _REPLACE_ the existing switch.)
Code:
	SpellTargetType targetType = spells[spell_id].targettype;

	// seveian 2008-09-23
	if(IsPlayerIllusionSpell(spell_id)
		&& !spell_target // null ptr crash safeguard
		&& !spell_target->IsNPC() // still self only if NPC targetted
		&& IsClient()
		&& IsGrouped() // still self only if not grouped
		&& CastToClient()->CheckAAEffect(aaEffectProjectIllusion)){
			targetType = ST_GroupClient;
	}

	switch (targetType)
In bool Mob::SpellFinished, after this snippet:
Code:
	//range check our target, if we have one and it is not us
	float range = spells[spell_id].range;
	if(IsClient() && CastToClient()->TGB() && IsTGBCompatibleSpell(spell_id) && IsGroupSpell(spell_id))
		range = spells[spell_id].aoerange;
	range = GetActSpellRange(spell_id, range);
Add this:
Code:
	// seveian 2008-09-23
	if(IsPlayerIllusionSpell(spell_id)
		&& IsClient()
		&& CastToClient()->CheckAAEffect(aaEffectProjectIllusion)){
		range = 100;
	}
After this snippet:
Code:
	//
	// solar: Switch #2 - execute the spell
	//
	switch(CastAction)
	{
		default:
		case CastActUnknown:
		case SingleTarget:
		{
			if(spell_target == NULL) {
				mlog(SPELLS__CASTING, "Spell %d: Targeted spell, but we have no target", spell_id);
				return(false);
			}
			SpellOnTarget(spell_id, spell_target);
Add this (before the break):

Code:
			// seveian 2008-09-23
			if(IsPlayerIllusionSpell(spell_id)
			&& IsClient()
			&& CastToClient()->CheckAAEffect(aaEffectProjectIllusion)){
				CastToClient()->DisableAAEffect(aaEffectProjectIllusion);
			}
Reply With Quote
  #2  
Old 09-26-2008, 11:43 PM
seveianrex
Sarnak
 
Join Date: Sep 2008
Location: asdf
Posts: 60
Default

Sorry, need to post a change to this:

in {spells.cpp}

The line:
Code:
&& !spell_target // null ptr crash safeguard
Is supposed to read:
Code:
&& spell_target != NULL // null ptr crash safeguard
Reply With Quote
Reply


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 06:01 AM.


 

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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3