Jump to content
×
×
  • Create New...
  • 0

Make Quest check what costume the player has on them


Navraz

Question

Hi everyone!

I am writing a quest and I have run in a seemingly simple problem. You know how you write pc.getarmor() == "armor vnum"  to check if the player has a specific armor equipped? I wish to do the same but with costumes, i have tried pc.getwear(19) but it doesn't seem to work. Do you guys know how?

Link to comment

3 answers to this question

Recommended Posts

  • 2
  • Sun
Posted (edited)

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
  • 0
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


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.