/BUYITEM and /SELLITEM released...

A forum for feature requests/discussions and user submitted patches that improve MQ2

Moderator: MacroQuest Developers

EqMule
Developer
Developer
Posts: 2697
Joined: Fri Jan 03, 2003 9:57 pm
Contact:

Post by EqMule » Tue Jul 15, 2003 9:32 pm

I finally managed to get all in by placing the commands between macro and endmacro in the commandlist...

Code: Select all

{"/macro",		"Macro"},
		[b]{"/selectitem",	"SelectItem"},
		{"/buyitem",	"BuyItem"},[/b]
		{"/memspell",	"MemSpell"},
		{"/loadspells",	"LoadSpells"},
		{"/endmacro",	"EndMacro"},
and I set my project->settings->Link-Output->Base address for eqlib to 0x03000000

now it finally works... hope you solve it. Im using VS 6.0 btw, in VS NET the base address is allready set to 0x030000000 in the proj file...
My status o/
If you like MQ2 and would like to contribute, please do. My goal is 25 donations per month.
So far I've received Image donations for this month's patches.

Bitcoin: 1Aq8ackjQ4f7AUvbUL7BE6oPfT8PmNP4Zq
Krono: PM me.
I can always use characters for testing, PM me if you can donate one.

User avatar
Kint
a hill giant
a hill giant
Posts: 208
Joined: Thu Mar 13, 2003 3:36 am

Post by Kint » Tue Jul 15, 2003 11:12 pm

pwn, thank you eqmule, it works great now.

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Wed Jul 16, 2003 5:06 am

Fixed the right way in CVS and on the downloads page.

Remove or comment out this line:
{"/gotoxy", "GotoXY"},

As-of-yet-unimplemented functions turn into list ending entries since the function is NULL. Quite a bitch to find...

EqMule
Developer
Developer
Posts: 2697
Joined: Fri Jan 03, 2003 9:57 pm
Contact:

/SellItem here we go...

Post by EqMule » Sat Jul 19, 2003 11:31 pm

ok use what you learned from inserting /buyitem, this is the same thing, so im just posting the function that goes into EQLib_Commands.cpp
WHEN you have it compiled and mq is running first thing you need to do is remove your alias for sell... /alias /sell delete then this command will start working...
and NO its not possible to dupe with this code, please do not post about the stack of shit you got if you misuse it by selling more of an item than u have. (but If you do figure out a way to trick it, PM me :) )

Code: Select all

 [color=green]// ***************************************************************************
// Function:    sellitem
// Description: Our '/sellitem' command
// Usage:       /sellitem Quantity#
// uses private: void __thiscall CMerchantWnd::RequestSellItem(int)
// will buy the specified quantity of the currently selected item
// ***************************************************************************[/color]
VOID SellItem(PSPAWNINFO pChar, PCHAR szLine) 
{ 
	bRunNextCommand = FALSE;
	DWORD MerchTraderWnd = *EQADDR_CLASSMERCHWND; 
	PEQWINDOW pMerchWnd = (PEQWINDOW)*EQADDR_CLASSMERCHWND;
	CHAR szBuffer[MAX_STRING] = {0};
	CHAR szQty[MAX_STRING] = {0};
	PCHARINFO pCharInfo = NULL;
	DWORD Qty;
	DebugSpew("/sellitem : yes the command works at least to this point");
            
	if (!MerchTraderWnd || !cmdSellItem) return;
	if (NULL == (pCharInfo = GetCharInfo())) return;
	GetArg(szQty,szLine,1);
	Qty = (DWORD)atoi(szQty);
	if (Qty > 20 || Qty < 1) return;
	__asm {
		push ecx;
		mov ecx, dword ptr [MerchTraderWnd]; 
		push Qty;
        call dword ptr [cmdSellItem];
		pop ecx;
	}
	return;	
}
offset in eqgame.ini under function locations is:

Code: Select all

sellitem=004e8d17
My status o/
If you like MQ2 and would like to contribute, please do. My goal is 25 donations per month.
So far I've received Image donations for this month's patches.

Bitcoin: 1Aq8ackjQ4f7AUvbUL7BE6oPfT8PmNP4Zq
Krono: PM me.
I can always use characters for testing, PM me if you can donate one.

Draekz
a hill giant
a hill giant
Posts: 263
Joined: Thu Aug 01, 2002 6:07 pm
Location: Winnipeg, Manitoba, Canada

Post by Draekz » Thu Sep 04, 2003 2:37 pm

Hmm quick question! Not sure if this is directly implemented yet, but if not, is it up to date? or will it work with latest release? noticed last post date was july 20th so just wondered whats going on with this :)

I just need a working /sellitem command or something to sell unstackable items (fine steel for example).

Anyway, thanks for any info regarding this!

Take care

Draekz

EqMule
Developer
Developer
Posts: 2697
Joined: Fri Jan 03, 2003 9:57 pm
Contact:

Post by EqMule » Thu Sep 04, 2003 3:04 pm

uhm, I think this has been in since the end of july... it works fine after patch as well, just need to check you are running the latest zip/cvs...

the command works as follows
1. /selectitem "something" sefl
2. /sellitem 1

or /sellitem 20 or whatever if you want to sell more than 1 item from a stack...
My status o/
If you like MQ2 and would like to contribute, please do. My goal is 25 donations per month.
So far I've received Image donations for this month's patches.

Bitcoin: 1Aq8ackjQ4f7AUvbUL7BE6oPfT8PmNP4Zq
Krono: PM me.
I can always use characters for testing, PM me if you can donate one.