Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::Windows Servers

Support::Windows Servers Support forum for Windows EQEMu users.

Reply
 
Thread Tools Display Modes
  #1  
Old 01-03-2014, 02:03 AM
Randymarsh9
Dragon
 
Join Date: Dec 2007
Posts: 658
Default Modifying spells from the source

I have been working on trying to manipulate spells through the source, and I have run into some issues. For now, all of my changes are done through modifying the spell_effects.cpp; however, I would really like to be able to consolidate my changes in the mod_functions.cpp.

I tried to move some of my changes over to the mod_effect_value function in mod_functions, but I cannot get it to work properly. For one, if I do
Code:
IsDamageSpell(spell_id)
, it never returns as true, so I cannot modify damage spells. Additionally, if I do
Code:
IsEffectInSpell(spell_id, SE_DamageShield)
, it will hit that section multiple times and has even caused some zone crashes when checking if the caster was a client in that section.

Finally, in mod_buff_duration, if I make any changes to the "res" variable that is returned, it has strange side effects. For instance, I made a shaman to test out buff durations increased by wisdom, and it worked; however, I noticed that when I cast multiple buffs, they would change each others' values. For instance, a dex buff would put my dex to 97, then a strength buff would put my str to 77 and my dex to 92. Recasting the dex buff would put it back at 97 and my str at 72.

Overall, I am seeing strange behavior from using the spell mod functions in the mod_functions.cpp, and I am curious if anyone has any better suggestions for handling changes to spell effects.
Reply With Quote
  #2  
Old 01-06-2014, 07:50 PM
Randymarsh9
Dragon
 
Join Date: Dec 2007
Posts: 658
Default

About the issue with buff values getting messed up, I believe that is just a client issue. I don't know why it happens, but using #mystats will still display the correct stat values, so I'm not too concerned with that issue.

I did run into another question which I am curious if anyone can answer. I wanted to put in a way to make damage spells only do their normal unmodified damage if the caster was casting the spell on them self. To do this, I stored the original damage, and then after modifying it, I just checked if the caster and target were equal.
Code:
if (caster && caster->GetTarget())
{
     if (caster->GetTarget() == caster)
     {
          effect_value = base_value;
     }
}
This does work; however, the problem I have run into is if you cast a DoT on a monster and then target yourself, it will count you as the target and not the affected monster. Does anyone else know a better way to keep DoTs from doing increased damage to the caster? I only ask because spells like necro conversions are doing really high damage to the caster.
Reply With Quote
  #3  
Old 01-06-2014, 08:42 PM
demonstar55
Demi-God
 
Join Date: Apr 2008
Location: MA
Posts: 1,165
Default

You'd need to keep track of the original target since spell effects are calculated each tick. Although I think this == caster should work?
Reply With Quote
  #4  
Old 08-27-2015, 10:22 PM
Randymarsh9
Dragon
 
Join Date: Dec 2007
Posts: 658
Default

I'm sorry to necro an old thread, but I recently started screwing around with an emulator server again and have recently ran into difficulties using the mod_effect_value function again, namely for heal over time spells.

Here is my rough draft of my mod_effect_value function I have been playing around with to try to iron out bugs.

Code:
int Mob::mod_effect_value(int effect_value, uint16 spell_id, int effect_type, Mob* caster) 
{ 
	if (IsDamageSpell(spell_id) )
	{
		if (!(this == caster))
		{
			effect_value *= (caster->GetINT() / 100.0);
		}
	}
	else if (IsEffectHitpointsSpell(spell_id) || IsHealOverTimeSpell(spell_id))
	{
		effect_value *= (caster->GetWIS() / 100.0);
	}
	else if (IsRuneSpell(spell_id))
	{
		effect_value *= (STA / 100.0);
	}
	return(effect_value); 
}
After some testing, it appears that Nukes, DoTs, lifetaps, and direct heals seem to be working as intended. Also, to get IsDamageSpell to include DoTs as well, I just modified the function like so...
Code:
bool IsDamageSpell(uint16 spellid)
{
	for (int o = 0; o < EFFECT_COUNT; o++) {
		uint32 tid = spells[spellid].effectid[o];
		if ((tid == SE_CurrentHPOnce || tid == SE_CurrentHP || tid == SE_BardAEDot ) &&
				spells[spellid].targettype != ST_Tap && //Removed && spells[spellid].buffduration < 1 after ST_TAP
				spells[spellid].base[o] < 0)
			return true;
	}

	return false;
}
I included that just in case that check was more important than I realized.

