A relatively simple question:
I'm looking for an ideal place to hook the game at character start, for some code that will run once at game entrance, when the character pops up in town. Can anyone recommend an address? Thanks.
[1.10] Character start hook
Moderators: Nefarius, Havvoric
-
- Champion of the Light
- Posts: 385
- Joined: Mon Dec 20, 2004 6:01 am
- Location: IL, USA
Re: [1.10] Character start hook
on character creation only or every times you enter a game with any character?
-
- Champion of the Light
- Posts: 385
- Joined: Mon Dec 20, 2004 6:01 am
- Location: IL, USA
Re: [1.10] Character start hook
Every time. I need it to be when a character appears, after the character data is loaded.
Re: [1.10] Character start hook
Hook D2Game.0x6FC8EF20:
Unfortunately it must be this as internally there is a branch for new players/loaded players. just remember to call it first, and you'll have a fully inited player
Code: Select all
DWORD __fastcall D2ProcessSaveFile(D2GameStrc* pGame, D2ClientStrc* pClient, BYTE* pSaveFile, size_t nSize, D2UnitStrc** ppPlayer, DWORD dw1, DWORD dw2, DWORD dw3)
Netiquette, Do you USE it?!?! | Nefarius' Fixed TXT Files | Terms Of Service
Blackened | Day of Death | D2GFEx
"What was yours is mine. Your land, your people, and now your life." - Lim-Dul, the Necromancer
Judgement is Final, Death is Eternal
-
- Champion of the Light
- Posts: 385
- Joined: Mon Dec 20, 2004 6:01 am
- Location: IL, USA
Re: [1.10] Character start hook
Thanks Nec. Works well.
Also, a poor/lazy coder's solution to new players vs. those already present:
if (Experience == 0) {
do new player stuff
+1 Experience!
}
When players ask why they start with 1 experience, simply tell them "Backstory."
Also, a poor/lazy coder's solution to new players vs. those already present:
if (Experience == 0) {
do new player stuff
+1 Experience!
}
When players ask why they start with 1 experience, simply tell them "Backstory."