Jump to content

Daxter

Advanced members
  • Content Count

    58
  • Joined

  • Last visited

  • Days Won

    1

Daxter last won the day on July 6

Daxter had the most liked content!

Community Reputation

2 Neutral

About Daxter

  • Rank
    Pirate

Recent Profile Visitors

633 profile views
  1. Hello @Eviles! Did you ever finish developing / published these scripts? I've been working on guilds and I'm curious on how you built the Bank / Mission system. Did it involve source code?
  2. Thank you! Absolutely. Moving at least the config data is a quick win which I should have considered right away! The post has been updated with this suggestion I couldn't find any references to the function CreateGuild other than the NPCScript / SDK. but I'll look into hooking an update statement into it You mean storing data in a .txt file rather than the DB? No, I started by first challenging myself to use LuaSQL and then created a use case for it haha. Would this be as secure as SQL though? I've always been under the impression that using txt brought vulnerabilities
  3. Credits to Amu (Serverdev) for original Guild House script Thanks to @Angelix for sharing his experiments in the LuaSQL thread Step 1 - Setting up the Guild House You can use any map you'd like for your guildhouse, but take into consideration you'll be loading multiple copies of the map, so it shouldn't be too heavy on the GameServer. In my case, I'm going to use starena25. My resource/starena25/config.lua looks like this: See that " MapCopyNum(map, 100) --Nr of copies to be generated by GameServer"? That's the critical part - one map copy has to be generated per guild. The default value should be 200 copies, as the game's databases are configured for 100 Navies + 100 Guilds. If you disable one of the creation processes (in my case, Navy creation was disabled), you can halve the number of map copies being ran - which will reduce server load and make it harder to reach GameServer NPC limit (more on that later). As with adding any other map, if you haven't already, add it to: resource/mapinfo.txt 30 starena25 Guild House 1 150,150 3,150,150 255,255,255 resource/script/birth/birthconfig.lua AddBirthPoint("Guild House", "starena25", 63,75) resource/script/MisScript/ScriptDefine.lua AddMap( "starena25", "Guild House") Don't forget to change IDs / Names as needed. Step 2 - Accessing Guild House Next, you should create a new ticket. You can copy any existing (eg. Ticket to Argent City), as all the magic happens in resource/scripts/calculate/ItemEffect.lua: If you disable any of the guild creation processes, you'll have to adjust the mapid line accordingly (assuming you already reduced the number of copies to 100). Confirm with your guild table in GameDB, but by default Navies occupy IDs 1-100 and Pirate Guilds 101-200. So in my case I'll edit that line into: local mapid = GetChaGuildID(role) - 100 --First 100 IDs are Navy and were disabled, so I subtract 100 to the Pirate Guild IDs to match the map copies being created (1-100) Step 3 - Unlockable NPCs One of the perks of having a Guild House should be the possibility of customizing it, or at least having some sense of guild progress. While the game engine - as far as I'm concerned - doesn't allow for map instancing (having the same map appear with different context - NPCs, mobs, etc - for different users), we'll have to work within our limitations, such as disabling NPC interactions under Triggers (like in Spring Town / Language Barrier). In the example that follows, we'll be writing a script for an "Exotic Apps" NPC, who will sell these apps to all guild members of guilds who have unlocked it. For this, we'll have to customize our DB / guild table to fit our needs: ALTER TABLE [GameDB].[dbo].[guild] ADD exotic_unlock INT NOT NULL DEFAULT(0) It'll be a Flag column that for each Guild indicates whether the exotic apps NPC has been unlocked. Next, we'll have to create the functions that connect to the DB and check/update the values on this column. You may use an existing file such as resource/scripts/calculate/functions.lua, but I prefer to have them separate for ease of access. If you follow this route, don't forget to add this into resource/script/calculate/skilleffect.lua: dofile(GetResPath("script\\calculate\\guild_house.lua")) Step 3.1 - Check Guild Status EDIT: As suggested by Angelix, rather than defining the host/user/password in each function, a config table can be written only once and then called in each function. For example: local config = { host = "Your Host Name Goes Here", user = "Your BD username goes here", password = "Your BD password goes here" } If you do this, don't forget to update the references to get data from the table, like local Connect, ConnectID = LuaSQL("connect", host, user, password) => local Connect, ConnectID = LuaSQL("connect", config.host, config.user, config.password) Step 3.2 - Updating Guild Status Step 3.3 - Adding functions to NPC We'll now create the npc script in resource/script/MisScript/NPCScript0X.lua (number of your choice): And naturally, adding the NPC / function to our map. Something like (in resource/starena25/starena25npc.txt): 1 Exotic Apps 1 1269 15 8200,6300 8200,6300 270 Guild House 24 0 exotic_apps 0 Step 3.4 - Adding functions SDKs Almost there! If you were to try to use your npc now, the triggers would return an error message. This is because the game hasn't yet been told what to do with those functions, or how to call them. In resource/script/MisSdk/MissionSDK.lua: In resource/script/MisSdk/NPCsdk.lua: Step 3.5 - Final Notes Congratulations! Time to enjoy your Guild House and develop it further! Current known limitations: Disclaimer:
  4. Daxter

    LuaSQL (DLL)

    Does anyone how to make it work with altered tables? I added a column to the guild table, but when I add that column to the SQL statement the fetch step returns -1 instead. I've tried restarting the computer and SQL Server Agents, but it stayed the same EDIT: changing column datatype from bit to int solved it
  5. Thanks. Mission ID 58 is for Swordsman Promotion, which I previously disabled I was able to get it to work by not only using lower Quest IDs as you suggested, but also by using new characters on a new account. I don’t really know for sure what caused this, but having tested multiple custom quests on the same characters might have messed with their records/flags/etc. thanks again for the help! side-note: delivery and random quests seem to work with IDs > 6k, so it’s probably a flag calculation issue at root
  6. And I appreciate your help, but it doesn't fix it in my files for some reason - see the attached printscreen Can you share any details of the server you tested the quest on? Like game version, if it is clean / has mods, etc just for me to try to understand based on trial and error Thanks!
  7. Yes, I tried using IDs from a deactivated quest that were around 2400. Same error
  8. Daxter

    Create a Quest

    I'm running into the same issue as this user, even when using a lower quest/mission ID (such as 2041). It's weird though since it only seems to happen to custom kill quests, since both the ToP quests and custom delivery quests (even one with ID over 9k) all work fine
  9. You’ll need to find a CharacterAction.tx that works for Phyllis Crus; add sword/greatsword basic attack skills to Phyllis in characterinfo.txt; and then add Phyllis as a character to the requirement for all swordsman/crusader equipment available. Most likely you’ll need to identify the models for each piece of equipment to update the iteminfo.txt Last but not least, if you have any NPCs that check classes and characters - like rebirth angel or job changera - make sure to update them
  10. This is the error message that shows up whenever I kill a mob which I have a custom quest for (regular quests from TOP work fine). It does not count as progress for the quest, but since it only pops-up when killing mobs I have a quest for, I guess it works partially? Here's the script for the quest in question: DefineMission( 8000, "The Third Task", 9100) MisBeginTalk( "Recently, the Beardy Pirates Milita brought us a lot of trouble. Could you give them a lesson for us?") MisBeginCondition( HasRecord, 1001) MisBeginCondition( NoMission, 8000) MisBeginCondition( LvCheck, ">", 59) MisBeginAction( AddMission, 9100) MisBeginAction( AddTrigger, 91001, TE_KILL, 570, 20 ) MisCancelAction( ClearMission, 9100) MisNeed( MIS_NEED_KILL, 570, 20, 10, 20) MisResultTalk( "<t>Well done. You completed it so quickly. I will reward you something.") MisHelpTalk( "<t>You can find Beardy Pirate Milita around Darkblue at (1643, 1805).") MisResultCondition( HasMission, 9100) MisResultCondition( HasFlag, 9100, 29) MisResultAction( SetRecord, 9100) MisResultAction( SetRecord, 1002) MisResultAction( SetRecord, 1003) MisResultAction( ClearMission, 9100) MisResultAction( AddExp_0) InitTrigger() TriggerCondition( 1, IsMonster, 570) TriggerAction( 1, AddNextFlag, 9100, 10, 20) RegCurTrigger( 91001 ) Note: I've tried with lower quest/mission IDs (such as 2047) but to no avail. Error message in text:
  11. Hey @V3ct0r, I have this game.exe which works with modloader - says it's version 13_2 However, since this file seems to be broken when trying to build a boat, I looked into the supported game.exe you attached to the main post. 13_5 and 13_0 were able to connect (all other gave a game version error, your 13_2 included), but when I try to enter a character it either spawns me in the middle of sea and completely unusable, or throws and ItemID error (for IDs I've never actually used). I've used your Game Info program to look into my game.exe, but all values match the standard 13_2, so why doesn't it work? Alternatively, is there a way to fix the boat issue in my game.exe? Thanks
  12. The "lua function[lua_BickerNotice]param number or type error!" error was fixed (turns out it was actually unrelated), but the main issue remains I ran the client with the "> output.txt" command and after the modloader it printed the following: loading mission.lua GetMisData: Obtain quest notice failed! Have not found target quest data notice. ID = 701 GetMisData: Obtain quest notice failed! Have not found target quest data notice. ID = 9109 GetMisData: Obtain quest notice failed! Have not found target quest data notice. ID = 9110 GetMisData: Obtain quest notice failed! Have not found target quest data notice. ID = 203 GetMisData: Obtain quest notice failed! Have not found target quest data notice. ID = 702 But in my MissionScript01 they are properly defined, for example: DefineMission( 702, "Blacksmith's Greetings", 701 ) MisBeginTalk( "<t>You will not be able to survive in this harsh world if you are going around unarmed.<n><t>Take this letter to <pArgent City>'s Blacksmith, <bGoldie> at (2193, 2706). I believe he can be of help to you.<n><t>You can use the Radar (Alt + R) to locate him." ) MisBeginCondition(HasRecord, 1) MisBeginCondition(NoRecord, 701) MisBeginCondition(NoMission, 701) MisBeginAction(AddMission, 701) MisBeginAction(SetFlag, 701, 1) MisBeginAction(GiveItem, 3950, 1, 4) MisCancelAction(ClearMission, 701 ) MisBeginBagNeed(1) MisNeed(MIS_NEED_DESP, "Send the letter to <bBlacksmith - Goldie> in <pArgent City> at (2193, 2706). Return to look for Newbie Guide Senna at (2223, 2785)") MisResultTalk("<t>I see, so you've met <bGoldie>. He's the guy to look for when you have made enough money to get a good weapon.") MisHelpTalk("<t>Remember to hand the letter to Goldie personally. He is at the left corner of Argent City at (2193, 2706).<n><t> You can use the Radar(Alt + R) to locate him.") MisResultCondition(NoRecord, 701) MisResultCondition(HasMission, 701) MisResultCondition(HasFlag, 701, 10) MisResultAction(ClearMission, 701) MisResultAction(SetRecord, 701) MisResultAction(AddExp, 9, 9 ) For reference, here's the mission.lua from my client print( "loading mission.lua" ) --lua��������ֵ���� LUA_FALSE = 0 LUA_TRUE = 1 MIS_TREENODE_INVALID = 0 -- ��Ч���� MIS_TREENODE_NOMAL = 1 -- ��ͨ���� MIS_TREENODE_HISTORY = 2 -- ��ʷ���� MIS_TREENODE_GUILD = 3 -- �������� MisData = {} function AddMisData( id, name, tp ) if id == nil or name == nil or tp == nil then print( "AddMisData: Function parameter error! Id = , Name = , tp = ", id, name, tp ) return end if MisData[id] ~= nil then print( "AddMisData: Original quest ID overlayed when setting new quest date! Original data id = , name = , tp = , new data id = , name = , tp = ", id, MisData[id].name, MisData[id].tp, id, name, tp ) end MisData[id] = {} MisData[id].name = name MisData[id].tp = tp print( "Set Quest: ["..name..">> ID["..id.."] Type["..tp.."]" ) end function GetMisData( id ) if id == nil then print( "GetMisData: Obtained quest details, parameter error! id = nil" ) return LUA_FALSE end if MisData[id] == nil or MisData[id].name == nil or MisData[id].tp == nil then print( "GetMisData: Obtain quest notice failed! Have not found target quest data notice. ID = "..id ) return LUA_FALSE end return LUA_TRUE, MisData[id].tp, MisData[id].name end
  13. Thanks, I added the "AddMisData" to missioninfo.lua (already had quest types in mission.lua) but unfortunately if stayed the same
  14. I'm having the same issue. I tried using a clean 1.38 exe, but it didn't work; clean 1.36 (exe) works for boats but says it's incompatible with modloader and returns an item error on my character "item ID 29106 is invalid" - but I never had any ID over 6k How did you fix it? Also, @V3ct0r shouldn't 1.36 be compatible with the modloader?
×
×
  • Create New...