Dragonslayer Posted July 13, 2015 Report Share Posted July 13, 2015 Archivo: questlua_item.cpp Antes de meter esto, quiero que sepais que item.set_value = item.set_attr. int item_get_attr(lua_State* L) { LPITEM item = CQuestManager::instance().GetCurrentItem(); if(!lua_isnumber(L,1) || !item) { return 0; } int bonus = lua_tonumber(L,1); if(bonus < 0 || bonus > 6) { return 0; } TPlayerItemAttribute attr = item->GetAttribute(bonus); lua_pushnumber(L,attr.bType); lua_pushnumber(L,attr.sValue); return 2; } int item_set_attr(lua_State* L) { LPITEM item = CQuestManager::instance().GetCurrentItem(); if (!lua_isnumber(L,1)||!lua_isnumber(L,2)||!lua_isnumber(L,3)||!item) { lua_pushnumber(L,0); return 1; } int bonus = lua_tonumber(L,1); if (bonus <0 || bonus > 6) { lua_pushnumber(L,0); return 1; } item->SetForceAttribute(bonus,lua_tonumber(L,2),lua_tonumber(L,3)); lua_pushnumber(L,1); return 1; } { "get_attr", item_get_attr }, { "set_attr", item_set_attr }, mebe, Johan™, NazoX and 1 other 4 Quote Link to comment Share on other sites More sharing options...
Ryen Posted July 13, 2015 Report Share Posted July 13, 2015 Gracias, pero esto sirve para? Quote Link to comment Share on other sites More sharing options...
PACI Posted July 13, 2015 Report Share Posted July 13, 2015 El set existe por defecto (item_set_value) Quote Link to comment Share on other sites More sharing options...
Johan™ Posted July 13, 2015 Report Share Posted July 13, 2015 Gracias, pero esto sirve para? Para cambiar los artrbutos de los items (bonus) por uno que tu quieres y no aleatorio e.e Quote Link to comment Share on other sites More sharing options...
Shang Posted July 13, 2015 Report Share Posted July 13, 2015 Sirve para obtener los bonus de un item. Quote Link to comment Share on other sites More sharing options...
Jeo Posted July 13, 2015 Report Share Posted July 13, 2015 Super interesantes estas funciones. Les daré uso. Quote Link to comment Share on other sites More sharing options...
Dragonslayer Posted July 13, 2015 Author Report Share Posted July 13, 2015 El set existe por defecto (item_set_value) "Antes de meter esto, quiero que sepais que item.set_value = item.set_attr." Quote Link to comment Share on other sites More sharing options...
Jeo Posted July 13, 2015 Report Share Posted July 13, 2015 Y hacen la misma funcion? entonces de que sirve meter el set attr? Quote Link to comment Share on other sites More sharing options...
Dragonslayer Posted July 13, 2015 Author Report Share Posted July 13, 2015 Pues sirve de poco la funcion que realizan es la misma, esta solo tiene otra estructura. Jeo 1 Quote Link to comment Share on other sites More sharing options...
Guest DreamHQ Posted July 14, 2015 Report Share Posted July 14, 2015 Gracias por el aporte +1 Un saludo. 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.