My problem is, whenever I cast a heal over time spell, I get the following exception when debugging the zone in Visual Studio
Code:
First-chance exception at 0x01B237A0 in zone.exe: 0xC0000005: Access violation reading location 0x00000000.
Unhandled exception at 0x01B237A0 in zone.exe: 0xC0000005: Access violation reading location 0x00000000.
Also, in the crash log there is the following
(I shortened the path to my executables and source just for clarity since they're long)
Code:
[08-27-2015 :: 21:15:03] [Crash] EXCEPTION_ACCESS_VIOLATION
[08-27-2015 :: 21:15:03] [Crash] SymInit: Symbol-SearchPath: '.;[Path]\EQEmuServer;[Path]\EQEmuServer;C:\Windows;C:\Windows\system32;SRV*C:\websymbols*http://msdl.microsoft.com/download/symbols;', symOptions: 530, UserName: 'Leonard' 
[08-27-2015 :: 21:15:03] [Crash] OS-Version: 6.1.7601 (Service Pack 1) 0x100-0x1 
[08-27-2015 :: 21:15:03] [Crash] [Path]\EQEmuServer\zone.exe:zone.exe (013C0000), size: 19853312 (result: 0), SymType: 'PDB', PDB: '[Path]\EQEmuServer\zone.exe' 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\SysWOW64\ntdll.dll:ntdll.dll (772E0000), size: 1572864 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SysWOW64\ntdll.dll', fileVersion: 6.1.7601.18869 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\syswow64\kernel32.dll:kernel32.dll (75B10000), size: 1114112 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\kernel32.dll', fileVersion: 6.1.7601.18869 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\syswow64\KERNELBASE.dll:KERNELBASE.dll (76100000), size: 290816 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\KERNELBASE.dll', fileVersion: 6.1.7601.18869 
[08-27-2015 :: 21:15:03] [Crash] C:\Perl\bin\perl512.dll:perl512.dll (28000000), size: 1273856 (result: 0), SymType: '-exported-', PDB: 'C:\Perl\bin\perl512.dll', fileVersion: 5.12.4.1205 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\syswow64\USER32.dll:USER32.dll (76190000), size: 1048576 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\USER32.dll', fileVersion: 6.1.7601.17514 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\syswow64\GDI32.dll:GDI32.dll (75A30000), size: 589824 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\GDI32.dll', fileVersion: 6.1.7601.18898 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\syswow64\LPK.dll:LPK.dll (75310000), size: 40960 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\LPK.dll', fileVersion: 6.1.7601.18923 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\syswow64\USP10.dll:USP10.dll (75800000), size: 643072 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\USP10.dll', fileVersion: 1.626.7601.18454 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\syswow64\msvcrt.dll:msvcrt.dll (75490000), size: 704512 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\msvcrt.dll', fileVersion: 7.0.7601.17744 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\syswow64\ADVAPI32.dll:ADVAPI32.dll (75260000), size: 659456 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\ADVAPI32.dll', fileVersion: 6.1.7601.18869 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\SysWOW64\sechost.dll:sechost.dll (759D0000), size: 102400 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SysWOW64\sechost.dll', fileVersion: 6.1.7601.18869 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\syswow64\RPCRT4.dll:RPCRT4.dll (755A0000), size: 983040 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\RPCRT4.dll', fileVersion: 6.1.7601.18912 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\syswow64\SspiCli.dll:SspiCli.dll (74C50000), size: 393216 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\SspiCli.dll', fileVersion: 6.1.7601.18912 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\syswow64\CRYPTBASE.dll:CRYPTBASE.dll (74C40000), size: 49152 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\CRYPTBASE.dll', fileVersion: 6.1.7601.18912 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7601.18837_none_ec86b8d6858ec0bc\COMCTL32.dll:COMCTL32.dll (68790000), size: 540672 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7601.18837_none_ec86b8d6858ec0bc\COMCTL32.dll', fileVersion: 5.82.7601.18837 
[08-27-2015 :: 21:15:03] [Crash] [Path]\EQEmuServer\lua51.dll:lua51.dll (0F640000), size: 356352 (result: 0), SymType: '-exported-', PDB: '[Path]\EQEmuServer\lua51.dll' 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\system32\MSVCR110.dll:MSVCR110.dll (0FBF0000), size: 876544 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\MSVCR110.dll', fileVersion: 11.0.51106.1 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\syswow64\WS2_32.dll:WS2_32.dll (76150000), size: 217088 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\WS2_32.dll', fileVersion: 6.1.7601.17514 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\syswow64\NSI.dll:NSI.dll (75A20000), size: 24576 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\NSI.dll', fileVersion: 6.1.7600.16385 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\system32\VERSION.dll:VERSION.dll (74B20000), size: 36864 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\VERSION.dll', fileVersion: 6.1.7600.16385 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\system32\apphelp.dll:apphelp.dll (73B60000), size: 311296 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\apphelp.dll', fileVersion: 6.1.7601.18777 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\AppPatch\AcLayers.DLL:AcLayers.DLL (5F140000), size: 577536 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\AppPatch\AcLayers.DLL', fileVersion: 6.1.7601.17974 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\syswow64\SHELL32.dll:SHELL32.dll (76290000), size: 12890112 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\SHELL32.dll', fileVersion: 6.1.7601.18762 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\syswow64\SHLWAPI.dll:SHLWAPI.dll (75430000), size: 356352 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\SHLWAPI.dll', fileVersion: 6.1.7601.17514 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\syswow64\ole32.dll:ole32.dll (756A0000), size: 1425408 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\ole32.dll', fileVersion: 6.1.7601.18915 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\syswow64\OLEAUT32.dll:OLEAUT32.dll (758D0000), size: 585728 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\OLEAUT32.dll', fileVersion: 6.1.7601.18679 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\syswow64\USERENV.dll:USERENV.dll (75A00000), size: 94208 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\USERENV.dll', fileVersion: 6.1.7601.17514 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\syswow64\profapi.dll:profapi.dll (75D40000), size: 45056 (result: 0), SymType: '-nosymbols-', PDB: 'C:\Windows\syswow64\profapi.dll', fileVersion: 6.1.7600.16385 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\system32\WINSPOOL.DRV:WINSPOOL.DRV (74AC0000), size: 331776 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\WINSPOOL.DRV', fileVersion: 6.1.7601.17514 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\system32\MPR.dll:MPR.dll (715C0000), size: 73728 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\MPR.dll', fileVersion: 6.1.7600.16385 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\system32\IMM32.DLL:IMM32.DLL (75540000), size: 393216 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\IMM32.DLL', fileVersion: 6.1.7601.17514 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\syswow64\MSCTF.dll:MSCTF.dll (74CC0000), size: 835584 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\MSCTF.dll', fileVersion: 6.1.7601.18731 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\system32\NLAapi.dll:NLAapi.dll (713D0000), size: 65536 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\NLAapi.dll', fileVersion: 6.1.7601.18685 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\system32\napinsp.dll:napinsp.dll (713E0000), size: 65536 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\napinsp.dll', fileVersion: 6.1.7600.16385 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\system32\pnrpnsp.dll:pnrpnsp.dll (71390000), size: 73728 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\pnrpnsp.dll', fileVersion: 6.1.7600.16385 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\System32\mswsock.dll:mswsock.dll (74460000), size: 245760 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\mswsock.dll', fileVersion: 6.1.7601.18254 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\system32\DNSAPI.dll:DNSAPI.dll (71570000), size: 278528 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\DNSAPI.dll', fileVersion: 6.1.7601.17570 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\System32\winrnr.dll:winrnr.dll (713C0000), size: 32768 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\winrnr.dll', fileVersion: 6.1.7600.16385 
[08-27-2015 :: 21:15:03] [Crash] C:\Program Files (x86)\Bonjour\mdnsNSP.dll:mdnsNSP.dll (71360000), size: 135168 (result: 0), SymType: '-exported-', PDB: 'C:\Program Files (x86)\Bonjour\mdnsNSP.dll', fileVersion: 3.0.0.10 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\system32\Iphlpapi.DLL:Iphlpapi.DLL (74260000), size: 114688 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\Iphlpapi.DLL', fileVersion: 6.1.7601.17514 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\system32\WINNSI.DLL:WINNSI.DLL (74250000), size: 28672 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\WINNSI.DLL', fileVersion: 6.1.7600.16385 
[08-27-2015 :: 21:15:03] [Crash] c:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live\WLIDNSP.DLL:WLIDNSP.DLL (71330000), size: 147456 (result: 0), SymType: '-exported-', PDB: 'c:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live\WLIDNSP.DLL', fileVersion: 6.500.3165.0 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\syswow64\PSAPI.DLL:PSAPI.DLL (75D60000), size: 20480 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\syswow64\PSAPI.DLL', fileVersion: 6.1.7600.16385 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\system32\rasadhlp.dll:rasadhlp.dll (73C70000), size: 24576 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\rasadhlp.dll', fileVersion: 6.1.7600.16385 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\System32\wshtcpip.dll:wshtcpip.dll (74450000), size: 20480 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\wshtcpip.dll', fileVersion: 6.1.7600.16385 
[08-27-2015 :: 21:15:03] [Crash] C:\Perl\lib\auto\Cwd\Cwd.dll:Cwd.dll (10000000), size: 20480 (result: 0), SymType: '-exported-', PDB: 'C:\Perl\lib\auto\Cwd\Cwd.dll' 
[08-27-2015 :: 21:15:03] [Crash] C:\Perl\lib\auto\DBI\DBI.dll:DBI.dll (008F0000), size: 98304 (result: 0), SymType: '-exported-', PDB: 'C:\Perl\lib\auto\DBI\DBI.dll' 
[08-27-2015 :: 21:15:03] [Crash] C:\Perl\lib\auto\List\Util\Util.dll:Util.dll (000D0000), size: 28672 (result: 0), SymType: '-exported-', PDB: 'C:\Perl\lib\auto\List\Util\Util.dll' 
[08-27-2015 :: 21:15:03] [Crash] C:\Perl\lib\auto\Filter\Util\Call\Call.dll:Call.dll (00290000), size: 20480 (result: 0), SymType: '-exported-', PDB: 'C:\Perl\lib\auto\Filter\Util\Call\Call.dll' 
[08-27-2015 :: 21:15:03] [Crash] C:\Perl\lib\auto\IO\IO.dll:IO.dll (00320000), size: 24576 (result: 0), SymType: '-exported-', PDB: 'C:\Perl\lib\auto\IO\IO.dll' 
[08-27-2015 :: 21:15:03] [Crash] C:\Perl\site\lib\auto\DBD\mysql\mysql.dll:mysql.dll (00910000), size: 94208 (result: 0), SymType: '-exported-', PDB: 'C:\Perl\site\lib\auto\DBD\mysql\mysql.dll' 
[08-27-2015 :: 21:15:03] [Crash] C:\Perl\site\lib\auto\DBD\mysql\LIBMYSQL.dll:LIBMYSQL.dll (0DBA0000), size: 2375680 (result: 0), SymType: '-exported-', PDB: 'C:\Perl\site\lib\auto\DBD\mysql\LIBMYSQL.dll' 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\system32\WSOCK32.dll:WSOCK32.dll (723B0000), size: 28672 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\WSOCK32.dll', fileVersion: 6.1.7600.16385 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\System32\fwpuclnt.dll:fwpuclnt.dll (741E0000), size: 229376 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\fwpuclnt.dll', fileVersion: 6.1.7601.18283 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\system32\dbghelp.dll:dbghelp.dll (744A0000), size: 962560 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\dbghelp.dll', fileVersion: 6.1.7601.17514 
[08-27-2015 :: 21:15:03] [Crash] [PathToSource]\zone\mod_functions.cpp (137): Mob::mod_effect_value 
[08-27-2015 :: 21:15:03] [Crash] [PathToSource]\zone\spell_effects.cpp (3050): Mob::CalcSpellEffectValue 
[08-27-2015 :: 21:15:03] [Crash] [PathToSource]\zone\spell_effects.cpp (3456): Mob::DoBuffTic 
[08-27-2015 :: 21:15:03] [Crash] [PathToSource]\zone\spell_effects.cpp (3347): Mob::BuffProcess 
[08-27-2015 :: 21:15:03] [Crash] [PathToSource]\zone\client_process.cpp (530): Client::Process 
[08-27-2015 :: 21:15:03] [Crash] [PathToSource]\zone\entity.cpp (481): EntityList::MobProcess 
[08-27-2015 :: 21:15:03] [Crash] [PathToSource]\zone\net.cpp (467): main 
[08-27-2015 :: 21:15:03] [Crash] f:\dd\vctools\crt\crtw32\startup\crt0.c (255): __tmainCRTStartup 
[08-27-2015 :: 21:15:03] [Crash] f:\dd\vctools\crt\crtw32\startup\crt0.c (165): mainCRTStartup 
[08-27-2015 :: 21:15:03] [Crash] ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 75B2337A) 
[08-27-2015 :: 21:15:03] [Crash] 75B2337A (kernel32): (filename not available): BaseThreadInitThunk 
[08-27-2015 :: 21:15:03] [Crash] ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 773192E2) 
[08-27-2015 :: 21:15:03] [Crash] 773192E2 (ntdll): (filename not available): RtlInitializeExceptionChain 
[08-27-2015 :: 21:15:03] [Crash] ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 773192B5) 
[08-27-2015 :: 21:15:03] [Crash] 773192B5 (ntdll): (filename not available): RtlInitializeExceptionChain
Does anyone have an idea what these errors mean other than some filename is not available? I'm just confused why this error only occurs on heal over time spells as well. It seemed to be crashing on the line which causes no issues on regular heals.
Code:
effect_value *= (caster->GetWIS() / 100.0);
Reply With Quote
  #5  
