Exchange Script question.

Status
Not open for further replies.
Skilled Illusionist
Joined
Mar 4, 2012
Messages
326
Reaction score
22
Hi there.

I just finished adding a new exchange script.. I just want to know, is there a way to like put a level requirement to the exchange script I made?

for example, only level 15 and above can exchange in MMI_EXCHNG1 and only level 60 and above can exchange in MMI_EXCHNG2.

If there's a way, how do I do it?

Thank you.
 
yeah.. I was thinking it will be in the source.. but.. I don't have any idea what to put or where to put it. do you have some ideas on how to do this?
 
yeah.. I was thinking it will be in the source.. but.. I don't have any idea what to put or where to put it. do you have some ideas on how to do this?

I'm sorry but what is this script? Is it in the source, or is it a Lua script, or a php script? I don't know what you mean by an exchange. If it's in the source then you could easily use a variable for the level of the character that clicks on it. Probably the same for the lua. If it's php then just take the level from the database.

I really don't know how to help with any real useful information until I know what you're trying to do.
 
oh.. I'm sorry. It's the Exchange_Script.txt where you can exchange an item for an item. Common use for this is the happy money. I want to have a level requirement before you can exchange an item..
 
Yeah, I got it now.
For those who are interested.

It's in Exchange.cpp.. inside the function:
Code:
int CExchange::ResultExchange

Just add something like:
Code:
if( nMMIId == MMI_EXCHANGE_ID && pUser->GetLevel() <= 60 )
{
		pUser->AddText( "Only level 60 and above can buy items from this NPC." );
		return EXCHANGE_FAILED;
}

Thanks for the help guys..
 
Status
Not open for further replies.
Back