Code Monkey home page Code Monkey logo

custom-quests's People

Contributors

marioe avatar pychnight avatar tbarela avatar

Stargazers

 avatar  avatar

Watchers

 avatar

custom-quests's Issues

Allow to set respawn location. [merged]

#1
#3

Currently there is no way to set the respawn location of the player, Please provide a way to do this for quests, so we don't always go back to Map Spawn location during quests.

Lua functionality

Store map spawn / bed spawns at the start of the quest (so, we can restore previous points)
Allow setting of the new spawn / bed points to X,Y location in the lua script.

Note Must Comply with Parties / Threading Changes.

Instanced Quests (Schematics + Isolated quests)

Alright, it seems very likely cross server stuff is not possible. so changing that request into something that can be done. #7

Instanced Quests when players join the quest they can't see or interact players outside this quest including Monsters, Items, Fired Projectiles, Other players, Tiles everything created or generated by the player must only be view able by the players inside the instance

This includes clearing up tiles when players leave / rejoin during a instanced quest, (schematics)

Basic concept

a instanced quest is a alternative realty where tiles, items, monsters and the players themselves are sent to anther reality of the same server, where other players can't interact with them and can't see them

  • Trouble spots
    Players dropping items
    Players Killing world npc's spawned by the server (loot, etc)
    Npcs within the quest firing projectiles.

this might be more difficult then the cross world method, but if cross world can't be done this is the only alternative. unless you can think of a better solution.

New Quest Types: Improve Daily Quests

Currently Custom Quests has a option to restrict the quest to a certain amount of attempts per day.
You should add option to allow the allowed amount to reset after a specific amount of time defined within the quests config. thus allowing Daily quests. or what ever time you put.

You should be able to specify time reset for each quest and if the value is 0 it will never reset.
Other then that ensure quests added to config including quests given to players on join can be refreshed using /reload

Improve Reloading Quests and Improve SetObjectives

IF you add a invalid quest to the database it will prevent the quest list command from listing other valid quests, also ensure that default starting quests field is actually applied during reload.

Other Task

Improve Set Status to support multi-message objectives with multi-color (1 color per message)
Format

this should be maybe turned into a objectives list? where we can freely add and free objectives at will and have 5 objectives per page

  • Previously known as set status
    party:setObjectives("string", index, color)

so party:setObjectives("test", 0, red) will override the objective in index 0 of the objective list
it will add the strings in order from 0 to whatever number.

Solve Threading Issues / Support quests with parallel execution of events.

Task List

Ensure support for parallel event Execution | #1 and #5
Ensure Plugin Stability (Prevent Crashing, Make thread safe as possible, I will be running this 24/7)

Fix Crashing with events that loop for long periods of time. (if you abort a quest while the quest is executing a loop it will cause server crashes)

Redesign Parties functionality, Add Team support and new lua events.

Redesign AddTrigger Functionality to support new parallel event execution code and ensure you can add it at any point of the file.

Example

AddTrigger(1, false, "1")

1= Wait(TimeSpan.FromSeconds(2))

1.Callback = function() party:SendMessage("Slime Counter: ".. slimeamt, Color.Magenta) end

Won't execute however this example will work.

1= Wait(TimeSpan.FromSeconds(2))

1.Callback = function() party:SendMessage("Slime Counter: ".. slimeamt, Color.Magenta) end

AddTrigger(1, false, "1")

Other examples quests should be able to do..

Example Filling room with water, while spawning sharks then having anther trigger checking to see when the water is at 30% filled in the room, and the main trigger is waiting for the player to reach X location.

Example 2: Requires 2 players to flip the switch at the same time in 2 different locations to open a door.

New Quest Type: Cross Server Quests.

Add new lua feature to send the player to anther server during a quest.
Ensure during the "transfer" quest is not aborted, and continued on the other server.

This requires support for external mysql databases for Leveling, Housing, Quests Plugin.
This also requires both servers to have the same plugin and server scripts for the quest, otherwise it will error out or abort the quest.

New commands for server transfer
Room names are defined within the config file and alias for each room.
/lobby join (room name)
/lobby leave (sends you back to the previous server)
/lobby list (checks server list and status (player count + online / offline) )

  • admins commands