Old 08-27-2015, 10:49 PM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

You really only need about this much of a crash dump:
Code:
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\system32\WSOCK32.dll:WSOCK32.dll (723B0000), size: 28672 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\WSOCK32.dll', fileVersion: 6.1.7600.16385 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\System32\fwpuclnt.dll:fwpuclnt.dll (741E0000), size: 229376 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\fwpuclnt.dll', fileVersion: 6.1.7601.18283 
[08-27-2015 :: 21:15:03] [Crash] C:\Windows\system32\dbghelp.dll:dbghelp.dll (744A0000), size: 962560 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\dbghelp.dll', fileVersion: 6.1.7601.17514 
[08-27-2015 :: 21:15:03] [Crash] [PathToSource]\zone\mod_functions.cpp (137): Mob::mod_effect_value 
[08-27-2015 :: 21:15:03] [Crash] [PathToSource]\zone\spell_effects.cpp (3050): Mob::CalcSpellEffectValue 
[08-27-2015 :: 21:15:03] [Crash] [PathToSource]\zone\spell_effects.cpp (3456): Mob::DoBuffTic 
[08-27-2015 :: 21:15:03] [Crash] [PathToSource]\zone\spell_effects.cpp (3347): Mob::BuffProcess 
[08-27-2015 :: 21:15:03] [Crash] [PathToSource]\zone\client_process.cpp (530): Client::Process 
[08-27-2015 :: 21:15:03] [Crash] [PathToSource]\zone\entity.cpp (481): EntityList::MobProcess 
[08-27-2015 :: 21:15:03] [Crash] [PathToSource]\zone\net.cpp (467): main
and this top line:
Code:
[08-27-2015 :: 21:15:03] [Crash] EXCEPTION_ACCESS_VIOLATION

