Jump to content

ZyuX

Inactive Member
  • Posts

    58
  • Joined

  • Last visited

  • Feedback

    0%

Everything posted by ZyuX

  1. Yes, all yes. It's added before the NULL,NULL, and yes I saved all changes.
  2. This is the implementation in questlua_pc.cpp int pc_get_mount(lua_State* L) { LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr(); lua_pushnumber(L, ch->GetMountVnum()); return 1; }
  3. And I should to add in quest_functions. Right? EDIT: pc.get_mount is already in quest_function.
  4. Hello, I got a problem with get_mount function. It's added in queslua_pc.cpp and quest_function. SYSERR: Jan 7 15:36:31 :: RunState: LUA_ERROR: [string "mount"]:2: attempt to call field `get_mount' (a nil value) SYSERR: Jan 7 15:36:31 :: WriteRunningStateToSyserr: LUA_ERROR: quest mount.start click Quest: quest mount begin state __FUNC__ begin function data() return { -- mounts -- Note: Mounts have bonus from quest, make sure you remove their bonus from item_proto and they are type 18 -- [item vnum] = {first mob vnum,second mob vnum,bonus id,bonus value}, -- Note: You can find bonus variables in questlib.lua -- Note: Second mob vnum normally is the same with first but if you have errors in server syserr with pet motions for example lion you need to fix the folder with mob like I did and put different mob vnum like i did for lion (20212 - 29212) [71125] = {20209,20209, {{apply.ATTBONUS_MONSTER,20},}, }, [71126] = {20210,20210, {{apply.ATTBONUS_MONSTER,10},{apply.MAX_HP,1000},}, }, [71127] = {20211,20211, {{apply.ATTBONUS_MONSTER,10},{apply.IMMUNE_STUN,1},}, }, [71128] = {20212,29212, {{apply.ATTBONUS_MONSTER,10},{apply.STEAL_HP,10},}, }, -- pets -- Note: pets have bonus from item_proto -- [item vnum] = {leave this 0,mob vnum}, [53003] = {0,34003}, [53010] = {0,34008}, [53011] = {0,34007}, [53012] = {0,34005}, [53013] = {0,34006}, [53017] = {0,34016}, } end function get_timer_sec() return 2 end -- anti spam time function get_ride_sec() return 1800 end -- how much seconds you want to be mounted, best time is 30 minute (1800s), after the time is finished player is unmounted automatic function is_only_pet(arg1,arg2) if arg2 and arg1 == 0 then return true else return false end end function run_from_far() return false end function npc_to_item(vnum) local found = 0 for k,v in pairs(mount.data()) do if v[1] == vnum then found = k break end end return found end function check_map() if pc.get_map_index() == 113 then return true end return false end function summon_pet(data) if mount.check_map() then return end if data[2] and data[1] and data[2] != data[1] then if data[2] == 0 then return end -- fix pet.summon(data[2], string.format("'s %s",mob_name(data[2])), mount.run_from_far()) else if data[1] == 0 then return end -- fix pet.summon(data[1], string.format("'s %s",mob_name(data[1])), mount.run_from_far()) end end function mount(itemVnum,itemId) local data = mount.data()[itemVnum] -- mount begins if not mount.is_only_pet(data[1],data[2]) then if pc.is_polymorphed() then syschat("Nu poti calari in timp ce esti transformat") return end if horse.is_riding() == true then syschat("Deja calaresti") return end if horse.is_summon() then horse.unsummon() end if pc.is_mount(data[1]) == true then pc.unmount() cleartimer("bugcheck") if mount.check_map() then return end if pet.is_summon(data[1]) == false then mount.summon_pet(data) -- state save in cache if not NEW_MOUNT_STATES[pc.get_name()] then table.insert(NEW_MOUNT_STATES,pc.get_name()) end NEW_MOUNT_STATES[pc.get_name()] = {{data[1],data[2]},itemId} end return end if pc.is_mount() and pc.is_mount(data[1]) == false then --if pc.is_gm() then syschat(string.format("Schimbare %s -> %s",mob_name(pc.get_mount()),mob_name(data[1]))) --end pc.unmount() cleartimer("bugcheck") if pet.is_summon(pc.get_mount()) == true then pet.unsummon(pc.get_mount()) end -- state save in cache if NEW_MOUNT_STATES[pc.get_name()] then NEW_MOUNT_STATES[pc.get_name()] = {{0,0},0} end end if NEW_MOUNT_STATES[pc.get_name()] then if NEW_MOUNT_STATES[pc.get_name()][1][2] and pet.is_summon(NEW_MOUNT_STATES[pc.get_name()][1][2]) == true then pet.unsummon(NEW_MOUNT_STATES[pc.get_name()][1][2]) -- state save in cache if NEW_MOUNT_STATES[pc.get_name()] then NEW_MOUNT_STATES[pc.get_name()] = {{0,0},0} end end end if mount.check_map() then return end pc.mount(data[1], mount.get_ride_sec()) -- bonus give for each in data[3] do pc.mount_bonus(data[3][each][1],data[3][each][2],mount.get_ride_sec()) end cleartimer("bugcheck") loop_timer("bugcheck", mount.get_timer_sec()) else local limit = 0 if NEW_MOUNT_STATES[pc.get_name()] and NEW_MOUNT_STATES[pc.get_name()][1][2] and pet.is_summon(NEW_MOUNT_STATES[pc.get_name()][1][2]) then limit = 1 end -- pet begins if pet.is_summon(data[2]) == false and pet.count_summoned()-limit >= 1 then chat("Nu poti invoca mai multe animale") return end if pet.is_summon(data[2]) == false then if data[2] == 0 then return end -- fix pet.summon(data[2], string.format("'s %s",mob_name(data[2])), mount.run_from_far()) -- state save in cache if not NEW_PET_STATES[pc.get_name()] then table.insert(NEW_PET_STATES,pc.get_name()) end NEW_PET_STATES[pc.get_name()] = {item.get_id(),data[2]} return else pet.unsummon(data[2]) end end end end state start begin -- add your vnums here too ... when 71125.use or 71126.use or 71127.use or 71128.use or 53003.use or 53010.use or 53011.use or 53012.use or 53013.use or 53017.use with mount.data()[item.vnum] begin -- anti spam start if not lastPulse then lastPulse = get_time() end if not lastPulseNumber then lastPulseNumber = 0 end if (get_time() - lastPulse <= 1) then if lastPulseNumber >= 2 then chat("Anti spam blocked you my friend.") return end lastPulseNumber = lastPulseNumber + 1 else lastPulseNumber = lastPulseNumber - 1 end lastPulse = get_time() -- anti spam end mount.mount(item.vnum,item.get_id()) end when login begin if mount.check_map() then return end if NEW_MOUNT_STATES[pc.get_name()] and NEW_MOUNT_STATES[pc.get_name()][1][2] and NEW_MOUNT_STATES[pc.get_name()][2] then local enable_timer = true --syschat(string.format("%d %d",NEW_MOUNT_STATES[pc.get_name()][1][2],NEW_MOUNT_STATES[pc.get_name()][2])) if not mount.is_only_pet(NEW_MOUNT_STATES[pc.get_name()][1][1],NEW_MOUNT_STATES[pc.get_name()][1][2]) then --syschat(string.format("%d %d",NEW_MOUNT_STATES[pc.get_name()][2],NEW_MOUNT_STATES[pc.get_name()][1][2])) item.select(NEW_MOUNT_STATES[pc.get_name()][2]) mount.summon_pet(NEW_MOUNT_STATES[pc.get_name()][1]) enable_timer = true end if enable_timer then loop_timer("bugcheck", mount.get_timer_sec()) end end if NEW_PET_STATES[pc.get_name()] and NEW_PET_STATES[pc.get_name()][1] and NEW_PET_STATES[pc.get_name()][2] then item.select(NEW_PET_STATES[pc.get_name()][1]) mount.summon_pet(NEW_PET_STATES[pc.get_name()]) end end when logout begin if mount.check_map() then return end if NEW_PET_STATES[pc.get_name()] then if pet.is_summon(NEW_PET_STATES[pc.get_name()][2]) == false then NEW_PET_STATES[pc.get_name()] = {0,0} end end if NEW_MOUNT_STATES[pc.get_name()] then if pet.is_summon(NEW_MOUNT_STATES[pc.get_name()][1][2]) == false then NEW_MOUNT_STATES[pc.get_name()] = {{0,0},0} end end end when bugcheck.timer begin -- to check if player still have the item in inventory while mounted --chat("checking") if pc.is_mount() then if pc.count_item(mount.npc_to_item(pc.get_mount())) == 0 then pc.unmount() cleartimer("bugcheck") end else cleartimer("bugcheck") end end end end
  5. For second bug, do txt like this: 71124 ނضյ ITEM_QUEST 0 1 NONE NONE NONE 0 0 0 0 0 LIMIT_NONE 0 LIMIT_NONE 0 APPLY_NONE 0 APPLY_NONE 0 APPLY_NONE 0 1 0 0 0 0 0 0 0 0
  6. Yes, I added it. Maybe not right querry?
  7. Don't work. Will summon the horse after login / teleport. Thank you TIger. I appreciate.
  8. Ok, thank you. I appreciate your work, but I want to make mount like a horse.
  9. It does not work, the mount does not stand next to me.
  10. quest mount_system begin state start begin when 71124.use begin horse.set_appearance(20114) if pc.is_polymorphed() then syschat("Nu poti calarii cat esti transformat.") elseif pc.is_riding() then syschat("Nu poti invoca un mount cat timp calaresti!") else if true == horse.is_summon() then horse.unsummon() else horse.summon() end end end end end @Abel(Tiger)
  11. Same, but if I write /effect 25 - 26, work. I think sash red effect with index 26 and 27. EDIT: Tell me please where I need to see index, in InstanceBase.h?
  12. Hello guys, I have a big problem with effect when I equip sash. I removed the old system (acce) and added new system (sash by lent). Everything is OK except the effect, it does not appear to me. I have checked the files many times and I have no idea what it can be. Syserr: 27 는 없는 스페셜 이펙트 번호입니다.TPacketGCSpecialEffect (when I put equip sash)
  13. Hello, I have a problem with bank from offline shop without yang limit. I put in the shop, an item with 99999999999 yang, it is nice, good, the shop was created. I get out of the account I made the shop and with another account buy the item, the money gets me, but when I go to the other account to check the bank, I have 0 yang.
  14. Is mainline_release clean. I don't edited nothing in source.
  15. I tried to compile mainline_release clean, and I have that erors: char_item.cpp:4791: error: duplicate case value char_item.cpp:4526: error: previously used here char_item.cpp:4849: error: duplicate case value char_item.cpp:4521: error: previously used here char_item.cpp:4884: error: duplicate case value char_item.cpp:4518: error: previously used here char_item.cpp:4885: error: duplicate case value char_item.cpp:4520: error: previously used here char_item.cpp:4926: error: 'item2' was not declared in this scope char_item.cpp:4962: error: duplicate case value char_item.cpp:2200: error: previously used here char_item.cpp:5000: error: duplicate case value char_item.cpp:2061: error: previously used here char_item.cpp:5069: error: break statement not within loop or switch char_item.cpp:5071: error: case label 'ITEM_METIN' not within a switch statement char_item.cpp:5150: error: break statement not within loop or switch char_item.cpp:5152: error: case label 'ITEM_AUTOUSE' not within a switch statement char_item.cpp:5153: error: case label 'ITEM_MATERIAL' not within a switch statement char_item.cpp:5154: error: case label 'ITEM_SPECIAL' not within a switch statement char_item.cpp:5155: error: case label 'ITEM_TOOL' not within a switch statement char_item.cpp:5156: error: case label 'ITEM_LOTTERY' not within a switch statement char_item.cpp:5157: error: break statement not within loop or switch char_item.cpp:5159: error: case label 'ITEM_TOTEM' not within a switch statement char_item.cpp:5164: error: break statement not within loop or switch char_item.cpp:5166: error: case label 'ITEM_BLEND' not within a switch statement char_item.cpp:5172: warning: comparison between signed and unsigned integer expressions char_item.cpp:5198: error: break statement not within loop or switch char_item.cpp:5199: error: case label 'ITEM_EXTRACT' not within a switch statement char_item.cpp:5224: error: break statement not within loop or switch char_item.cpp:5226: error: case label 'ITEM_NONE' not within a switch statement char_item.cpp:5228: error: break statement not within loop or switch char_item.cpp:5230: error: case label not within a switch statement char_item.cpp: At global scope: char_item.cpp:5235: error: expected unqualified-id before 'return' char_item.cpp:5236: error: expected declaration before '}' token
  16. I don't edited my post, it is so only pulled EN: front. (Sorry for my english) I need to find the key to extracting item_proto since been changed.
  17. I think I have done nothing wrong, I did not break the rules.
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.