Metin2Place 30 Posted February 26, 2020 Share Posted February 26, 2020 Hello, I am looking for a quest for the mounts with multiple bonuses. Atm I have this quest for the mounts with 1 bonus. ------------------------------- -- SERVERFILE BY HOPE v2 ------------------------------- quest ride begin state start begin function Ride( vnum, remain_time ) ride_info = { [71114] = { 20110, 5*60, apply.DEF_GRADE_BONUS, 75, 75, true }, [71115] = { 20110, item.get_socket(2)*60, apply.DEF_GRADE_BONUS, 100, 75, false }, [71116] = { 20111, 5*60, apply.DEF_GRADE_BONUS, 100, 80, true }, [71117] = { 20111, item.get_socket(2)*60, apply.DEF_GRADE_BONUS, 150, 80, false }, [71118] = { 20112, 5*60, apply.DEF_GRADE_BONUS, 125, 85, true }, [71119] = { 20112, item.get_socket(2)*60, apply.DEF_GRADE_BONUS, 200, 85, false }, [71120] = { 20113, 5*60, apply.ATT_GRADE_BONUS, 200, 85, true }, [71121] = { 20113, item.get_socket(2)*60, apply.ATT_GRADE_BONUS, 300, 85, false }, [71124] = { 20114, item.get_socket(2)*60, apply.EXP_DOUBLE_BONUS, 20, 1, false }, [71125] = { 20115, item.get_socket(2)*60, apply.ATTBONUS_MONSTER, 20, 20, false }, [71126] = { 20116, item.get_socket(2)*60, apply.DEF_GRADE_BONUS, 200, 85, false }, [71127] = { 20117, item.get_socket(2)*60, apply.CRITICAL_PCT, 10, 20, false }, [71128] = { 20118, item.get_socket(2)*60, apply.MALL_DEFBONUS, 10, 20, false }, [71131] = { 20119, item.get_socket(2)*60, apply.MOV_SPEED, 60, 1, false }, [71132] = { 20119, item.get_socket(2)*60, apply.MOV_SPEED, 60, 1, false }, [71133] = { 20119, item.get_socket(2)*60, apply.MOV_SPEED, 60, 1, false }, [71134] = { 20119, item.get_socket(2)*60, apply.MOV_SPEED, 60, 1, false }, [20233] = { 20432, item.get_socket(2)*60, apply.MOV_SPEED, 60, 1, false }, [71161] = { 20219, item.get_socket(2)*60, apply.MOV_SPEED, 60, 1, false, false, false}, [71164] = { 20220, item.get_socket(2)*60, apply.MOV_SPEED, 60, 1, false, false, false}, [71165] = { 20221, item.get_socket(2)*60, apply.MOV_SPEED, 60, 1, false, false, false}, [71166] = { 20222, item.get_socket(2)*60, apply.MOV_SPEED, 60, 1, false, false, false}, [71171] = { 20227, item.get_socket(2)*60, apply.MOV_SPEED, 60, 1, false, false, false}, [71172] = { 20226, item.get_socket(2)*60, apply.MOV_SPEED, 60, 1, false, false, false}, [71176] = { 20231, item.get_socket(2)*60, apply.MOV_SPEED, 60, 1, false, false, false}, [71177] = { 20232, item.get_socket(2)*60, apply.MOV_SPEED, 60, 1, false, false, false}, } if pc.level < ride_info[vnum][5] then syschat("Nivelul tau este prea mic.") else if 112 == pc.get_map_index() then return end if ride_info[vnum][2] == 0 and remain_time != 0 then pc.mount( ride_info[vnum][1], remain_time*60 ) pc.mount_bonus( ride_info[vnum][3], ride_info[vnum][4], remain_time*60 ) else pc.mount( ride_info[vnum][1], ride_info[vnum][2] ) pc.mount_bonus( ride_info[vnum][3], ride_info[vnum][4], ride_info[vnum][2] ) end if true == ride_info[vnum][6] then pc.remove_item(vnum, 1) end end end when login begin local vnum, remain_time = pc.get_special_ride_vnum() if vnum <= 71113 or vnum >71121 then return end if 0 != vnum then ride.Ride(vnum, remain_time) end end when 71114.use or 71115.use or 71116.use or 71117.use or 71118.use or 71119.use or 71120.use or 71121.use or 71171.use or 71172.use or 71161.use or 71164.use or 71165.use or 71166.use or 71131.use or 71132.use or 71133.use or 71134.use or 71124.use or 71125.use or 71126.use or 71127.use or 71128.use or 20233.use or 71176.use or 71177.use begin if pc.is_polymorphed()==true then syschat("Nu poti calari cât timp esti transformat.") pc.remove_polymorph() return elseif pc.get_map_index()== 113 or pc.get_map_index()== 114 or pc.get_map_index()== 1100000 then syschat("Nu poti calari in aceasta harta.") return elseif false == pc.is_riding() then if true == horse.is_summon() then horse.unsummon() end ride.Ride(item.vnum, 0) else syschat("Deja calaresti un animal.") end end when login with pc.get_map_index()== 1100000 begin if true == pc.is_riding() then horse.unride() horse.unsummon() end end end end Link to comment Share on other sites More sharing options...
Premium Syreldar 1872 Posted February 27, 2020 Premium Share Posted February 27, 2020 when login with pc.get_map_index()== 1100000 begin if true == pc.is_riding() then horse.unride() horse.unsummon() end end You don't know how dungeon instances work?That is only going to work for the very first instance you create. "Nothing's free in this life. Ignorant people have an obligation to make up for their ignorance by paying those who help them. Either you got the brains or cash, if you lack both you're useless." Syreldar Link to comment Share on other sites More sharing options...
Metin2Place 30 Posted February 27, 2020 Author Share Posted February 27, 2020 3 hours ago, Syreldar said: when login with pc.get_map_index()== 1100000 begin if true == pc.is_riding() then horse.unride() horse.unsummon() end end You don't know how dungeon instances work?That is only going to work for the very first instance you create. That's not the problem I have. Link to comment Share on other sites More sharing options...
Premium Syreldar 1872 Posted February 27, 2020 Premium Share Posted February 27, 2020 (edited) 15 minutes ago, Metin2Place said: That's not the problem I have. Well it depends wether or not the pc.mount_bonus function allows the player to have multiple AFFECT_MOUNT_BONUS, which if I remember correctly is not allowed. But, assuming it does allow it and i'm just not remembering correctly, turn the bonus arg from a simple int into a table, then iterate through the same table depending on what mount you're using and call the pc.mount_bonus function for each bonus you put inside the table, enjoy. Edited February 27, 2020 by Syreldar "Nothing's free in this life. Ignorant people have an obligation to make up for their ignorance by paying those who help them. Either you got the brains or cash, if you lack both you're useless." Syreldar Link to comment Share on other sites More sharing options...
Metin2Place 30 Posted February 27, 2020 Author Share Posted February 27, 2020 5 minutes ago, Syreldar said: Well it depends wether or not the pc_mount_bonus function allows the player to have multiple AFFECT_MOUNT_BONUS. Assuming it does, turn the bonus arg from a simple int into a table, then iterate through the same table and assign a mount bonus for each one, very easy. I don't think it does. int pc_mount_bonus(lua_State* L) { BYTE applyOn = static_cast<BYTE>(lua_tonumber(L, 1)); long value = static_cast<long>(lua_tonumber(L, 2)); long duration = static_cast<long>(lua_tonumber(L, 3)); LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr(); if( NULL != ch ) { ch->RemoveAffect(AFFECT_MOUNT_BONUS); ch->AddAffect(AFFECT_MOUNT_BONUS, aApplyInfo[applyOn].bPointType, value, AFF_NONE, duration, 0, false); } return 0; } Link to comment Share on other sites More sharing options...
Premium Syreldar 1872 Posted February 27, 2020 Premium Share Posted February 27, 2020 (edited) 10 minutes ago, Metin2Place said: I don't think it does. int pc_mount_bonus(lua_State* L) { BYTE applyOn = static_cast<BYTE>(lua_tonumber(L, 1)); long value = static_cast<long>(lua_tonumber(L, 2)); long duration = static_cast<long>(lua_tonumber(L, 3)); LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr(); if( NULL != ch ) { ch->RemoveAffect(AFFECT_MOUNT_BONUS); ch->AddAffect(AFFECT_MOUNT_BONUS, aApplyInfo[applyOn].bPointType, value, AFF_NONE, duration, 0, false); } return 0; } Then it's not possible to do it via quest without any source changes, unless you hardcode it with affect.add_collect and affect.remove_collect on dismount, but considering that there is no trigger for that, it would simply not work properly; you're not the only one that can make you dismount: there are many cases. - Death (also not checkable via quest unless you have the die trigger like on martysama's sources). - New login or Teleport on new map (the mount isn't immediately re-equipped, so it would require a timer) - etc. But even if you somehow hardcoded all the cases, the affect_add_collect works with keys and values. This means that if you somehow got another bonus of the same type and value which has been given to you via affect.add_collect, the other bonus will be gone forever. Have you ever thought about why does the Lv30 Biologist mission give you 10% Movement speed and the Lv70 one gives you 11%? Well, that's the reason. Edited February 27, 2020 by Syreldar "Nothing's free in this life. Ignorant people have an obligation to make up for their ignorance by paying those who help them. Either you got the brains or cash, if you lack both you're useless." Syreldar Link to comment Share on other sites More sharing options...
Metin2Place 30 Posted February 27, 2020 Author Share Posted February 27, 2020 Or if someone show me how to make the seals unequip when die and add the bonuses in item_proto. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now