Jump to content

kyleflow

Advanced members
  • Content Count

    230
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by kyleflow

  1. Sorry AG, since this is your 1st reply, I did not know what you have explain previously. Seem like the code mentioned above is a SC script not a lua type script. Or did you try to explain that I can load hook.lua through initial.lua files ? I don't have SC and I try not to involve myself with SC since my knowledge is not there yet. Can you details out more about what you are trying to show there. Thanks AG
  2. How do u load files before other files load. Where the location of it.
  3. Same as the purpose of the question above, I yet to implement it. So I don't know personally if it does crash the GS Hope someone can explain it to us
  4. I see some question about hook and serialize but none sharing the actual clear step on how to implement it. I see that I need to copy paste the hook files and made it as hook.lua but the loading part here is confusing. I did try to load it by putting it inside other files and called it by dofile but it will not load on my GS. And some says put it inside SDK. I don't know how to do so. Can some one do a step by step on how to implement hook and serialize files. Like the location of the files, the loading location and its called function. Thanks.
  5. Anyone know how to utilize AWS free tier? Is it enough to be use as PKO vps? I did made an account there but unable to set it up since my region does not have space. Need to change region before able to create and test it. Can in work in windows mode? or ubuntu free tier can utilize SQL server?
  6. I know I made this worked before, but after issues with my gem, I forgot to back up the setup when I made a new server files. Do u know why I don't get reward after completing the contract. The current script for it as per below. ----------------------------------------------------------------------------------------------------- --------------------------------------- ** Contract System ** --------------------------------------- ----------------------------------------------------------------------------------------------------- --------------------------------- ** Author: V3ct0r @ PKOdev.NET ** --------------------------------- ------------------------------- ** Revision: Angelix @ PKOdev.NET ** ------------------------------- ----------------------------------------------------------------------------------------------------- ----- Version: 1.0 (01/12/2022) @ V3ct0r ----- * Public Version. ----- Version: 1.1 (05/11/2022) @ Angelix ----- * Change script structure. ----- * Added random world contract creation. ----- * Modified reward handler to have several different rewards. ----------------------------------------------------------------------------------------------------- ContractSys = ContractSys or {Conf = {World = {}, Maps = {}}, Text = {}, Attr = {}, Monsters = {}, Rewards = {Maps = {}, Specific = {}}} ContractSys.Conf.Enabled = true -- Enable/disable the system. ContractSys.Conf.ItemID = 07402 -- ItemID used in system. ContractSys.Conf.ItemType = 99 -- Item's type used. ContractSys.Conf.Limit = 1 -- Maximum amount of contracts a player can have at a single time. ContractSys.Conf.Random = false -- Update only one contract even if they have several contracts for the same monster? If 'true', it will be at random. If 'false', it will update all. ContractSys.Conf.World.Enabled = true -- Enable/disable getting random contracts from any place. ContractSys.Conf.Maps['default'] = {Allow = false, Probability = 10} ContractSys.Conf.Maps['garner'] = {Allow = true, Probability = 100} ContractSys.Conf.Maps['magicsea'] = {Allow = false, Probability = 10} ContractSys.Conf.Maps['darkblue'] = {Allow = false, Probability = 10} ContractSys.Conf.Maps['abandonedcity'] = {Allow = false, Probability = 10} ContractSys.Conf.Maps['darkswamp'] = {Allow = false, Probability = 10} ContractSys.Conf.Maps['puzzleworld'] = {Allow = false, Probability = 10} ContractSys.Conf.Maps['abandonedcity2'] = ContractSys.Conf.Maps['abandonedcity'] ContractSys.Conf.Maps['abandonedcity3'] = ContractSys.Conf.Maps['abandonedcity'] ContractSys.Conf.Maps['puzzleworld2'] = ContractSys.Conf.Maps['puzzleworld'] ContractSys.Text.Received = 'Obtained a contract to hunt %d x [%s]!' ContractSys.Text.Remaining = 'Contract: Remaining %s to hunt: %d / %d!' ContractSys.Text.Complete = 'Contract to hunt [%s] is complete!' ContractSys.Text.Unfinished = 'Contract is not complete yet. Killed [%s]: (%d / %d).' ContractSys.Text.Completed = 'You have successfully completed the contract, congratulations!' ContractSys.Text.LimitReach = 'You cannot have more than %d contracts active at the same time!' -- Monster Configuration. ContractSys.Monsters.General = { {Allow = true, ID = 103, Min = 01, Max = 02, Rate = 001}, -- Forest Spirit {Allow = true, ID = 075, Min = 01, Max = 02, Rate = 001}, -- Mystic Shrub {Allow = true, ID = 185, Min = 01, Max = 02, Rate = 001}, -- Mystic Flower } ContractSys.Monsters['abandonedcity'] = { {Allow = true, ID = 720, Min = 10, Max = 15, Rate = 080}, -- Elite Wailing Warrior {Allow = true, ID = 721, Min = 10, Max = 15, Rate = 080}, -- Wailing Marksman {Allow = true, ID = 722, Min = 10, Max = 15, Rate = 080}, -- Cursed Mummy {Allow = true, ID = 723, Min = 10, Max = 15, Rate = 080}, -- Crazy Mummy {Allow = true, ID = 686, Min = 05, Max = 10, Rate = 040}, -- Sorrow Warrior {Allow = true, ID = 687, Min = 05, Max = 10, Rate = 040}, -- Wailing Warrior {Allow = true, ID = 688, Min = 05, Max = 10, Rate = 040}, -- Wailing Archer {Allow = true, ID = 689, Min = 05, Max = 10, Rate = 040}, -- Sorrow Archer {Allow = true, ID = 690, Min = 01, Max = 01, Rate = 020}, -- Sorrow Captain {Allow = true, ID = 691, Min = 01, Max = 01, Rate = 020}, -- Wailing Captain {Allow = true, ID = 692, Min = 01, Max = 01, Rate = 020}, -- Wailing Archer Captain {Allow = true, ID = 693, Min = 01, Max = 01, Rate = 020}, -- Sorrow Archer Captain {Allow = true, ID = 712, Min = 01, Max = 02, Rate = 010}, -- Abandoned Chest 1 {Allow = true, ID = 713, Min = 01, Max = 02, Rate = 010}, -- Abandoned Chest 2 {Allow = true, ID = 714, Min = 01, Max = 02, Rate = 010}, -- Abandoned Chest 3 {Allow = true, ID = 673, Min = 01, Max = 01, Rate = 005}, -- Death Knight } ContractSys.Monsters['darkswamp'] = { {Allow = true, ID = 695, Min = 10, Max = 30, Rate = 080}, -- Swamp Bog {Allow = true, ID = 696, Min = 10, Max = 30, Rate = 080}, -- Swamp Man {Allow = true, ID = 697, Min = 10, Max = 30, Rate = 080}, -- Swamp Watcher {Allow = true, ID = 698, Min = 10, Max = 30, Rate = 080}, -- Swamp Warden {Allow = true, ID = 701, Min = 10, Max = 30, Rate = 040}, -- Jungle Guardian {Allow = true, ID = 706, Min = 01, Max = 01, Rate = 020}, -- Master Swamp Bog {Allow = true, ID = 707, Min = 01, Max = 01, Rate = 020}, -- Swamp Champion {Allow = true, ID = 708, Min = 01, Max = 01, Rate = 020}, -- Master Swamp Watcher {Allow = true, ID = 709, Min = 01, Max = 02, Rate = 010}, -- Obscure Chest 1 {Allow = true, ID = 710, Min = 01, Max = 02, Rate = 010}, -- Obscure Chest 2 {Allow = true, ID = 711, Min = 01, Max = 02, Rate = 010}, -- Obscure Chest 3 {Allow = true, ID = 675, Min = 01, Max = 01, Rate = 005}, -- Huge Mud Monster } ContractSys.Monsters['puzzleworld'] = { {Allow = true, ID = 669, Min = 10, Max = 30, Rate = 080}, -- Imaginary Snow Doll {Allow = true, ID = 670, Min = 10, Max = 30, Rate = 080}, -- Snow Doll Spirit {Allow = true, ID = 671, Min = 10, Max = 30, Rate = 040}, -- Evil Snow Doll Spirit {Allow = true, ID = 672, Min = 10, Max = 30, Rate = 040}, -- Confused Snow Doll {Allow = true, ID = 725, Min = 10, Max = 30, Rate = 020}, -- Demonic Snowman {Allow = true, ID = 726, Min = 01, Max = 01, Rate = 020}, -- Demonic Yeti {Allow = true, ID = 715, Min = 01, Max = 02, Rate = 010}, -- Chest of Demonic World 1 {Allow = true, ID = 716, Min = 01, Max = 02, Rate = 010}, -- Chest of Demonic World 2 {Allow = true, ID = 679, Min = 01, Max = 01, Rate = 005}, -- Wandering Soul {Allow = true, ID = 678, Min = 01, Max = 01, Rate = 005}, -- Snowman Warlord } ContractSys.Monsters['abandonedcity2'] = ContractSys.Monsters['abandonedcity'] ContractSys.Monsters['abandonedcity3'] = ContractSys.Monsters['abandonedcity'] ContractSys.Monsters['puzzleworld2'] = ContractSys.Monsters['puzzleworld'] -- When selecting a reward to handle out, it will first look if there's a monster specified in the "Specific" table. -- If no monster is found, it will then look through the "Maps" table, if none is found, it will choose a reward from "General". ContractSys.Rewards.General = { {Allow = true, Gold = 0, ID = 00860, Min = 01, Max = 01, Quality = 101, Rate = 010}, -- Gem of the Wind {Allow = true, Gold = 0, ID = 00861, Min = 01, Max = 01, Quality = 101, Rate = 010}, -- Gem of Striking {Allow = true, Gold = 0, ID = 00862, Min = 01, Max = 01, Quality = 101, Rate = 010}, -- Gem of Colossus {Allow = true, Gold = 0, ID = 00863, Min = 01, Max = 01, Quality = 101, Rate = 010}, -- Gem of Rage {Allow = true, Gold = 0, ID = 01012, Min = 01, Max = 01, Quality = 101, Rate = 010}, -- Gem of Soul } ContractSys.Rewards.Maps['abandonedcity'] = { {Allow = true, Gold = 0, ID = 00860, Min = 01, Max = 01, Quality = 101, Rate = 010}, -- Gem of the Wind {Allow = true, Gold = 0, ID = 00861, Min = 01, Max = 01, Quality = 101, Rate = 010}, -- Gem of Striking {Allow = true, Gold = 0, ID = 00862, Min = 01, Max = 01, Quality = 101, Rate = 010}, -- Gem of Colossus {Allow = true, Gold = 0, ID = 00863, Min = 01, Max = 01, Quality = 101, Rate = 010}, -- Gem of Rage {Allow = true, Gold = 0, ID = 01012, Min = 01, Max = 01, Quality = 101, Rate = 010}, -- Gem of Soul } ContractSys.Rewards.Maps['abandonedcity2'] = ContractSys.Rewards.Maps['abandonedcity'] ContractSys.Rewards.Maps['abandonedcity3'] = ContractSys.Rewards.Maps['abandonedcity'] ContractSys.Rewards.Maps['darkswamp'] = ContractSys.Rewards.Maps['abandonedcity'] ContractSys.Rewards.Maps['puzzleworld'] = ContractSys.Rewards.Maps['abandonedcity'] ContractSys.Rewards.Maps['puzzleworld2'] = ContractSys.Rewards.Maps['abandonedcity'] ContractSys.Rewards.Specific[0673] = { {Allow = true, Gold = 0, ID = 00860, Min = 01, Max = 01, Quality = 101, Rate = 001}, -- Gem of the Wind {Allow = true, Gold = 0, ID = 00861, Min = 01, Max = 01, Quality = 101, Rate = 001}, -- Gem of Striking {Allow = true, Gold = 0, ID = 00862, Min = 01, Max = 01, Quality = 101, Rate = 001}, -- Gem of Colossus {Allow = true, Gold = 0, ID = 00863, Min = 01, Max = 01, Quality = 101, Rate = 001}, -- Gem of Rage {Allow = true, Gold = 0, ID = 01012, Min = 01, Max = 01, Quality = 101, Rate = 001}, -- Gem of Soul {Allow = true, Gold = 0, ID = 03422, Min = 01, Max = 01, Quality = 004, Rate = 001}, -- Chest of Forsaken City {Allow = true, Gold = 0, ID = 00938, Min = 01, Max = 01, Quality = 004, Rate = 001}, -- Goddess's Favor } ContractSys.Rewards.Specific[0675] = { {Allow = true, Gold = 0, ID = 00860, Min = 01, Max = 01, Quality = 101, Rate = 001}, -- Gem of the Wind {Allow = true, Gold = 0, ID = 00861, Min = 01, Max = 01, Quality = 101, Rate = 001}, -- Gem of Striking {Allow = true, Gold = 0, ID = 00862, Min = 01, Max = 01, Quality = 101, Rate = 001}, -- Gem of Colossus {Allow = true, Gold = 0, ID = 00863, Min = 01, Max = 01, Quality = 101, Rate = 001}, -- Gem of Rage {Allow = true, Gold = 0, ID = 01012, Min = 01, Max = 01, Quality = 101, Rate = 001}, -- Gem of Soul {Allow = true, Gold = 0, ID = 03423, Min = 01, Max = 01, Quality = 004, Rate = 001}, -- Chest of Dark Swamp {Allow = true, Gold = 0, ID = 00938, Min = 01, Max = 01, Quality = 004, Rate = 001}, -- Goddess's Favor } ContractSys.Rewards.Specific[0679] = { {Allow = true, Gold = 0, ID = 00860, Min = 01, Max = 01, Quality = 101, Rate = 001}, -- Gem of the Wind {Allow = true, Gold = 0, ID = 00861, Min = 01, Max = 01, Quality = 101, Rate = 001}, -- Gem of Striking {Allow = true, Gold = 0, ID = 00862, Min = 01, Max = 01, Quality = 101, Rate = 001}, -- Gem of Colossus {Allow = true, Gold = 0, ID = 00863, Min = 01, Max = 01, Quality = 101, Rate = 001}, -- Gem of Rage {Allow = true, Gold = 0, ID = 01012, Min = 01, Max = 01, Quality = 101, Rate = 001}, -- Gem of Soul {Allow = true, Gold = 0, ID = 03424, Min = 01, Max = 01, Quality = 004, Rate = 001}, -- Chest of Demonic World {Allow = true, Gold = 0, ID = 03458, Min = 01, Max = 01, Quality = 004, Rate = 001}, -- Chest of Enigma } ContractSys.Rewards.Specific[678] = ContractSys.Rewards.Specific[679] ContractSys.RewardHandler = function(Player, Item) local RewardList = ContractSys.Rewards.General Player = TurnToCha(Player) local TargetID = GetItemAttr(Item, ContractSys.Attr.TargetID) local TargetMax = GetItemAttr(Item, ContractSys.Attr.TargetMax) local TargetCur = GetItemAttr(Item, ContractSys.Attr.TargetCur) if ContractSys.Rewards.Specific[TargetID] then RewardList = ContractSys.Rewards.Specific[TargetID] else for MapName, Var in pairs(ContractSys.Monsters) do if MapName ~= 'General' then for _, Monster in pairs(Var) do if Monster.ID == TargetID then RewardList = ContractSys.Rewards.Maps[MapName] end end end end end local VarID, Reward = WeightedRandomnessHandler(RewardList) print(VarID, Reward.ID) if Reward.Gold ~= 0 then AddMoney(Player, 0, Reward.Gold) end if Reward.ID ~= 0 and GetItemName(Reward.ID) ~= 'Unknown' then local Quantity = math.random(Reward.Min, Reward.Max) GiveItem(Player, 0, Reward.ID, math.max(Quantity, 1), (Reward.Quality or 4)) end end --------------------------------------- -- Constants --------------------------------------- ContractSys.Attr.TargetID = ITEMATTR_VAL_STR ContractSys.Attr.TargetMax = ITEMATTR_VAL_AGI ContractSys.Attr.TargetCur = ITEMATTR_VAL_DEX --------------------------------------- -- Hooks --------------------------------------- ContractSys.OriginalCreat_Item = Creat_Item Creat_Item = function(Item, ItemType, ItemLevel, ItemEvent) if ItemType == ContractSys.Conf.ItemType then Reset_item_add() Add_Item_Attr(ContractSys.Attr.TargetID, 0) Add_Item_Attr(ContractSys.Attr.TargetMax, 0) Add_Item_Attr(ContractSys.Attr.TargetCur, 0) return item_add.cnt, item_add.attr[1][1], item_add.attr[1][2], item_add.attr[2][1], item_add.attr[2][2], item_add.attr[3][1], item_add.attr[3][2], item_add.attr[4][1], item_add.attr[4][2], item_add.attr[5][1], item_add.attr[5][2], item_add.attr[6][1], item_add.attr[6][2], item_add.attr[7][1], item_add.attr[7][2] end return ContractSys.OriginalCreat_Item(Item, ItemType, ItemLevel, ItemEvent) end ContractSys.OriginalGetExp_PKM = GetExp_PKM GetExp_PKM = function(Monster, Player) ContractSys.OriginalGetExp_PKM(Monster, Player) if not ContractSys.Conf.Enabled then return end Player = TurnToCha(Player) local MapName = GetChaMapName(Player) local ContractCount = CheckBagItem(Player, ContractSys.Conf.ItemID) if (ContractCount > 0) then local MonsterID = GetChaTypeID(Monster) local Contracts = {} local Count = 0 for Slot = 0, (GetKbCap(Player) - 1), 1 do local Item = GetChaItem(Player, 2, Slot) if GetItemID(Item) == ContractSys.Conf.ItemID and GetItemType(Item) == 99 then local TargetID = GetItemAttr(Item, ContractSys.Attr.TargetID) if MonsterID == TargetID then local TargetCur = GetItemAttr(Item, ContractSys.Attr.TargetCur) local TargetMax = GetItemAttr(Item, ContractSys.Attr.TargetMax) if TargetCur < TargetMax then Count = Count + 1 Contracts[Count] = {Item = Item, Cur = TargetCur, Max = TargetMax } end end end end if Count > 0 then if ContractSys.Conf.Random then local r = math.random(1, Count) Contracts[r].Cur = Contracts[r].Cur + 1 SetItemAttr(Contracts[r].Item, ContractSys.Attr.TargetCur, Contracts[r].Cur) SynChaKitbag(Player, 13) if Contracts[r].Cur < Contracts[r].Max then BickerNotice(Player, string.format(ContractSys.Text.Remaining, GetMonsterName(MonsterID), Contracts[r].Cur, Contracts[r].Max)) else BickerNotice(Player, string.format(ContractSys.Text.Complete, GetMonsterName(MonsterID))) end else for Num, Var in pairs(Contracts) do Var.Cur = Var.Cur + 1 SetItemAttr(Var.Item, ContractSys.Attr.TargetCur, Var.Cur) SynChaKitbag(Player, 13) if Var.Cur < Var.Max then BickerNotice(Player, string.format(ContractSys.Text.Remaining, GetMonsterName(MonsterID), Var.Cur, Var.Max)) else BickerNotice(Player, string.format(ContractSys.Text.Complete, GetMonsterName(MonsterID))) end end end end end if ContractSys.Conf.World.Enabled then if ContractCount >= ContractSys.Conf.Limit then SystemNotice(Player, string.format(ContractSys.Text.LimitReach, ContractSys.Conf.Limit)) return end ContractSys.Conf.Maps[MapName] = ContractSys.Conf.Maps[MapName] or ContractSys.Conf.Maps['default'] local Random = math.random(1, 100) if ContractSys.Conf.Maps[MapName].Allow and Random <= ContractSys.Conf.Maps[MapName].Probability then local ChosenID, Quantity = ContractSys.SelectContract(Player) ContractSys.CreateContract(Player, ChosenID, Quantity) end end end ContractSys.SelectContract = function(Player) local MapName = GetChaMapName(Player) local MonsterList = nil if ContractSys.Monsters[MapName] then MonsterList = ContractSys.Monsters[MapName] else MonsterList = ContractSys.Monsters.General end local _, Monster = WeightedRandomnessHandler(MonsterList) return Monster.ID, math.random(Monster.Min, Monster.Max) end ContractSys.CreateContract = function(Player, TargetID, Amount) if not ContractSys.Conf.Enabled then return LUA_FALSE, nil, 0 end Player = TurnToCha(Player) if KitbagLock(Player, 0) == LUA_FALSE then return LUA_FALSE, nil, 0 end if GetChaFreeBagGridNum(Player) == 0 then return LUA_FALSE, nil, 0 end local r1, r2 = MakeItem(Player, ContractSys.Conf.ItemID, 1, 4) if r1 == 0 then LG("pkodev.Contract", "Can't create the Contract item (id:", ContractSys.Conf.ItemID, ")!") return LUA_FALSE, nil, 0 end local Item = GetChaItem(Player, 2, r2) local SetTargetID = SetItemAttr(Item, ContractSys.Attr.TargetID, TargetID) local SetTargetMax = SetItemAttr(Item, ContractSys.Attr.TargetMax, Amount) local SetTargetCur = SetItemAttr(Item, ContractSys.Attr.TargetCur, 0) if (SetTargetID == 0) or (SetTargetMax == 0) or (SetTargetCur == 0) then LG("pkodev.Contract", "Can't set the Contract data! TargetID = ", SetTargetID, ", Max = ", SetTargetMax, ", Cur = ", SetTargetCur) return LUA_FALSE, Item, r2 end SynChaKitbag(Player, 13) SystemNotice(Player, string.format(ContractSys.Text.Received, Amount, GetMonsterName(TargetID))) return LUA_TRUE, Item, r2 end ItemUse_ContractSys = function(Player, Item) Player = TurnToCha(Player) local TargetID = GetItemAttr(Item, ContractSys.Attr.TargetID) local TargetMax = GetItemAttr(Item, ContractSys.Attr.TargetMax) local TargetCur = GetItemAttr(Item, ContractSys.Attr.TargetCur) if (TargetCur < TargetMax) then SystemNotice(Player, string.format(ContractSys.Text.Unfinished, GetMonsterName(TargetID), TargetCur, TargetMax)) UseItemFailed(Player) return else SystemNotice(Player, ContractSys.Text.Completed) ContractSys.RewardHandler(Player, Item) end end WeightedRandomnessHandler = function(Table) for Num, Thing in pairs(Table) do if Table[Num].Allow == nil then Table[Num].Allow = true end Table[Num].ID = Table[Num].ID or 0 Table[Num].Rate = Table[Num].Rate or 1 end local Sum = 0 for _, Thing in pairs(Table) do if Thing.Allow and Thing.Rate >= 1 then Sum = Sum + Thing.Rate end end local VarID, Choice = nil, nil local Index = math.random() * Sum for Num, Thing in pairs(Table) do if Thing.Allow and Thing.Rate >= 1 then if Index < Thing.Rate then VarID, Choice = Num, Thing break else Index = Index - Thing.Rate end end end return VarID, Choice end Closed* Found the issue
  7. kyleflow

    Create a Quest

    DefineMission( 2020, "Money Mission", 2020) MisBeginTalk( "<t>Want to get money for your growth?.<n><t>Then go outside do some monster killing.<n><t>I will give you the money needed.") MisBeginCondition(LvCheck, ">", 41 ) --MisBeginCondition(HasItem, 0844, 1) MisBeginCondition(NoMission, 2020) MisBeginAction(AddMission, 2020) MisBeginAction(AddTrigger, 20201, TE_KILL, 695, 30 ) MisBeginAction(AddTrigger, 20202, TE_KILL, 697, 30 ) MisBeginAction(AddTrigger, 20203, TE_KILL, 696, 5 ) MisCancelAction(ClearMission, 2020) --MisNeed(MIS_NEED_DESP, "Kill 30 Swamp Bog") MisNeed(MIS_NEED_KILL, 695, 30, 10, 30)--asal semua 10 MisNeed(MIS_NEED_KILL, 697, 30, 20, 30) MisNeed(MIS_NEED_KILL, 696, 5, 30, 5) MisHelpTalk("<t>Go now! For the money!") MisResultTalk("<t>You are quite fast!") MisResultCondition(HasMission, 2020) MisResultCondition(HasFlag, 2020, 39 )--kt sini MisResultCondition(HasFlag, 2020, 49 ) MisResultCondition(HasFlag, 2020, 34 ) --MisResultCondition(HasItem,0844,1) --MisResultAction(TakeItem, 0844,1) MisResultAction(ClearMission,2020) MisResultAction(GiveItem, 854, 1, 4) MisResultBagNeed(1) InitTrigger() TriggerCondition( 1, IsMonster, 695 ) TriggerAction( 1, AddNextFlag, 2020, 10, 10 ) RegCurTrigger(20201) InitTrigger() TriggerCondition( 1, IsMonster, 697 ) TriggerAction( 1, AddNextFlag, 2020, 20, 30 ) RegCurTrigger(20202) InitTrigger() TriggerCondition( 1, IsMonster, 696 ) TriggerAction( 1, AddNextFlag, 2020, 5, ) RegCurTrigger(20203) The Mission Work, since I add some info inside missioninfo.lua AddMisData( 2020 , "Money Mission",1) I'm not sure if this step necessary but it let my quest appear properly like a new quest. The only issue is that, the quest finish after killing some mobs. not meeting the exact amount I decide in the quest. Do anyone know why?
  8. Thanks goodness it got back. Few days prior the failure of the forum, there are a post requesting for donation by the forum owner and I assume at that point, the forum went down due to lack of funding. I was sad for it to go but I just kept checking it months after months. Gladly today I see the forum is up and well and hope it continue that way. Thanks @V3ct0r and team.
  9. PKO 1.36,1.38 is the classic version with the same animation style but more content in 1.38 especially gem and other item and feature. PKO 2 have different animation style and more feature to it, like free exp daily, fortune, and many more. releases of new area also like aurora and etc if im not mistaken. but most people here comfortable with PKO 1.36 and 1.38 if working with client and existing database and better community support. unless if u know how to deal with SRC files, then, any version is good.
  10. As far as I know, if you want to get confirmation when dropping item, you can change it in ItemInfo.txt and compiled it for client. I don't remember which line but there is. Near the stacking amount.
  11. This one, you need to change the limit of your database limit. Based on the forum, you can use modding if you don't have SRC files. Check the modding section. There is a mod to change the table limit.
  12. read that and done that. I simply stop using the files and create things from lucky files. Since any other combination of 1.3x just give me errors on gem and item stats. I know about the steps on client side and done that. It just wont work. Currently with Lucky files. Working wells for my solo time.
  13. @Mdrst bro, I change the location of the script under MakeItem and it worked like a charm. By putting it under the SetParam, the game did not update the value since after i relog, it gave me lv2 item. So thanks.. This is solved. Glad to have your assistance bro. Same goes to @mkhzalehfor indicate which function to work on.
  14. Did not work. I declared the value local r3 and r4 = 0 respectively. and then I put down the script at the instructed location. Same as my tested condition before where the item given is not what I need. the result as picture below. The Ref return lv2, but the unique return lv1, but with your script, the gem lvl from item is not reduced. With my way at least the process reduced the item parameter but still the gem given come out as the same as your script. Did try to declare my Item_ref_lv inside each if loop with 885 and locally introduced = 0. Not working atm
  15. bro @mkhzaleh, the GiveItem function can't be used since its return a parameter or itemtype error. Based on the script, it declared r1 = 0 and r2 = 0, and used that as a parameter to called for MakeItem function. r1,r2 = MakeItem ( role , item_tureID , 1 , 2 ) I don't know why it is declared but never once used locally inside the if loop or any other function. r2 was used to set the new gem parameter after its finished extracting. this is the full function and there are bits and code that I can't seem to get it right. I tried multiples ways and sometimes I get the return gem lv1 and the refining gem the correct level extracted, or I get both gem lv1. So, I need a bit more explanation from you if you may. function getstone_item ( Table ) --Notice("Ronghe_Item") local role = 0 local ItemBag = {} --道具背包位置 local ItemCount = {} --道具数量 local ItemBagCount = {} --道具对象数量 local ItemBag_Num = 0 local ItemCount_Num = 0 local ItemBagCount_Num = 0 local ItemID_Cuihuaji = 0 role , ItemBag , ItemCount , ItemBagCount , ItemBag_Num , ItemCount_Num , ItemBagCount_Num = Read_Table ( Table ) --------取出道具指针 local Item_mainitem = GetChaItem ( role , 2 , ItemBag [0] ) --主装备道具指针 local Item_otheritem = GetChaItem ( role , 2 , ItemBag [1] ) --辅助装备道具指针 --------取道具类型 local ItemType_mainitem = GetItemType ( Item_mainitem ) local ItemType_otheritem = GetItemType ( Item_otheritem ) --------取道具ID local ItemID_mainitem = GetItemID ( Item_mainitem ) local ItemID_otheritem = GetItemID ( Item_otheritem ) --------取道具等级 local Item_mainitem_Lv = GetItemLv ( Item_mainitem ) local Item_otheritem_Lv = GetItemLv ( Item_otheritem ) -------读取装备精炼信息 local Num = GetItemForgeParam ( Item_mainitem , 1 ) Num = TansferNum ( Num ) local lg_Num=Num --SystemNotice( role , "Num=="..Num) local Item_Stone = {} local Item_StoneLv = {} local Item_StoneID = {} -------宝石类型 -- Gem type Item_Stone[0] = GetNum_Part2 ( Num ) Item_Stone[1] = GetNum_Part4 ( Num ) Item_Stone[2] = GetNum_Part6 ( Num ) -------宝石等级 gem grade Item_StoneLv[0] = GetNum_Part3 ( Num ) Item_StoneLv[1] = GetNum_Part5 ( Num ) Item_StoneLv[2] = GetNum_Part7 ( Num ) --------宝石ID==StoneTpye_ID [宝石类型] -- Gem ID==StoneTpye_ID [gem type] Item_StoneID[0] = StoneTpye_ID[Item_Stone[0]] Item_StoneID[1] = StoneTpye_ID[Item_Stone[1]] Item_StoneID[2] = StoneTpye_ID[Item_Stone[2]] local r1 = 0 local r2 = 0 local Item_Lv = 0 local item_tureID=0 ---------取出的宝石道具ID -- The ID of the gem item retrieved if Item_StoneID[0]~=0 then item_tureID = Item_StoneID[0] --Item_Stone[0] = 0 Item_Lv = Item_StoneLv[0] Item_StoneLv[0] = Item_StoneLv[0]-1 if Item_StoneLv[0]==0 then Item_Stone[0] = 0 end elseif Item_StoneID[0]==0 and Item_StoneID[1]~=0 then item_tureID = Item_StoneID[1] --Item_Stone[1] = 0 Item_Lv = Item_StoneLv[1] Item_StoneLv[1] = Item_StoneLv[1]-1 if Item_StoneLv[1]==0 then Item_Stone[1] = 0 end elseif Item_StoneID[0]==0 and Item_StoneID[1]==0 and Item_StoneID[2]~=0 then item_tureID = Item_StoneID[2] --Item_Stone[2] = 0 Item_Lv = Item_StoneLv[2] Item_StoneLv[2] = Item_StoneLv[2]-1 if Item_StoneLv[2]==0 then Item_Stone[2] = 0 end else SystemNotice( role , "Gem Extraction tool ID error") return end r1,r2 = MakeItem ( role , item_tureID , 1 , 2 ) local Item_ture = GetChaItem ( role , 2 , r2 ) ---------取出的宝石指针 gem pointer ---------设置宝石等级 SetItemAttr ( Item_ture , ITEMATTR_VAL_BaoshiLV , Item_Lv ) ----------重设装备精炼属性 -- set gem level Num = SetNum_Part2 ( Num , Item_Stone[0] ) Num = SetNum_Part3 ( Num , Item_StoneLv[0] ) Num = SetNum_Part4 ( Num , Item_Stone[1] ) Num = SetNum_Part5 ( Num , Item_StoneLv[1] ) Num = SetNum_Part6 ( Num , Item_Stone[2] ) Num = SetNum_Part7 ( Num , Item_StoneLv[2] ) SetItemForgeParam ( Item_mainitem , 1 , Num ) --------------LG local cha_name = GetChaDefaultName ( role ) LG( "star_tiqu_lg" ,cha_name, item_tureID , Item_Lv , lg_Num , Num ) local R1 = 0 R1 = RemoveChaItem ( role , ItemID_otheritem , 1 , 2 , ItemBag [1] , 2 , 1 , 0 ) --移除钳子 if R1 == 0 then SystemNotice( role , "moved item failed ") return end end
  16. Tried different compiler for the client side. I also used the files under Ancient Online, the compiler is not working. Used my other compiler, it worked well.
  17. Thanks so much bro. A very nice clean way of helping. Cheers mate
  18. Nah. U just want to dis people up. Thanks for the tips. Good day
  19. Version ? okay its 1.36. now help me solved it? Since you are "senior" here. glad to get your help. and I already mentioned I've read it. So you did simply reply
  20. Can't it simply redirect the gem level read for the item and return the same level of refining gem? I got some ideas but I simply unable to understand it from the script.
  21. Did I mentioned that I already read forge.lua but can't seem to understand it? read 1st before you simply reply.
  22. I've search through inside the forum as much as I can and can't seem to find it. Do you think I simply ask when I don't know ? That harsh of you.
  23. Last UP. Please anyone who are expert on this knows how to do it.
×
×
  • Create New...