The rest of it, essentially, is the program unwinding itself.


These two lines:
Code:
First-chance exception at 0x01B237A0 in zone.exe: 0xC0000005: Access violation reading location 0x00000000.
Unhandled exception at 0x01B237A0 in zone.exe: 0xC0000005: Access violation reading location 0x00000000.
are what is echoed by the top line of the crash dump and tells me that you have a null pointer..most likely for 'caster.'


You can/should put a null check in there to avoid crashes..though, you will still need to figure out why you are getting a null value there.

(i.e.,):
Code:
if (caster) { ... }
-or-
if (caster != nullptr) { ... }

-for complete bypass, put this at the beginning-
if (!caster) { return; }
-or-
if (caster == nullptr) { return; }
Always do a validity check on a pointer before attempting to dereference it (i.e., caster->do_something())

In a non-static method, the 'instantiated' mob object itself should never be null. It can consist of invalid data..but, it should always have a memory reference.

However, since you are passing in another mob object by pointer reference, that object can be a nullptr.


In the case of your mod_effect_value(), you would need to determine a baseline 'no effect' value and return that when bypassing
the function's methodology.


EDIT: For those filename unavailables, that just means that the debugger didn't have access to symbol data for that particular object/method.
(Probably something running at a lower level than the debugger itself.)
__________________
Uleat of Bertoxxulous