/lobby send (forces a player to join targeted lobby / server)

New lua Functions to send the party over to the new server

party:sendconnect("ip","port")

  • Find a good way to report player count back to one server / combined total for sub servers
  • ensure all server report there status to the lobbies admin command (should also work on the sub-servers
  • Custom Connect Message during loading screen (seen this once before)
  • Track other player data for Custom Achievements system (future plugin), all servers will be using one database, so this should be really easy.

Player Data that should be tracked
#10 Mentions this data
QuestStart Time, Quest Finish time (this is per quest, think as this as a anti-cheat or ladder board type data, though with cross server quests, not sure how you would handle this to ensure the data for actually finishing the quest is correct)
Quests Completed
Quests Unlocked

  • Also acceptable would be isolated instanced quests / regions, would be acceptable too.
  • however, we will need to find a way to prevent the server from refreshing that region / tiles for a extremely long period of time and deal with player joining / leaving

Trigger Execution Problems

Ensure spawning monsters, items and other stuff always spawns the correct amount specified

  • Fix inaccurate Trigger Execution
  • Such as spawning incorrect number of monsters (spawning 2 instead of 3)
  • same check for anything that spawns items / monsters / custom monsters.

Known Exploits

  • for gathering quests players can place the item they just gathered to gather it repeatedly.
    ensure to do ownership checks and make sure it's not matching any players.

Known bugs

  • Parties kicking the user out of the formed party after doing quests or aborting

  • should be fixed

  • Parties malfunctioning if the player disconnects during quest progress

  • Suggestion you should force the second member to become the new leader and pass down the rank. into the player can rejoin, the player on rejoin should be asked if they would like to rejoin that quest.

  • also add a allowrejoin in the config to prevent rejoining function from being used.

  • Issues with no error detection when the quest load, invalid quests are still added to the quest list and show up into they player starts them.

  • this should be improved.

Update Wiki

Ensure wiki is updated with boo examples and usage.

  • Update original lua examples to the new system
  • Provide new examples mentioned in #1 Parties restructure
  • Ensure wiki is updated on everything.

Goals

Following Goals

Allow Unlimited execution of multi-able events at the same time

  • Multi-execution events #3 #11
  • solve the lack of ability to execute code in any order and jump to any point of the file. #3

Fix Serious issues

  • #21 Trigger Execution order problem
  • #11 Loop Crashes and improper execution of events inside loops.
  • #14 item gathering and tile gathering exploits.

Treat every party member inside the party as a part of the quest and allow trigger execution on all members
Including detection of hp, etc

  • Support PVP Quest Types #1
  • Support Team VS Team Quests #1
  • Improve support for daily quests #6
  • Improve Quest Objectives and support multi-objective format #8

Party Enhancements

Treat parties like actual parties and have the ability to target specific players in teams or players by themselves.

  • Party Restructure #1

Scripting Improvements

  • Control Re-spawning #4 allowing to set location and timers between respawns
  • New Scripting functions #5

Schematics

  • Load #17
  • Save #17
  • Random Generate based on coding template (design) #17

Database Data

  • #19 Improve database closing speed
  • #10 Add support for remote databases
  • Track player start and completion time for each quest
  • Track HP, MP, Item Gain given from quests
  • Track Quests Completed, Failed, Unlocked, Locked
  • Track Amount of times a quest has been done.
  • Add scripting ability to detect this, so we can change the request if a specific requirement has been reached.
  • Ability to reset said data

Schematics Loading / Unloading

Find a safe way to load schematics at a X,Y location inside a quest and unload them / despawn them after the quest is completed.

and even allow to generate a house based on a script from boo (using random generation #methods).

  • Support Versioned Schematics to ensure it's future proof
  • Ability to Randomly Generate Houses, Dungeons at X,Y location using (boo script for template rule)
  • Provide Example template for Dungeons and Houses.
  • Export to Boo as a option?

Improve Error Messages and Print out

Currently if lua paths are invalid the error will just be very generic and will not give you a reason or error message on where or why this error has occurred.

Convert to Boo (abandon lua)

Boo has proven to be more flexable then Lua and is more light weight and has shown a prefomance gain in custom npcs.

Parties Restructure.

  • Ability to Assign Teams
  • Ability to manage and check partys (script)
  • Ability to check condition of party members independently (health, level, position, etc)
  • Ability to change party lead
  • Party lead can kick people from party
  • Expose as much as possible to script.
  • Provide a working example of team based quests. (players independently go there paths to complete objects that require the team to split up)
  • Provide a working example of team vs team quests (player vs player) (aka capture the gem)
  • each team should have set equipment, depending on the class they select
  • each team when they place blocks the blocks should be dyed there teams color
  • each team must have there own spawn points
  • each player must have forced pvp
  • Provide a working example of quests using Loop function and being able to abort the quest at any time without Crashing.

Currently everything under the parties function assumes you want to send the event to everyone in the parties such as party:SetQuestStatus("QA TEST 1.", Color.Magenta)

Parties Formation Logic
All functions and triggers should support "Parties, Leader, Index#, String" Logic | #3

Parties Keyword
should always send the event to everyone in the party. everyone can see and read the event.

Leader Keyword
should only send the event to the leader this is where the leader can only able to make a choice and the party is forced to follow.

Independent flag This flags the event to be sent independently to each player that matches the input.
such as Leader + Independent True = party leader will only get it, what ever choice made by the leader for that event will not effect other members within the same party.

Concept of Independent flag is every function and trigger will ask is this independent?
if it is then only run for that player.

Such as..
party:SetQuestStatus("QA TEST 1.", Color.Magenta, Party, true)
will run for each player inside the party and the event is Independent.
meaning this function will run as if there doing a single player run of the quest for each player inside the party.

Index# Only sends the event to a specific player within the party, Index Value should execute the event for the specific index value of that party,

"String" pretty much a player list for teams and customized list that store specific players assigned to teams.

How parties should work parties should always form up like this

Parties Index 0 = Always leader regardless (moving or becoming the new leader will always make you index 0.)

Parties Index 1 = Player 1 (always the player who joins second) as the Index value advances it changes the player, if players leaves that index spot is now free and the same player decides to rejoin the party within 5 minutes there allowed back into the quest, however if the party member willingly leaves the party using /party leave or /party kick they will not be asked this question and if this is a cross server quest, it will also not allow the player to rejoin.

After Implementation

party:SetQuestStatus("QA TEST 1.", Color.Magenta, Party, true)
it will set quest status to QA TEST for each party member and the event is Independent

party:SetQuestStatus("QA TEST 1.", Color.Magenta, Party, false)
it will set quest status to QA TEST for each party member and the event is not Independent

party:SetQuestStatus("QA TEST 1.", Color.Magenta, 2, false)
it will set quest status to QA TEST for party member of index 2 and the event is not Independent, however if there is no player on that index within the party then the quest will not execute the trigger or event. it's up to the lua coder to implement fail safes.

party:SetQuestStatus("QA TEST 1.", Color.Magenta, "Green Team", false)
it will set quest status to QA TEST for all party member of team X and the event is not Independent.

Parties Team Logic
Parties should support Teams currently it assumes all members that are within the same party are on the same team.

So we need to implement logic for being able to read and set the players teams for each party member.

Setting the team

party:giveteam(party, 1, color.red, true)
Format: Effects, Team Number: Team text color (above there heads), Forcepvp
forcepvp function will work as the player can harm all other players not on the same team.
Reading the team
if parties.team(party, 1, true) then
do crap
end

How it reads (party, team number, is pvp on?)
Making conditions for reading index value and setting them dependent on choices


select = Condition(function()
    return party.index >= 0
end)


select.Callback = function()
foreach party.index do
    party:SetQuestStatus("please select your team.", Color.Magenta, party, true)
    party:GiveTeam(1, "Select Team", Color.Mangenta, party, true)
    if  party.team == 1 then
       party:SetQuestStatus("Valid keywords for teams, Red, Blue.", Color.Magenta, 
party, true)
   else
       party:SetQuestStatus("Team Already Selected", Color.Magenta, 
party, true)

redteam = Condition(function()
    return parties.team(party, "Red Team", true)
end)

redteam.Callback = function()
 party:GiveTeam(2, "Red Team", Color.Red, party, true)

 end

Condition(function()
    return party.index >= 0

end

Above is non-functional code just to provide a example of use cases

New functionality and triggers are requires massive changes

party:SetPosition(Leader or party or index, X,Y, Sent To)
Sets the position of a player to X,Y point without the teleportation effect

party:SetTeam(Team Number or Attached String, Team Color, Sent to) Gives team number to specified party also attaches a string to the party, in-case lua coders prefer to use strings instead of team numbers.

party.SetSPIndex
Allows lua coders to set special index for coding purposes
allows you to store party members into strings or sets the index to a specific player.

party.SPindex(Index Number or String)
Reads the value or string list from SPIndex.

party.index
Stores Party members by index, Party leader is always index 0. This only stores all members inside the party

Party.Team(returns the set team number or string)
Returns current Team for specified input.

Party.SetPVPState(Party or Team Number or String, true)
Sets current pvp state for specified input.

Party.PVPState(Party or Team Number or String, true)
Returns current pvp state for specified input.

New commands
Make a command to change party leader to anyone in the party as long as the quest is not currently running.

Party Kick (forcefully remove player from party, can't be used unless your party leader, if used on cross server quests, it will force the player to transfer back to the main server)

Design New Thread Event Handler

  • Multi Event Execution Tasks
  • Multi Trigger Execution
  • able to execute multi-able triggers at different times per thread
  • able to start a new thread to execute side objectives inside the quest. (such collect item)
  • ensure triggers and tasks can be looped (see below)
  • Provide a way to do loops and have them actually execute the events inside the loop
  • Triggers and tasks need to work on all threads.
  • allow triggers to be easily looped to prevent code duplication in scripts.
  • Fix issue with triggers breaking when having the same monster name / item names
  • see examples below
  • Fix quest crashes when aborting during looped code.
  • Ensure Thread Safety (/reload, looped code, etc)

#1
#10 #8 #9 #3 #5 #4 #6 #7

New script Functionality and Convert Old Functionality

#1 Party Restructure
#3 Trigger Execution order problems

Must follow above changes.

  • Ability to detect capturing npc with butterfly net
  • also, be able to tell if you released the npc.
  • functionality to spawn and remove signs and Set the Text on the sign.
  • Ability to spawn Projectiles / custom projectiles
  • Ability to Count Projectiles in a area
  • script events to detect when the player has read the sign or changed it.
  • should work like the message condition where if the player writes a matching word on the sign it will trigger a event.
  • Ability to detect what item was selected and used.
  • ability to detect placing blocks in real time or dye them. (Pengiun's minigame server feature)
  • Ability to detect if a player has a specific item within there inventory or equipment slots
  • Ability to save current set of Player data. / Restore Player Data after quest ends
  • Respawn Points
  • Name
  • HP
  • MP
  • GEAR
  • Ability to force pvp status
  • Ability to ADD or REMOVE items to any player slot [equipment / weapons]
  • Ability to set player respawn points for each player.
  • Should also allow setting respawn timers.
  • Ability to detect chest unlocking / taking items from quest created chests.
  • allow creating quest conditions involving this.
  • Ability to detect items placed inside a chest
  • Percent Based Region Counting Tile method (must be able to detect liquids and tiles)
  • if already possible provide a proper guide on how to do this / examples, cause i have tried creating math logic using existing triggers but it seems the tile counting is not effective at large spaces.
  • Ability to detect player fishing and create objectives involving this

Convert old untils.lua functionality / replace
Feel free to burrow from custom npcs 2 for said functionality.

  • CountTile
  • CountTileWithFrames (merge with Count Blocks?)
  • MatchesBlock
  • MatchesBlockWtihFrames *Merge?
  • SetBlocks
  • SetWalls
  • CountNPCS
  • FindNpcByName
  • FindNpcByType (merge with other method?)

Critical missing

  • Save System / Load System
  • PlaceChest
  • Putitemintochest (merge with place chest?)
  • Other Missing Scripting features.

Redundant (no longer required?)

ForEachPlayer

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.