Dilong Posted June 26, 2018 Report Share Posted June 26, 2018 Lo hice para que dope armaduras, acces (menos brazalete), pendientes, zapatos, hasta un maximo de 4 bonus. Si quieren que sea para otros items y mas que 4 bonus tendran que editar la quest Spoiler quest bonus begin state start begin when 20094.take with item.get_type()==2 or item.get_type()==1 begin precio_attr_1 = 100000 subtypes = {1,6,2,3,0} for i=1, table.getn(subtypes) do if item.get_sub_type()== subtypes[i] then notice("Solo se acepta: Armadura, Collar, Zapato y Pendiente") return end end attr_1 = { {"Hp", 1, 3500, 1, 0}, {"Defensa Espada", 29, 15, 2}, {"Defensa Dos Manos", 30, 15, 3}, {"Defensa Daga", 31, 15, 4}, {"Velocidad de ataque", 7, 10, 5}, {"Velocidad Hechizo", 9, 20, 6}, {"Defensa Daga", 31, 15, 7}, {"Defensa Fan", 33, 15, 8}, {"Resistencia de Flechas", 34, 15, 9}, {"Siguiente"}, } attr_11 = {} for i=1, table.getn(attr_1) do table.insert(attr_11,attr_1[i][1]) end say_title("Bonus1")--------------------------------------- local bonus_3 = select_table(attr_11) if pc.get_gold()< precio_attr_1 then say("Yang insuficiente") return end if pc.getqf("bonus")== attr_1[bonus_3][4] then notice("El objeto ya tiene este bonus") else pc.setqf("bonus",0) item.set_value(0, attr_1[bonus_3][2], attr_1[bonus_3][3]) pc.setqf("bonus",attr_1[bonus_3][4]) pc.change_gold(-precio_attr_1) say_title("Bonus2")--------------------------------------- local bonus_4 = select_table(attr_11) if pc.get_gold()< precio_attr_1 then say("Yang insuficiente") return end if pc.getqf("bonus")== attr_1[bonus_4][4] then notice("El objeto ya tiene este bonus") else pc.setqf("bonus",0) item.set_value(1, attr_1[bonus_4][2], attr_1[bonus_4][3]) pc.setqf("bonus",attr_1[bonus_4][4]) pc.change_gold(-precio_attr_1) say_title("Bonus3")--------------------------------------- local bonus_5 = select_table(attr_11) if pc.get_gold()< precio_attr_1 then say("Yang insuficiente") return end if pc.getqf("bonus")== attr_1[bonus_5][4] then notice("El objeto ya tiene este bonus") else pc.setqf("bonus",0) item.set_value(2, attr_1[bonus_5][2], attr_1[bonus_5][3]) pc.setqf("bonus",attr_1[bonus_5][4]) pc.change_gold(-precio_attr_1) say_title("Bonus4")--------------------------------------- local bonus_6 = select_table(attr_11) if pc.get_gold()< precio_attr_1 then say("Yang insuficiente") return end if pc.getqf("bonus")== attr_1[bonus_6][4] then notice("El objeto ya tiene este bonus") else pc.setqf("bonus",0) item.set_value(3, attr_1[bonus_6][2], attr_1[bonus_6][3]) pc.setqf("bonus",attr_1[bonus_6][4]) pc.change_gold(-precio_attr_1) end end end end end end end Shang 1 Quote Link to comment Share on other sites More sharing options...
Shang Posted June 27, 2018 Report Share Posted June 27, 2018 Haciendo búsquedas con un for (con return en el) que malo el código. PACI and Dilong 1 1 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.