Page 1 of 1

Adding Cure to Light Elemental

Posted: Tue Sep 15, 2015 1:20 am
by bluesolarflare
I tried to change the light elemental casting regen to cure by changing the spellID in the core from 108 to 2, however, the game crashes when the elemental begins casting (it never finishes)

Is there any reason why it crashes?

Re: Adding Cure to Light Elemental

Posted: Tue Sep 15, 2015 1:57 am
by kjLotus
have you tried reading the message from visual studio when it crashes?

Re: Adding Cure to Light Elemental

Posted: Tue Sep 15, 2015 9:02 am
by bluesolarflare
I'll post the error in a bit. Basically I was able to get past the first bit which was an issue with cure enmity not extending to the light spirit. There was a one line of code battle utils that called for a debug break if the user wasn't a player so I commented that out but now the crash happens due to something with a tree in the connect server so I'll post that.

Re: Adding Cure to Light Elemental

Posted: Tue Sep 15, 2015 2:13 pm
by bluesolarflare
When I debug, I get an Unhandled exception in Visual Studio

The failure points to xtree

Code: Select all

_Nodeptr& _Lmost() const
     {   // return leftmost node in nonmutable tree
      return (this->_Left(this->_Myhead));
The last line is where it failed

Re: Adding Cure to Light Elemental

Posted: Tue Sep 15, 2015 6:08 pm
by kjLotus
you'd want to check the call stack for a line that's actually in dsp's source instead of the STL, since it's more likely a fault of DSP's code than microsofts :)

also which exception is useful information as well

Re: Adding Cure to Light Elemental

Posted: Tue Sep 15, 2015 6:27 pm
by bluesolarflare
This is what I got on my last attempt:

The thread 0x1574 has exited with code 0 (0x0).
Unhandled exception at 0x012F51E6 in DSGame-server.exe: 0xC0000005: Access violation reading location 0x28BA5F70.

This was in the call stack

DSGame-server.exe!battleutils::GenerateCureEnmity(CBattleEntity * PSource, CBattleEntity * PTarget, unsigned short amount) Line 3554 C++
DSGame-server.exe!CLuaBaseEntity::updateEnmityFromCure(lua_State * L) Line 6159 C++
DSGame-server.exe!Lunar<CLuaBaseEntity>::thunk(lua_State * L) Line 173 C++
lua51.dll!6740266f() Unknown
[Frames below may be incorrect and/or missing, no symbols loaded for lua51.dll]
DSGame-server.exe!CMagicState::FinishSpell() Line 668 C++
DSGame-server.exe!CAIPetDummy::ActionMagicFinish() Line 1062 C++
DSGame-server.exe!CAIPetDummy::ActionMagicCasting() Line 1052 C++
DSGame-server.exe!CAIPetDummy::CheckCurrentAction(unsigned int tick) Line 106 C++
DSGame-server.exe!CZoneEntities::ZoneServer(unsigned int tick) Line 940 C++
DSGame-server.exe!CZone::ZoneServer(unsigned int tick) Line 791 C++
DSGame-server.exe!zone_server(unsigned int tick, CTaskMgr::CTask * PTask) Line 81 C++
DSGame-server.exe!CTaskMgr::DoTimer(unsigned int tick) Line 71 C++
DSGame-server.exe!main(int argc, char * * argv) Line 251 C++

Re: Adding Cure to Light Elemental

Posted: Tue Sep 15, 2015 6:59 pm
by kjLotus
ah, that's why they don't cast cure then right now, because updateEnmityFromCure only processes if the *target* is a PC (instead of the caster, which it should be). So the pet goes into a function that expects a character, and pretty bad things happen. Interesting though, that also means that a player healing a pet generates zero enmity.

I'll change it in a bit, see what happens

Re: Adding Cure to Light Elemental

Posted: Tue Sep 15, 2015 7:05 pm
by bluesolarflare
Awesome! Thanks

Re: Adding Cure to Light Elemental

Posted: Tue Sep 15, 2015 7:24 pm
by kjLotus

Re: Adding Cure to Light Elemental

Posted: Wed Sep 16, 2015 9:39 am
by bluesolarflare
Thanks worked like a charm. Now I can attempt to mess around with puppetmaster AI