Jump to content
metin2dev
  • 0
Sign in to follow this  
Traceur3RUN

open New Function mob.get_name

Question

7 answers to this question

Recommended Posts

  • 0

For quest already exist a option.

say(string.format("[ITEM value;%d]", 189)) -- c_item_name(vnum)
say(string.format("[MOB value;%d]", 20091)) -- c_mob_name(vnum)
  • EVENT_TYPE_ITEM_NAME
  • EVENT_TYPE_MONSTER_NAME
Spoiler

		case EVENT_TYPE_ITEM_NAME:
		{
			int iIndex = atoi(GetArgument("value", ScriptCommand.argList));
			CItemData * pItemData;
			if (CItemManager::Instance().GetItemDataPointer(iIndex, &pItemData))
			{
				pEventSet->strCurrentLine.append(pItemData->GetName());
				pEventSet->pCurrentTextLine->SetValue(pEventSet->strCurrentLine.c_str());
				pEventSet->pCurrentTextLine->SetColor(1.0f, 0.2f, 0.2f);
				pEventSet->iCurrentLetter+= strlen(pItemData->GetName());

				if (pEventSet->iCurrentLetter >= pEventSet->iRestrictedCharacterCount)
					__InsertLine(*pEventSet);

				pEventSet->lLastDelayTime = pEventSet->lWaitingTime;
			}

			break;
		}
		case EVENT_TYPE_MONSTER_NAME:
		{
			int iIndex = atoi(GetArgument("value", ScriptCommand.argList));
			const char * c_szName;

			CPythonNonPlayer& rkNonPlayer=CPythonNonPlayer::Instance();
			if (rkNonPlayer.GetName(iIndex, &c_szName))
			{
				pEventSet->strCurrentLine.append(c_szName);
				pEventSet->pCurrentTextLine->SetValue(pEventSet->strCurrentLine.c_str());
				pEventSet->iCurrentLetter+= strlen(c_szName);

				if (pEventSet->iCurrentLetter >= pEventSet->iRestrictedCharacterCount)
					__InsertLine(*pEventSet);

				pEventSet->lLastDelayTime = pEventSet->lWaitingTime;
			}

 

 

  • Like 1
  • Haha 1

Share this post


Link to post
Share on other sites
  • 0
11 hours ago, VegaS™ said:

For quest already exist a option.


say(string.format("[ITEM value;%d]", 189)) -- c_item_name(vnum)
say(string.format("[MOB value;%d]", 20091)) -- c_mob_name(vnum)
  • EVENT_TYPE_ITEM_NAME
  • EVENT_TYPE_MONSTER_NAME
  Hide contents


		case EVENT_TYPE_ITEM_NAME:
		{
			int iIndex = atoi(GetArgument("value", ScriptCommand.argList));
			CItemData * pItemData;
			if (CItemManager::Instance().GetItemDataPointer(iIndex, &pItemData))
			{
				pEventSet->strCurrentLine.append(pItemData->GetName());
				pEventSet->pCurrentTextLine->SetValue(pEventSet->strCurrentLine.c_str());
				pEventSet->pCurrentTextLine->SetColor(1.0f, 0.2f, 0.2f);
				pEventSet->iCurrentLetter+= strlen(pItemData->GetName());

				if (pEventSet->iCurrentLetter >= pEventSet->iRestrictedCharacterCount)
					__InsertLine(*pEventSet);

				pEventSet->lLastDelayTime = pEventSet->lWaitingTime;
			}

			break;
		}
		case EVENT_TYPE_MONSTER_NAME:
		{
			int iIndex = atoi(GetArgument("value", ScriptCommand.argList));
			const char * c_szName;

			CPythonNonPlayer& rkNonPlayer=CPythonNonPlayer::Instance();
			if (rkNonPlayer.GetName(iIndex, &c_szName))
			{
				pEventSet->strCurrentLine.append(c_szName);
				pEventSet->pCurrentTextLine->SetValue(pEventSet->strCurrentLine.c_str());
				pEventSet->iCurrentLetter+= strlen(c_szName);

				if (pEventSet->iCurrentLetter >= pEventSet->iRestrictedCharacterCount)
					__InsertLine(*pEventSet);

				pEventSet->lLastDelayTime = pEventSet->lWaitingTime;
			}

 

 

Try to select 2 values returned by these functions :)

Share this post


Link to post
Share on other sites
  • 0
Dnia 4.11.2018 o 03:07, VegaS™ napisał:

For quest already exist a option.


say(string.format("[ITEM value;%d]", 189)) -- c_item_name(vnum)
say(string.format("[MOB value;%d]", 20091)) -- c_mob_name(vnum)
  • EVENT_TYPE_ITEM_NAME
  • EVENT_TYPE_MONSTER_NAME
  Ukryj treść


		case EVENT_TYPE_ITEM_NAME:
		{
			int iIndex = atoi(GetArgument("value", ScriptCommand.argList));
			CItemData * pItemData;
			if (CItemManager::Instance().GetItemDataPointer(iIndex, &pItemData))
			{
				pEventSet->strCurrentLine.append(pItemData->GetName());
				pEventSet->pCurrentTextLine->SetValue(pEventSet->strCurrentLine.c_str());
				pEventSet->pCurrentTextLine->SetColor(1.0f, 0.2f, 0.2f);
				pEventSet->iCurrentLetter+= strlen(pItemData->GetName());

				if (pEventSet->iCurrentLetter >= pEventSet->iRestrictedCharacterCount)
					__InsertLine(*pEventSet);

				pEventSet->lLastDelayTime = pEventSet->lWaitingTime;
			}

			break;
		}
		case EVENT_TYPE_MONSTER_NAME:
		{
			int iIndex = atoi(GetArgument("value", ScriptCommand.argList));
			const char * c_szName;

			CPythonNonPlayer& rkNonPlayer=CPythonNonPlayer::Instance();
			if (rkNonPlayer.GetName(iIndex, &c_szName))
			{
				pEventSet->strCurrentLine.append(c_szName);
				pEventSet->pCurrentTextLine->SetValue(pEventSet->strCurrentLine.c_str());
				pEventSet->iCurrentLetter+= strlen(c_szName);

				if (pEventSet->iCurrentLetter >= pEventSet->iRestrictedCharacterCount)
					__InsertLine(*pEventSet);

				pEventSet->lLastDelayTime = pEventSet->lWaitingTime;
			}

 

 

doesn't work

try:

send_letter(string.format("[MOB value;%d]", 172))

 

Screenshoot:

Screen-Shot-11-08-18-at-03-49-PM.png

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×