Jump to content

[C++]Función game.drop_item_and_select()


Shang

Recommended Posts

Buenas pichas flojas.

 

Estoy haciendo la quest de la dungeon del nemere y he visto que necesitaba una función para la 5ª planta, así que he mirado de hacerla y pues me ha salido xD (puto amo).

 

Pues lo que hace la función es dropear un item (sin dueño) y seleccionar el item dropeado. Puediendole poner bonus/piedras al item.

 

Función (questlua_game.cpp):

 

 

	int game_drop_item_and_select(lua_State* L)
	{
		LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();

		if (!lua_isnumber(L, 1) && !lua_isnumber(L, 2))
		{
			sys_err("QUEST Make item call error : wrong argument");
			return 0;
		}

		DWORD item_vnum = (DWORD)lua_tonumber(L, 1);
		int count = (int)lua_tonumber(L, 2);
		long x = ch->GetX();
		long y = ch->GetY();

		LPITEM item = ITEM_MANAGER::instance().CreateItem(item_vnum, count);
		
		if (!item)
		{
			sys_err("cannot create item vnum %d count %d", item_vnum, count);
			return 0;
		}
		else
		{
			CQuestManager::Instance().SetCurrentItem(item);
		}

		PIXEL_POSITION pos;
		pos.x = x + number(-200, 200);
		pos.y = y + number(-200, 200);

		item->AddToGround(ch->GetMapIndex(), pos);
		item->StartDestroyEvent();

		return 0;
	} 
			{ "drop_item_and_select",		game_drop_item_and_select		}, 

 

 

 

Quien no sepa instalarlo que pregunte a PACI.

 

Prueba de que funciona:

M23RlM4.gif

 

Quest de la prueba:

 

 

quest test_func begin
	state start begin
		
		when letter begin
			send_letter("Drop_Item_Select")
		end
		
		when button or info begin
			say("Vnum:")
			local vnum = tonumber(input())
			say("Socket 1:")
			local socket = tonumber(input())
			game.drop_item_and_select(vnum, 1)
			item.set_socket(0, socket)
		end

	end
end 

 

 

 

Uso de la función:

 

game.drop_item_and_select(item_vnum, item_count)

 

Saludos!

Link to comment
Share on other sites

Buenas pichas flojas.

 

Estoy haciendo la quest de la dungeon del nemere y he visto que necesitaba una función para la 5ª planta, así que he mirado de hacerla y pues me ha salido xD (puto amo).

 

Pues lo que hace la función es dropear un item (sin dueño) y seleccionar el item dropeado. Puediendole poner bonus/piedras al item.

 

Función (questlua_game.cpp):

 

 

	int game_drop_item_and_select(lua_State* L)
	{
		LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();

		if (!lua_isnumber(L, 1) && !lua_isnumber(L, 2))
		{
			sys_err("QUEST Make item call error : wrong argument");
			return 0;
		}

		DWORD item_vnum = (DWORD)lua_tonumber(L, 1);
		int count = (int)lua_tonumber(L, 2);
		long x = ch->GetX();
		long y = ch->GetY();

		LPITEM item = ITEM_MANAGER::instance().CreateItem(item_vnum, count);
		
		if (!item)
		{
			sys_err("cannot create item vnum %d count %d", item_vnum, count);
			return 0;
		}
		else
		{
			CQuestManager::Instance().SetCurrentItem(item);
		}

		PIXEL_POSITION pos;
		pos.x = x + number(-200, 200);
		pos.y = y + number(-200, 200);

		item->AddToGround(ch->GetMapIndex(), pos);
		item->StartDestroyEvent();

		return 0;
	} 
			{ "drop_item_and_select",		game_drop_item_and_select		}, 

 

 

 

Quien no sepa instalarlo que pregunte a PACI.

 

Prueba de que funciona:

M23RlM4.gif

 

Quest de la prueba:

 

 

quest test_func begin
	state start begin
		
		when letter begin
			send_letter("Drop_Item_Select")
		end
		
		when button or info begin
			say("Vnum:")
			local vnum = tonumber(input())
			say("Socket 1:")
			local socket = tonumber(input())
			game.drop_item_and_select(vnum, 1)
			item.set_socket(0, socket)
		end

	end
end 

 

 

 

Uso de la función:

game.drop_item_and_select(item_vnum, item_count)

Saludos!

que pasa si pongo la id de una chami grrrrrrrr

:3

Pd: se ve interesante e.e e.e.e.e.e.e

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
Reply to this topic...

×   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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...