Jump to content

Make Quest check what costume the player has on them


Go to solution Solved by TMP4,

Recommended Posts

  • Contributor
  • Solution

Just make your own quest function:

//questlua_pc.cpp

int pc_get_costume(lua_State * L)
{
	LPITEM item = CQuestManager::instance().GetCurrentCharacterPtr()->GetWear(WEAR_COSTUME_BODY);

	if (!item)
		lua_pushnumber(L, 0);
	else
		lua_pushnumber(L, item->GetVnum());

	return 1;
}

//and add to bottom list

{ "getcostume",		pc_get_costume		},

//dont forget to add getcostume to questfunctions file in your locale/xy/quest folder...

 

Edited by TMP4
  • Love 1
Link to comment
Share on other sites

5 hours ago, TMP4 said:

Just make your own quest function:

//questlua_pc.cpp

int pc_get_costume(lua_State * L)
{
	LPITEM item = CQuestManager::instance().GetCurrentCharacterPtr()->GetWear(WEAR_COSTUME_BODY);

	if (!item)
		lua_pushnumber(L, 0);
	else
		lua_pushnumber(L, item->GetVnum());

	return 1;
}

//and add to bottom list

{ "getcostume",		pc_get_costume		},

//dont forget to add getcostume to questfunctions file in your locale/xy/quest folder...

 

I tried it and it works, thank you very much! Do you by any change happen to know if it's possible for me to write one of these functions that counts how many times the player basic attacks? 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.