Compilin' Dirty

Last edited by Uleat; 08-27-2015 at 11:16 PM.. Reason: forgot filename unavailable...
Reply With Quote
  #6  
Old 08-28-2015, 11:18 PM
Randymarsh9
Dragon
 
Join Date: Dec 2007
Posts: 658
Default

Thanks for the help; I modified my code accordingly, and I also changed it to do modifications based on the individual effect instead of the spell type which is what I think was causing having effects with no caster specified. My new problem though seems to be that the HoT spells just don't scale based on wisdom. When I run the zone in debugger, I can see when the heal effect is loaded in, and it seems to return the proper value; however, in the game, HoT spells still only apply their unmodified value.

For example, I am using Celestial Health and it's base effect value is 115. After my wisdom bonus is applied, the mod function returns 143. For some reason, in the game, the spell will only heal for 115 though. All nukes, DoTs, and heals that I have tested seem to be working though which makes me wonder if the HoT value calculation is modified somewhere else after the mod_effect_value function. I'll continue looking for a cause, and here is my code in case someone else is working on the same thing i am.

Code:
int Mob::mod_effect_value(int effect_value, uint16 spell_id, int effect_type, Mob* caster) 
{ 
	//Spell effects that require a caster
	if (caster)
	{
		//Damage or healing spell
		if (effect_type == SE_BardAEDot || effect_type == SE_CompleteHeal ||
			effect_type == SE_CurrentHP || effect_type == SE_CurrentHPOnce || effect_type == SE_HealOverTime)
		{
			if (effect_value < 0)//Nuke or Dot
			{
				if (this != caster)//Only apply damage bonus if casting on someone else to avoid death from AEs and so on
				{
					effect_value *= (caster->INT / 100.0);
				}		
			}
			else//Heal or HoT
			{
				effect_value *= (caster->WIS / 100.0);
			}
		}
	}
	//Damage shields and runes are based on the target and not the caster
	if (effect_type == SE_DamageShield || effect_type == SE_Rune)
	{
		effect_value *= (STA / 100.0);
	}
	return(effect_value); 
}
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 03:45 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3