Jump to content

Angelix

Community
  • Content Count

    518
  • Joined

  • Days Won

    68

Everything posted by Angelix

  1. Someone made some time ago a "Auction NPC", which they bid and when they win the item, the item is stored in a variable for a later player pick up. You can do the same, make variables, store item and player ID and have them pick it up later on.
  2. Release thread. This thread can be locked, further replies can go on release thread for debugging and additional requests.Thanks!
  3. Angelix

    Rush

    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////// ********************************************************************************* ////////////////////// ////////////////////// *** ------------------------------------------------------------------------- *** ////////////////////// ////////////////////// *** Map Name: Rush, Game: S4 Leage, ModeType: "Chaser" *** ////////////////////// ////////////////////// *** ------------------------------------------------------------------------- *** ////////////////////// ////////////////////// ********************************************************************************* ////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Introduction: I have developed a script based off the "Chaser" mode game type from S4 League and modified it from there. It's a multiple instanced map game mode that allows players (from 2 to X players) have a fun chasing game type with a hidden score mechanic. Description: -> After a number of players have registered, they will get sent to map and match will start after a few seconds, within that time frame, they will be invisible and will not be able to kill other players if they get to see each other by removing invisibility. -> A round will start and designate a "chaser" player, he/she must kill all players at least once and survive until the round ends in other to win. If the chaser is killed, the round will be terminated in that instant and a new round will begin with a new chaser. -> A player with the highest score (non chaser) will be chosen as the target player and will be updated constantly based on scores. -> When a player kills the chaser, it will grant 6 points, killing the target grants 4 points and a normal player grants 2 points. While the killer gets those points, the dead player will get half those points. -> A match will end when a chaser has killed all other players at least once and survived the whole round or when the overall time match ends, which will result in no one having a chaser status. -> Players killed must ignore the revive prompt and a counter will initiate to automatically revive them within a few seconds into another random spawn within the match. -> Rewards will be handed out to the current chaser (if there is one), the current target and all the normal players at the end of the match. Credits: @ Matt (ServerDev) - Developer of map tools. @ Alias (ServerDev) - Creator of the map included in these files. @Angelix (ServerDev / PKOdev) - Creator of script and details. @KONG (PKOdev) - Helping in polishing up some details. Note: It's a lot of code, some might be unnecessary, some can be removed and other can be improved. Please, if you have any suggestion, let me know on what I can improve, add and remove, thanks! Change Log: Version 1 - Original release of scripts. Version 2 - Fixed a typo, added the map copy function line for v1.x users. Version 3 - Hopefully this fixes an issue that may arise if a player leaves (disconnects on own will or not), especially if that player is the chaser. Version 4 - Removed a repeated function, made the map type a customization number in order for people to adjust it in case they already have used a previous map type before, made it a bit easier for v1.x users for map copies, added a note stating the NPC is needed just in case.
  4. [Guild] guild_num = 80 [Guild] guild_try_num = 80 GameServer.cfg - v2.X
  5. Well, I might be releasing maybe to a few people to test and help me debug the script, everything should be working so far after many error randomly popping up in lua_err.txt, haha. It's still kinda a messy script with SO MANY functions, I still wonder if they're all necessary, hahah.
  6. Is there any possibility to get something like a resource used back on ServerDev? I found that interesting. :P

    1. Billy

      Billy

      I dont think many other people like that system, as there arent any real advantages to use it over just a post in releases section. 

    2. Angelix

      Angelix

      Al right, thanks for the response! Another thing I'd like to ask is, why can't we fully edit a starting post in a thread? Like include code tags, bullets, quotes and such?

  7. You can check this thread: Creating New Set Glow Effect. It's a guide on how to create, use that test out your effects and see what you're missing.
  8. @Totoka, just refer to the above post I made in details about the original and mine.
  9. Hello @Totoka! The function to remove certain effects (with duration) is semi implemented, didn't go very much into that detail, yet. This belongs to the original chaser mode from S4 League, not currently in mine. No player can enter the instance once the match has started, players may leave by logging off or using the game's original "revive in town" prompt. This is a multi-instanced map, an instance per match. It was an example, meaning if the match reaches its time limit and the chaser couldn't kill every player within the given time. If the chaser were to die, that means a new round would start if there's still time within the match. I don't know if I explained myself correctly, hahah.
  10. Well, reading through S4 League's Chaser mode information again, seems back then I just took the main idea and started adding own ideas, hahah. S4 League's Chaser Mode: That's what I can gather from internet sources, no telling if the matches ended with chaser being able to kill everyone else or it just keeps going round per round till a match time limit is reached and the winner is based on score gathered. So for my Rush mode, this is what I have: I might be missing something at the base details for the game mode, but I have also included (within scripts) more additional features, such as: And some more I can't remember right now. So far, what do you guys think is best? I can keep my current script or go for the original (excluding the point per damage given).
  11. I don't know what exactly or can't understand with all those scripts, hahah. Anyways, I have my own script for combining gems with a formula to determine the percentage needed. function can_unite_item(...) if arg.n ~= 12 then return 0 end if can_unite_item_main(arg) == 1 then return 1 else return 0 end end function can_unite_item_main(Table) local Player = 0 local ItemBag = {} local ItemCount = {} local ItemBagCount = {} local Get_Count = 4 local ItemReadCount = 0 local ItemReadNow = 1 local ItemReadNext = 0 local ItemBag_Now = 0 local ItemCount_Now = 0 local ItemBagCount_Num = 0 Player, ItemBag, ItemCount, ItemBagCount, ItemBag_Now, ItemCount_Now, ItemBagCount_Num = Read_Table(Table) local i = 0 for i = 0, 2, 1 do if ItemBagCount[i] ~= 1 or ItemCount[i] ~= 1 then SystemNotice(Player, "Item target unit and item unit illegal.") return 0 end end local Scroll = GetChaItem(Player, 2, ItemBag[0]) local LeftGem = GetChaItem(Player, 2, ItemBag[1]) local RightGem = GetChaItem(Player, 2, ItemBag[2]) if GetItemType(Scroll) ~= 47 then SystemNotice(Player, "This is not a combining scroll.") return 0 end if GetItemType(LeftGem) ~= 49 or GetItemType(RightGem) ~= 49 then if GetItemType(LeftGem) ~= 50 or GetItemType(RightGem) ~= 50 then SystemNotice(Player, "This is not a Gem.") return 0 end end if Get_StoneLv(LeftGem) ~= Get_StoneLv(RightGem) or GetItemID(LeftGem) ~= GetItemID(RightGem) then SystemNotice(Player, "Both gems must be the same level and type in other to combine them.") return 0 end for i = 0, table.getn(GemVar), 1 do if GetItemID(LeftGem) == GemVar[i].ID then if Get_StoneLv(LeftGem) >= GemVar[i].Level or Get_StoneLv(RightGem) >= GemVar[i].Level then SystemNotice(Player, "The maximum level for ["..GetItemName(GemVar[i].ID).."] is Level "..GemVar[i].Level..".") return 0 end end end if getunite_money_main(Table) > GetChaAttr(Player, ATTR_GD) then SystemNotice(Player, "Insufficient gold, unable to combine gems.") return 0 end return 1 end function begin_unite_item(...) if can_unite_item_main(arg) == 0 then return 0 end local Player = 0 local ItemBag = {} local ItemCount = {} local ItemBagCount = {} local Get_Count = 4 local ItemReadCount = 0 local ItemReadNow = 1 local ItemReadNext = 0 local ItemBag_Now = 0 local ItemCount_Now = 0 local ItemBagCount_Num = 0 Player, ItemBag, ItemCount, ItemBagCount, ItemBag_Now, ItemCount_Now, ItemBagCount_Num = Read_Table(arg) local BagItem1 = ItemBag[0] local BagItem2 = ItemBag[1] local BagItem3 = ItemBag[2] local Scroll = GetChaItem(Player, 2, BagItem1) local LeftGem = GetChaItem(Player, 2, BagItem2) local RightGem = GetChaItem(Player, 2, BagItem3) local LeftGemID = GetItemID(LeftGem) local LeftGemLevel = Get_StoneLv(LeftGem) RemoveChaItem(Player, GetItemID(Scroll), 1, 2, BagItem1, 2, 1, 0) RemoveChaItem(Player, GetItemID(RightGem), 1, 2, BagItem3, 2, 1, 0) Set_StoneLv(LeftGem,(LeftGemLevel + 1)) SetCharaAttr((GetChaAttr(Player, ATTR_GD) - getunite_money_main(arg)), Player, ATTR_GD) ALLExAttrSet(Player) local Random = math.random(0, 100) local Percentage = math.floor((1 -((LeftGemLevel - 1)/ 9)) * 100) for i = 0, GetKbCap(Player), 1 do if GetItemID(GetChaItem(Player, 2, i)) == 3075 then RemoveChaItem(Player, 3075, 1, 2, i, 2, 1, 0) Random = Random - 10 if Random < 0 then Random = 0 end break end end if Random > Percentage then RemoveChaItem(Player, LeftGemID, 1, 2, BagItem2, 2, 1, 0) SystemNotice(Player, "Sorry, the combination has failed and the gems has vanished.") return 2 elseif Random <= Percentage then if HasMission(Player, 1989) == 1 then Checkunite[GetChaDefaultName(Player)] = 1 end return 1 end end function get_item_unite_money(...) local Money = getunite_money_main(arg) return 0 end function getunite_money_main(Table) return 5000 end It uses this formula to determine the success rate of combining a gem. local Percentage = math.floor((1 -((LeftGemLevel - 1)/ 9)) * 100) So the rates for making a level X gem would be: Level 2 = 100% Level 3 = 88% Level 4 = 77% Level 5 = 66% Level 6 = 55% Level 7 = 44% Level 8 = 33% Level 9 = 22% Of course my script is custom! So to use it, you would need to modify some parts as well. Since I have all my gems placed on this: GemVar = {} The good (maybe bad) part about my scripts is that you don't need the combining effect on character in order to increase success rate, as long as the character has the item in his inventory, it will increase the combining rate and will remove the item. Hope that helps a bit.
  12. Already found a way around it! Create double the spawn points, hahah.
  13. Yes, that's the problem, haha. I already have setup some spawns for "MoveCity" to work with, but I was trying to add something more. Like if a player gets killed, I wanted to add the option for that player to spawn in another coordinates not surrounded with one or more players so the player doesn't get killed/stunned right away.
  14. Does anyone know if we can use the "GoTo" function with an applied map copy ID? Somewhat like this: GoTo(Player, X, Y, Map, MapCopyID) Update: So far everything seems to work fine, I'm just trying to go through debug process by entering with 2 players instead of 10. Trying to add a bit extra, such as spawning players in a zone with no other players, that's why I need to use a function to send players to some specific coordinates within a specific copy of a map.
  15. Angelix

    PKO 2.4 + IGS

    Thank you a lot! Both you and Xero.
  16. Quick script preview! function map_run_Rush(Map) local CopyID = Rush.AvailableCopy() local Func = Rush.WaitFunc() if CopyID ~= 0 and Func.ReturnSize() >= Rush.NumPlayer then Rush.StartMapCopy(CopyID) Rush.MapCopy[CopyID].Time.Init = Rush.Time.Init Rush.MapCopy[CopyID].Time.Round = Rush.Time.Round Rush.MapCopy[CopyID].Time.Map = Rush.Time.Map for a = 1, Rush.NumPlayer, 1 do Rush.StartPlayer(Func.GetPlayer(), CopyID) end end Notice("["..Rush.MapName.."]: A new match has started, players in waiting list have been moved into designated map.") end I'm merely rewriting the whole script to work with multiple map copies, if you notice something wrong in above script, please do tell me. I'm also making a lot of comments within the script for future release. Currently it's just a rewrite, still need to go through debug testing to see if it fully works.
  17. With that you get a player's ID, not they account ID. With "GetChaTypeID" you get the ID belonging in CharacterInfo, currently there is no way to get a account ID via Lua in server scripts. I might be mistaken, but I don't think there is.
  18. It seems "table.getn()" was completely removed in Lua 5.3, though think that the server uses 5.1 or 5.2, I have used it before and it works. Thanks! Por cierto, yo tambien habló español, pero hay que mantener esto en inglés, hahah. Well, the map copy stuff is pretty easy within v1.x, just a bit more complicated in v2.x because it involves a text file since the function to create copies from v1.x was removes in v2.x, I was having trouble understanding how to correctly modify the text file back then. Now I learned a bit more and managed to get 2 copies working, so I assume I can work with them now.
  19. What's your main language? Haha. Anyway, I still have to rewrite almost all the script to adapt it to work on multiple copies of a map. Right now it is based on just one instance, so I'm sure some problems will arise and I'll come back here, haha. I'll use this thread for development and maybe suggestions, when it is done, I'll release it with detailed description on the whole process of what happens inside (as a player) and how to set it on another files. Just hoping everyone will like it.
  20. I got an exam tomorrow and have to turn in some homework by Friday, on the weekend I'll try to adapt the script to work in copies. Essentially, that's the only two things i can remember having problems back then, if anything arises, I'll ask for help. I didn't quite get the first thing you talked about, but about the map copies I do have an idea now (I already did some research).
  21. Somehow I can't post a code tag within the starting post in thread! Anyway, with a bit of help from KONG on said thread, I was wondering if anyone can confirm if the following code can/will work with player's role. if Rush == nil then Rush = {} Rush.WaitList = {} end Rush.Func = function() local Self = {} --Size, Rush.WaitList = Size or 0, Rush.WaitList or {} Self.Push = function(Player) Rush.WaitList[(table.getn(Rush.WaitList) + 1)] = Player --[[ Rush.WaitList[(Size + 1)] = Player Size = Size + 1 ]] end Self.NextInLine = function() return Rush.WaitList[1] --[[ return Rush.WaitList[Size] ]] end Self.GetPlayer = function() return table.remove(Rush.WaitList, 1) --[[ local Player = Rush.WaitList[Size] Rush.WaitList[Size] = nil Size = Size - 1 return Player ]] end Self.ReturnSize = function() return table.getn(Rush.WaitList) --[[ return Size ]] end Self.CheckIsEmpty = function() return table.getn(Rush.WaitList) == 0 --[[ return Size == 0 ]] end Self.UpdateList = function() if Self.CheckIsEmpty == false then for a = 1, Self.ReturnSize(), 1 do if IsPlayer(Rush.WaitList[a]) ~= 1 or IsPlayer(Rush.WaitList[a]) == nil then table.remove(Rush.WaitList, a) end end end end return Self end The commented lines are what KONG helped me with, I tried to modify it a bit to work with the first player in the table, is the one that first registered, if we keep working with last player in table, maybe we will never get to first player in case a really populated server. That's why I modified KONG initial code and was wondering if it will work. Please do note that I have no function to get a player's role with just their name! So I have to store their roles within tables, I created the "UpdateList" function additionally (I don't know if it will work) in order to keep waiting list clean by removing people who are no longer online. Thanks for any help given.
  22. Some time ago I made public back then in ServerDev an idea I had somewhat developed, it was an script for a game mode based on S4 League's "Chaser" mode. It wasn't an exact replica, but it was kinda interesting, so I developed it till my knowledge (a bit limited at that time) finally gave in and due to university, it was left to pick up dust without seeing light. While I personally have my own custom server files based on v2.X structure, I tend to wander off from time to time and develop these kind of things along with complete customization as seen as my last reworks (fairy, upgrade and ticket systems). Anyways, this idea was brought up again by @KONG in this thread/post (link). Back then, I had limited knowledge on how to work on a few things. * How to handle map copies. * How to handle player's role with registration NPC for 10 players, in case they disconnected or something else happened.
  23. Yes. In order to revive them with "MoveCity" or "GoTo", you'd have to move them twice, maybe even give them some HP I guess. It's like applying "&call" or "&goto".
  24. Trying looking in forum anything related about IGS. I never got it to work in v2.x, so I can't really help you there.
  25. That's something I never thought off back then, hahah. To actually re-check the player's role when trying to send players into the map. Does the "IsPlayer" or "IsLivingCha" work to check if a player is online? Might as well start a new thread for this, too much off-topic.
×
×
  • Create New...