Jump to content
  • 0

Request for a @sell Command


Vainglorious

Question


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  18
  • Reputation:   0
  • Joined:  03/14/13
  • Last Seen:  

Hello there, I searched the Forums and didn't find it yet - or was I to dumb? I don't know.

 

Since I managed to implement a @buy command I wanted to make one for @sell buuuut...

Currently I really don't have a clew how to do that....

Would anyone be willing to help me?


If you like i'll share the @buy command. haha :D

 

Thank you very much! 

 

Regards, Vainglorious

Link to comment
Share on other sites

5 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  106
  • Reputation:   3
  • Joined:  01/01/12
  • Last Seen:  

Use this command. He will call npc event OnWantToSell from SELL_NPC.

 

ACMD_FUNC(sell)
{
    nullpo_retr(-1,sd);
    
    if( sd->npc_id || sd->vender_id || sd->buyer_id || sd->state.trading || sd->state.storage_flag )
        return -1;
        
    npc_event(sd,"SELL_NPC::OnWantToSell",0);
    return 0;
    
}

 

NPC script:

-<tab>script<tab>SELL_NPC<tab>-1,{
OnWantToSell:
callshop "SellShop",2;
end;
 
-    shop    SellShop    139,2117:-1,7521:-1,7522:-1,7523:-1,7524:-1,13250:-1,13251:-1,13252:-1,13253:-1,13254:-1
}


 

Edited by Oxxy
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2346
  • Joined:  10/28/11
  • Last Seen:  

you can do like this too

 

-	shop	Sample_Shop	-1,909:-1

-	script	Sample	-1,{
OnInit:
	bindatcmd "sell",strnpcinfo(3)+"::OnAtCommand";
	end;
	
OnAtCommand:
	callshop "Sample_Shop",2;
	end;
}
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.01
  • Content Count:  21
  • Reputation:   0
  • Joined:  05/15/21
  • Last Seen:  

On 3/30/2013 at 6:43 PM, Emistry said:

you can do like this too

 


-	shop	Sample_Shop	-1,909:-1

-	script	Sample	-1,{
OnInit:
	bindatcmd "sell",strnpcinfo(3)+"::OnAtCommand";
	end;
	
OnAtCommand:
	callshop "Sample_Shop",2;
	end;
}

where do i need to put this script?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  106
  • Reputation:   3
  • Joined:  01/01/12
  • Last Seen:  

What does @sell do?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  18
  • Reputation:   0
  • Joined:  03/14/13
  • Last Seen:  

Oh forgot to mention... I wanted to let it open a vendor sell window, so if you would go to a vendor and use the "sell" option. 
For short, that you can sell items on the run!

Thank you it worked out well! :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...