Auto Gold Pickup
Moderator: Nizari
-
- Posts: 80
- Joined: Sun Dec 01, 2013 12:46 pm
Auto Gold Pickup
Heloes
Okay, I'm pretty sure somebody HAD TO ask about it, but I searched and couldn't find anything, so, if I'm reposting, sorry for that.
Anyway, apart from being apologetic, I'd like to ask about one thing - is there a way to make gold auto pickupable in Diablo 2? I like this feature in third part, but it's one of very few things Diablo 3 excells at. I'm making a small mod for myself and I'd really like to have this one on it.
Thanks in advance!
Okay, I'm pretty sure somebody HAD TO ask about it, but I searched and couldn't find anything, so, if I'm reposting, sorry for that.
Anyway, apart from being apologetic, I'd like to ask about one thing - is there a way to make gold auto pickupable in Diablo 2? I like this feature in third part, but it's one of very few things Diablo 3 excells at. I'm making a small mod for myself and I'd really like to have this one on it.
Thanks in advance!
"Answers fishing is kinda tough to make the living from."
~Me
I am making a mod, but won't post anything about it here until I have some playable beta as I know myself too much to give any hopes
~Me
I am making a mod, but won't post anything about it here until I have some playable beta as I know myself too much to give any hopes
Re: Auto Gold Pickup
this require code editing to get work.
In basic you need to hook the char movement code and add your own custom code from there to let it automatically pick up gold.
In basic you need to hook the char movement code and add your own custom code from there to let it automatically pick up gold.
Re: Auto Gold Pickup
Maybe just remove gold completely from droping, and then have a skill on kill on your character that increase gold based of monster level, with something like 20% chance to give gold ?
Just an idea, and seems way more easy
Just an idea, and seems way more easy
-
- Posts: 80
- Joined: Sun Dec 01, 2013 12:46 pm
Re: Auto Gold Pickup
Hmm... well, that would be kinda epic, I'll think this through. Thanks for the idea
"Answers fishing is kinda tough to make the living from."
~Me
I am making a mod, but won't post anything about it here until I have some playable beta as I know myself too much to give any hopes
~Me
I am making a mod, but won't post anything about it here until I have some playable beta as I know myself too much to give any hopes
Re: Auto Gold Pickup
hmmm, pehaps telekenisis is a good base-skill for this...
i remember hooking the game iterate events,
casting Enchant Level 1 when a specific stat is less than 1...
which worked quite nice... but triggers a c0000005 crash when you save and exit
it was just an experiment on my part, but would work quite well when hooked in a good place...
perhaps on the code that negates stamina when running? or somewhere close there
other than making an on-kill event item, why not a monster death-skill ?
made something like this on my early modding days, hehehe
i remember hooking the game iterate events,
casting Enchant Level 1 when a specific stat is less than 1...
which worked quite nice... but triggers a c0000005 crash when you save and exit
it was just an experiment on my part, but would work quite well when hooked in a good place...
perhaps on the code that negates stamina when running? or somewhere close there
other than making an on-kill event item, why not a monster death-skill ?
made something like this on my early modding days, hehehe
" It's not the size of the dog in the fight, it's the size of the fight in the dog. "
~Mark Twain
~Mark Twain
-
- Posts: 80
- Joined: Sun Dec 01, 2013 12:46 pm
Re: Auto Gold Pickup
Xaphan said the same, actually
Is there a way to make the game show how much gold drops? Like text '+xxx' floating above monster body for 2 sec and then disappearing? Because simply giving the gold and not showing how much is pratical, but, to my mind at least, breaks the game a bit.
Is there a way to make the game show how much gold drops? Like text '+xxx' floating above monster body for 2 sec and then disappearing? Because simply giving the gold and not showing how much is pratical, but, to my mind at least, breaks the game a bit.
"Answers fishing is kinda tough to make the living from."
~Me
I am making a mod, but won't post anything about it here until I have some playable beta as I know myself too much to give any hopes
~Me
I am making a mod, but won't post anything about it here until I have some playable beta as I know myself too much to give any hopes
-
- Paladin
- Posts: 100
- Joined: Sat Apr 02, 2011 6:28 pm
Re: Auto Gold Pickup
Coding a simple auto gold pickup system is pretty easy.. Could be done with ~20 lines of C-code... It works but it misses distance, line of sight,... checks then..
Re: Auto Gold Pickup
yep, pretty simple... you just take the previous value of gold - the new amount, thenTehFisharmahn" wrote: Is there a way to make the game show how much gold drops? Like text '+xxx' floating above monster body for 2 sec and then disappearing? Because simply giving the gold and not showing how much is pratical, but, to my mind at least, breaks the game a bit.
use a notification to display the result.
demon9ne, i think set his range close enough to the character,Mnw1995" wrote:Coding a simple auto gold pickup system is pretty easy.. Could be done with ~20 lines of C-code... It works but it misses distance, line of sight,... checks then..
auto-pickup is kinda cool
" It's not the size of the dog in the fight, it's the size of the fight in the dog. "
~Mark Twain
~Mark Twain
Re: Auto Gold Pickup
I did this in my mod. Well, it dosen't show when you get gold and how many, but I don't care, you got the gold and don't need to click everywhere, that's all I wanted :p
Re: Auto Gold Pickup
Perhaps each new player is created with a +1 Telekinesis (or non-mana clone of it) charm when they start out...
-
- Posts: 82
- Joined: Tue Jun 23, 2015 11:29 am
Re: Auto Gold Pickup
Sorry for the necrobump but I don't think there's reason to open a new thread when there's one alreadyXaphan" wrote:I did this in my mod. Well, it dosen't show when you get gold and how many, but I don't care, you got the gold and don't need to click everywhere, that's all I wanted :p
Would somebody explain how Xaphan managed to do this?
Or, if now, someone managed to make an actual auto gold pickup system?
I'm talking for single player obviously. Since I'm trying to make gold more valuable, it'd be kinda cool not to waste 10 minutes clicking everywhere
Re: Auto Gold Pickup
i managed to code this auto gold pickup...Kuss" wrote:Sorry for the necrobump but I don't think there's reason to open a new thread when there's one alreadyXaphan" wrote:I did this in my mod. Well, it dosen't show when you get gold and how many, but I don't care, you got the gold and don't need to click everywhere, that's all I wanted :p
Would somebody explain how Xaphan managed to do this?
Or, if now, someone managed to make an actual auto gold pickup system?
I'm talking for single player obviously. Since I'm trying to make gold more valuable, it'd be kinda cool not to waste 10 minutes clicking everywhere
i think Xaphan is referring to the skill-on event method, gold is also a stat so, a skill-on event ex: pulse_on_death skill which adds gold instead of a certain penalty, gold value can be set to random in skills.txt
the code way is more simpler and more efficient
" It's not the size of the dog in the fight, it's the size of the fight in the dog. "
~Mark Twain
~Mark Twain
-
- Posts: 82
- Joined: Tue Jun 23, 2015 11:29 am
Re: Auto Gold Pickup
Wait you actually did it? :Othe code way is more simpler and more efficient
Why isn't this on the news or something?
Do you implemented it in a mod or you released something like a plugin or a tutorial?
Re: Auto Gold Pickup
Immersion done it long time ago, he done it for his own mod.Kuss" wrote:Wait you actually did it? :Othe code way is more simpler and more efficient
Why isn't this on the news or something?
Do you implemented it in a mod or you released something like a plugin or a tutorial?
Re: Auto Gold Pickup
i just copied the idea of Demon9ne's Emmersion, i liked his mod alotKuss" wrote:Wait you actually did it? :Othe code way is more simpler and more efficient
Why isn't this on the news or something?
Do you implemented it in a mod or you released something like a plugin or a tutorial?
i assure you the code i used was written by me except for a d2vanilla function which MWN1995 shared with me
(*i asked for some help from him about this sometime ago)
the function he gave basically calculates the subtiles between 2 units aka 'distance'
which is very important to make the code work as intended (*my old distance calculation logic is... well erroneous )
well since d2 is old and we all love the game
here is my code
Code: Select all
char pMsg[256];
int GAP;
int INVENTORY_GOLD = D2COMMON_GetStat(pUnit,STAT_GOLD,0);
int GOLD_LIMIT = D2COMMON_GetGoldLimitInInventory(pUnit);
int GOLD_QUANTITY;
unsigned int nSpawnedItems = pGame->dwSpawnedItems + 1;
DWORD ITEM_GOLD = D2REVOLUTION_ItemCode("gld");
D2RoomStrc* pPlayerRoom = D2COMMON_GetRoomFromUnit(pUnit);
BOOL inTown = D2COMMON_TestRoomIfTown(pPlayerRoom);
if(inTown == FALSE) //prevent autoloot in town
{
if(pUnit->dwUnitType == UNIT_PLAYER)
{
if(pPlayerRoom == NULL) return;
for(unsigned int i = 0; i <= nSpawnedItems; i++)
{
D2UnitStrc* pFloorItem = pPlayerRoom->pUnitFirst;
if(pFloorItem == NULL) return;
while(pFloorItem != NULL)
{
D2ItemsTxt* pFloorItemTxt = D2COMMON_GetItemText(pFloorItem->dwClassId);
GOLD_QUANTITY = D2COMMON_GetStat(pFloorItem,STAT_GOLD,0);
GAP = D2GAME_GetDistanceBetweenUnits(pFloorItem, pUnit);
if((pFloorItem->dwUnitType == UNIT_ITEM) && (pFloorItemTxt->dwcode == ITEM_GOLD ) && (GAP <= 3))
{
if( (INVENTORY_GOLD + GOLD_QUANTITY) <= GOLD_LIMIT) //gold limit check
{
D2GAME_PickUpGold(pGame, pUnit, pFloorItem);
D2GAME_AttachSound(pUnit, SFX_PICKUP_ITEM, pUnit);
sprintf_s(pMsg,sizeof(pMsg),"Auto-picked %d Gold !", (D2COMMON_GetStat(pUnit,STAT_GOLD,0)-INVENTORY_GOLD) );
CHAT_SendServerMessage(pGame, pUnit, COL_BLUE,FALSE, pMsg, TRUE);
}
if( (INVENTORY_GOLD + GOLD_QUANTITY) > GOLD_LIMIT)
{
sprintf_s(pMsg,sizeof(pMsg),"Gold Limit Reached !");
CHAT_SendServerMessage(pGame,pUnit,COL_GREY,FALSE,pMsg,TRUE);
}
}
pFloorItem = pFloorItem->pListNext;
}
}
}
}
" It's not the size of the dog in the fight, it's the size of the fight in the dog. "
~Mark Twain
~Mark Twain
Re: Auto Gold Pickup
Code: Select all
void __fastcall GOLDPICKUP_PickupInRangeGold(D2GameStrc* pGame, D2UnitStrc* pPlayer)
{
if (!pGame || !pPlayer || pPlayer->dwType != UNIT_PLAYER)
return;
D2RoomStrc* pRoom = DRLG_GetRoomFromUnit(pPlayer);
if (!pRoom) return;
if (pPlayer->dwMode == PLRMODE_DEATH || pPlayer->dwMode == PLRMODE_DEAD)
return;
if (D2COMMON_GetUnitState(pPlayer, STATE_UNINTERRUPTABLE))
return;
for (D2UnitStrc* pUnit = pRoom->pFirstUnit; pUnit; pUnit = pUnit->pRoomNext)
{
if (pUnit->dwType != UNIT_ITEM)
continue;
D2ItemsTXT* pItemRecord = TXT_GetItemRecord(pUnit->dwClass);
if (!pItemRecord) continue;
if (pItemRecord->dwCode != CODE32('gld '))
continue;
D2CoordStrc pPlayerCoords, pItemCoords = {};
if (!DRLG_GetUnitCoords(pPlayer, &pPlayerCoords) || !DRLG_GetUnitCoords(pUnit, &pItemCoords))
continue;
if (D2COMMON_GetDistance(pPlayerCoords.nX, pPlayerCoords.nY, pItemCoords.nX, pItemCoords.nY) > 16)
continue;
DWORD dwCurrentGold = D2COMMON_GetUnitStat(pPlayer, STAT_GOLD, NULL);
if (dwCurrentGold >= STATS_GetBeltGoldLimit(pPlayer))
continue;
D2GAME_PickGoldPile(pGame, pPlayer, pUnit);
}
}
-
- Posts: 82
- Joined: Tue Jun 23, 2015 11:29 am
I did try Immersion days ago, and the auto-gold pickup didn't work.
You guys are posting codes (that, strangely, I can understand, since I did some basic programming in C when I was young). But I have no idea how this would relate to Diablo.
My best guess would be to put these somewhere in the .dll of the game? I think I need to start learning these things
Oh and thanks for sharing the resources, now it's just about how to use them ^^
You guys are posting codes (that, strangely, I can understand, since I did some basic programming in C when I was young). But I have no idea how this would relate to Diablo.
My best guess would be to put these somewhere in the .dll of the game? I think I need to start learning these things
Oh and thanks for sharing the resources, now it's just about how to use them ^^
Re:
We are using a Code-Base written in C++ I in particular use d2template (shared by kidpaddle) which compiles into a .dllKuss" wrote:I did try Immersion days ago, and the auto-gold pickup didn't work.
You guys are posting codes (that, strangely, I can understand, since I did some basic programming in C when I was young). But I have no idea how this would relate to Diablo.
My best guess would be to put these somewhere in the .dll of the game? I think I need to start learning these things
Oh and thanks for sharing the resources, now it's just about how to use them ^^
i also used the d2modsdk before and d2external system too
then you need to find a way for Diablo2 to load your new dll, as for me i use the d2mod system by SVR [D2 v1.10]
i think you should visit the d2template thread *code-editing forum
the community needs more Coders
as the more advance our community, the better the mods that come out which means more fun
" It's not the size of the dog in the fight, it's the size of the fight in the dog. "
~Mark Twain
~Mark Twain
-
- Posts: 82
- Joined: Tue Jun 23, 2015 11:29 am
Re: Auto Gold Pickup
Thanks mate!
I got myself the d2Template but I just read that there's no 1.13 version of the d2mod System, so I ask: is D2SE an alternative? Or is it a totally different thing?
As for now, I'm going to start messing things up with my 1.10 (brb downgrading )
EDIT ---- Ok I found NefEx that does the exact same thing and works with 1.11.
I got myself the d2Template but I just read that there's no 1.13 version of the d2mod System, so I ask: is D2SE an alternative? Or is it a totally different thing?
As for now, I'm going to start messing things up with my 1.10 (brb downgrading )
EDIT ---- Ok I found NefEx that does the exact same thing and works with 1.11.