Shang Posted August 13, 2015 Report Share Posted August 13, 2015 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: 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! Johan™, Jeo, mebe and 1 other 4 Quote Link to comment Share on other sites More sharing options...
Johan™ Posted August 13, 2015 Report Share Posted August 13, 2015 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: 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 Quote Link to comment Share on other sites More sharing options...
Shang Posted August 13, 2015 Author Report Share Posted August 13, 2015 que pasa si pongo la id de una chami grrrrrrrr :3 Pd: se ve interesante e.e e.e.e.e.e.e Que le puedes poner atributos... (+tetas) Johan™ 1 Quote Link to comment Share on other sites More sharing options...
carlos21 Posted August 13, 2015 Report Share Posted August 13, 2015 shong eso que se ve la espada +4 y el menu ese es publico? Quote Link to comment Share on other sites More sharing options...
Johan™ Posted August 13, 2015 Report Share Posted August 13, 2015 shong eso que se ve la espada +4 y el menu ese es publico? lo de la espada x+ es de sema :v creo que el se lo compro :V lo del menu creo que el feo lo iso e.e Quote Link to comment Share on other sites More sharing options...
Jeo Posted August 13, 2015 Report Share Posted August 13, 2015 Interesante. Quote Link to comment Share on other sites More sharing options...
Shang Posted August 13, 2015 Author Report Share Posted August 13, 2015 lo de la espada x+ es de sema :v creo que el se lo compro :V lo del menu creo que el feo lo iso e.e Yo comprarle a sema? Me lo regaló. Lo del menú sí, lo hice yo. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.