Pychnight / Leveling

Terraria RPG Leveling and Class System and Currency System
1 stars 1 forks source link

Replace Seconomy #8

Closed Pychnight closed 6 years ago

Pychnight commented 6 years ago

3 #7

There are some bad exploits within the current Seconomy Code.

So, i want to turn Leveling plugin into a general currency / exp plugin (Pretty much all in one)

Example usage [this is only a example, if you know a better solution other then config you can do that]

config.json [ Currency: { Internalname: "Exp", "Quadrant1CombatText: "Exp, Color.Green" "Quadrant1FullName": "Exp", "Quadrant1ShortName": "exp", "Quadrant1Abbreviation": "e", ScriptPath: "killing.boo" AllowTrade: "False" (allows use with currency pay command, thus allowing players to trade this currency) GainBy: "Killing" CombatTXTColor: "green" SendCombatTXT "true", SendStatus: "false", Multiplier: 1.0 "DeathPenaltyMultiplier": 0.4, "DeathPenaltyMinimum": 0.05, "DeathPenaltyPvPMultiplier": 0.1 }, { Internalname: "Dust", "Quadrant1CombatText: "d, Color.Green" "Quadrant1FullName": "Dust", "Quadrant1ShortName": "dust", "Quadrant1Abbreviation": "d", "Quadrant2CombatText: "f, Color.Red" "Quadrant2FullName": "Fragement", "Quadrant2ShortName": "fragement", "Quadrant2Abbreviation": "f", "Quadrant3CombatText: "dg, Color.Red" "Quadrant3FullName": "Demigem", "Quadrant3ShortName": "demigem", "Quadrant3Abbreviation": "dg", "Quadrant3CombatText: "c, Color.Red" "Quadrant4FullName": "Crystal", "Quadrant4ShortName": "crystal", "Quadrant4Abbreviation": "c" ScriptPath: "mining.boo" GainBy: "Mining" SendCombatTXT "true", SendStatus: "false", Multiplier: 0.5 "DeathPenaltyMultiplier": 0.4, "DeathPenaltyMinimum": 0.05, "DeathPenaltyPvPMultiplier": 0.1 }, ]

usage example below for other functions [in this example we are reducing the exp multiplier for the specified enemy's by 0.5]

"NpcToExpReward": { "Wall of Flesh": 0.5e, "One Eye": 0.5e, "Lihzahrd": 0.5e, "Flying Snake": 0.5s },

itemshop example

1dg15f12d12e would also be valid for prices

Command Changes #9

/multiplier will need to be changed to support being able to change a specific currency

example /Multiplier Currency e DeathPenaltyMultiplier 0.5 example2 /Multiplier Currency e Multiplier 0.5

Pychnight commented 6 years ago

You should improve upon this request, you can see my main goal though I'm not really sure.

Most of this type of request could be done within a script / boo, Just need to refine this request to allow it to be more flexible and still get what, i would like in the end.

tbarela commented 6 years ago

Right now -- I think we will need to split the currency system into its own plugin. ( Like seconomy ). Separation of concerns and all that.

But to start off, it will live in the existing leveling plugin during early development. Eventually it should stand on its own though, so other plugins can make use of it easily. Sort of like what we'll do with the boo scripting, since I still need to rip that out of custom npcs.

tbarela commented 6 years ago

Also, I don't plan on supporting journaling. Unless there's a good reason for it, it seems too heavy duty for a game IMO. If this were dealing with real money, than its a must. But since this isn't a bank, and really just a simulation of a very simple bank, its a fair amount of extra work for dubious value...

tbarela commented 6 years ago

Making this similar to SEconomy, in terms of usage. But not completely.

Current status: Basic commands: /xbank, /xbank bal , /xbank pay (x is temporary, to avoid conflict with seconomy command names, will be removed later ) /bankadmin set ( sets a players balance to the given amount. I split up bank usage and bank administration into 2 separate command groups, probably not a good idea for regular players to alter others accounts... )

Persists to sqlite db. Willl be configurable, but right now its the only one supported.

The internal currency is only a generic unit- multiple currency rendering and parsing is to come.

This does track npc strikes per player, and also detects npc despawns. However, no rewards of any kind are doled out to players yet. I noticed after starting, that you had requested this to handle currency and exp all in one. I still think its better to keep things separate. One thing I'm doing here, since this code is basically my own from scratch, and not inherited-- is building it as separate objects, that are focused on a specific task. So in this case, the npc strike tracker should be able to be used by other code/plugins. What I'm planning is to have a configurable reward evaluator class that can hook into the strike tracker, and then rewards players as needed, based off of the params we feed it. ( This stuff is so much easier when you use OO principles, and not just cram code in wherever )

Pychnight commented 6 years ago

how about Ensure Send Status correctly filters out color codes and tags. (custom npcs)

maybe just rename this to SendVictoryStatus

functionality wise it should be the same as a victory screen in text Enemy's killed: Names : Players involved Player 1: exp : damage : player 2: exp : damage Player 3: exp : damage : player 4: exp : damage Player 5: exp : damage : player 6: exp : damage

command /battlereport should bring this up database wise, you can think this as a score board or anti-cheat