Language: 
To browser these website, it's necessary to store cookies on your computer.
The cookies contain no personal information, they are required for program control.
  the storage of cookies while browsing this website, on Login and Register.

Author Topic:  Magic Money Cards  (Read 374 times)

0 Members and 1 Guest are viewing this topic.

Dolfo

« on: 23, December 2021, 09:50:11 »
Goal is a kind of Credit Card System.
Basic implementattion is not that hard.
But first think of the name and type of this.
Should it be more a kind of card? Or more a kind of jewelry?
Should it be put in pouches?
Should it be ego-binded or are players allowed to resell there old Cards?
Should there be more levels of this cards? (bronze/copper, silver, gold, mithril/platinum)
How expensive should be this cards?

I thought of making this system very expensive, so high level player come someday to the point:
"Yeah i go my card finally, the days of carrying coppers is over.

Ok implemention:
1. We need an arch item for this.
2. bank.lua must sell this card.
3. implement card paying in pl_PayAmount
-> here we can go for 2 directions (pay from card, pay to card)
--> it's mostly check for card and access player bank account
----> we could split this, like bronze card can only pay from, silver card can do both?
4. perhaps a kind mithril/platinum card, the ultimate goal for a high level player
-> platinum card has all, payin, payout, works like a kind of money pouch (picked up money is automated transfered to bank account, and you can always grap some money out of that pocket card), platinum card could be ego binded and you get an insurance on this, if you loose it, bank will give you new card.

So that's the idea, of course the platinum idea is hardest to code, but copper and silver cards must be easy to do.
we also need an idea for gold card.
And i thought about high prices for all cards.
So perhaps only platinum is ego binded, all other carts could be sold to players?
Or an upgrade option on bank.lua

i thought a mithril to buy such cards, at least a lot of gold for a simple bronze card?
« Last Edit: 17, August 2023, 23:10:54 by Dolfo »
Don't believe the shit, you hear in mainstream. Believe your own body. Your body is speaking always the true to you. But you need to understand your body. Hear to your body, not to your ego. And when body is calling to you: "Hey something is wrong!" find the reason(s) for that. Man in White don't go for that, they don't want to heal you. They want earn money and sell you medicine, you should take rest of your life. You are not the patient, you are their customer. Never forget this!

Shroud

« Reply #1 on: 23, December 2021, 17:23:58 »
I believe there is already a similar item in terms of implementation you can use as a template. DMBuster (it's egobound but that's probably a design choice rather than a functional requirement) worked in the following way:

1. Player has to "mark" the item with m when selecting it in inventory
2. Player types /talk DMBuster
2.1 It's also possible to type extended commands e.g. /talk DMBuster deposit all
3. It triggers the lua script within

So if you're wanting easiest implementation then you just put bank lua script within and it would essentially be a mobile bank linked to your bank account. If you want to refine it further then you can definitely do so with a custom script.
Doesn't matter, you'd die anyway. ;D Shroud's a hacker. After many hours of deep thought I have came to that conclusion.

Dolfo

« Reply #2 on: 04, January 2022, 22:18:59 »
I paid with my credit card. 8) This is my code. shopc.c line 297.
Code: [Select]
    // prototyp : paying with a marked creditcard, currently name is relevant
    object_t *mark;
    if ((mark = find_marked_object(op)))
    {
        if (strcmp(mark->name, "creditcard") == 0)
        {
            // check money from bank account
            object_t *this,
                      *next;
        FOREACH_OBJECT_IN_OBJECT(this, op, next)
            {
                if (this->name &&
                this->arch == archetype_global._player_info &&
                !strcmp(this->name, "BANK_GENERAL"))
                {
                    if (this->value>=amount)
                    {
                      this->value-=amount;
                      ndi(NDI_UNIQUE, 0, op, "You pay with your %s.",mark->name);
                      return 1;
                    }
                    else
                    {
                      ndi(NDI_UNIQUE, 0, op, "Looks like your %s is uncovered.",mark->name);
                      return 0;
                    }
                }
            }
        }
    }
It's a prototyp, currently you need to mark an item  named "creditcard". Here is my creditcard definition.
Code: [Select]
#
# - credit card
#
Allowed card
chance 0
artifact credit_card
def_arch card
editor 3:items/signs
Object
name creditcard
identified 1
type 98
material 1
value 8
weight 20
end
#
I stop here for now. Creditcard needs a balanced price. :o
« Last Edit: 04, January 2022, 22:20:56 by Dolfo »
Don't believe the shit, you hear in mainstream. Believe your own body. Your body is speaking always the true to you. But you need to understand your body. Hear to your body, not to your ego. And when body is calling to you: "Hey something is wrong!" find the reason(s) for that. Man in White don't go for that, they don't want to heal you. They want earn money and sell you medicine, you should take rest of your life. You are not the patient, you are their customer. Never forget this!

_people_

« Reply #3 on: 04, January 2022, 23:20:25 »
A few critiques:

Don't use strcmp here - if you have to compare strings strncmp is safer but even safer than that is a shared string.

Code: [Select]
shstr_t *namehash = shstr_find("credit card");
...
if (mark->name == namehash)
{
...
}

However I think the most reliable option of all would be to use an additional global archetype and check that the marked object's archetype is that global arch.

Also I don't think credit cards should be an artifact, but instead an arch. I would consider this a "base item" which could have multiple variants. AFAIK we don't have a "card" archetype so I assume you've made both an arch and artifact, which isn't necessary.
-- _people_ :)

Dolfo

« Reply #4 on: 05, January 2022, 06:07:59 »
As i said, it's a prototyp. I was happy when finishing this. To get access to the bankaccount was not easy and the day got later and later. Sure this should be improved. I am not that deep on archetyps or artifact definitions. I used the way how you implemented your potions or scrolls. And for potions or scrolls you used artifact definitions linking on generic potion or scroll archetyp. Then i found archetyp card and simply used this.

So no, i don't defined a new archtype, i used archetyp card. And linked it to artifacts with def_arch card. I am still a little confused.
For example if you have one blue potion and want use this for 10 blue mana potions, you want really 10 archetypes? As i said, currently you have the system, you have all your potion.png in arch folder, there is only one definition for a potion_gen.arc, where color is definied default blue and then you have all the potion definitions in artifacts using potion_gen.arc as a kind of base type and overwritting the stats to become more unique.

For organic foot you have the other way, you defined mostly the food as a archtype, but each food there is also a unique png? So to speak true, this is a mess somehow? One site you use this system other site you use this system? For what reason you have artifact file, when you want all defintions in archetyp?

Edit: Ok trying to deposit money with a marked creditcard is funny. bank.lua uses pay logic to reduce the coins and pay logic pays with card. So you deposit money you pay with card and nothing changes.  ;D bank.lua need a fix then and must check for a marked credit card too. Or you build an easteregg like. "Ey, you want to deposit money with you credit card, sure why not?"  :o

Edit: And if you want to deposit more coins from your inventory, than you can pay with the card, bank npc's says. "You didn't have that money to deposit!"

But other places i checked this cards worked fine.  8)
« Last Edit: 05, January 2022, 08:22:15 by Dolfo »
Don't believe the shit, you hear in mainstream. Believe your own body. Your body is speaking always the true to you. But you need to understand your body. Hear to your body, not to your ego. And when body is calling to you: "Hey something is wrong!" find the reason(s) for that. Man in White don't go for that, they don't want to heal you. They want earn money and sell you medicine, you should take rest of your life. You are not the patient, you are their customer. Never forget this!

_people_

« Reply #5 on: 05, January 2022, 17:32:47 »
As i said, it's a prototyp. I was happy when finishing this.

Wasn't trying to discourage you, I just wanted to give some advice on how the codebase works because it can be very confusing, even for someone who's been working in it for over a decade. :)

Re arches vs. artifacts: It's a bit complicated. I can see an argument being made for food being artifacts or arches, as well as potions being arches or artifacts.

Arches are base items. A loaf of bread is a different item from an apple or a banana. However if you wanted an alternative form of bread which heals more, you'd likely want to use an artifact to overwrite some of bread's attributes. Although again there's an argument to be made that something like banana bread or sourdough bread should be a different "base item" from regular bread.

A sword is a basic item, so it uses an archetype. Excalibur, a unique/legendary sword, would be a unique artifact using "sword" as its base. And with how our loot generation works, "sword of medium fire" is also an artifact (though implemented slightly differently).

A potion is, in my opinion, a base item. Though that could be argued. So to extend a potion, you would add stats and change which spell it is used for (by modifying its SP value).
-- _people_ :)

Dolfo

« Reply #6 on: 05, December 2022, 03:13:56 »
Finally i had the time to improve this. Changed the card definition from artifacts to archetyp. Defined type MONEYCARD 38. Type number 38 was free and is close to type 36 MONEY and 37 LOOT. So i don't need to check anymore for name of the card. Next is i could go for subtypes to build the different versions of this cards. I also fixed the bank deposit problem, when deposit money with a marked card.

In bank.lua
Code: [Select]
-- this is not the best logic, but temporary helps here
-- pl:deposit using shop_pay_amount to burn money and shop_pay_amount is the logic paying with moneycard
-- so we deposit money to bank account only to burn same amount from bank account
local mark = pl:FindMarkedObject()
if mark ~=nil and mark.type==game.TYPE_MONEYCARD then
  ib:SetMsg( "Sorry, unmark your moneycard first." )
  return
end
This is a fast solution. Deposit logic abuse shop_pay_amount to burn coins in inventory, but with marked money card, new shop_pay_amount logic burns the money from card. So we deposit x on account only to burn x from account in this situation.
Don't believe the shit, you hear in mainstream. Believe your own body. Your body is speaking always the true to you. But you need to understand your body. Hear to your body, not to your ego. And when body is calling to you: "Hey something is wrong!" find the reason(s) for that. Man in White don't go for that, they don't want to heal you. They want earn money and sell you medicine, you should take rest of your life. You are not the patient, you are their customer. Never forget this!

Dolfo

« Reply #7 on: 16, August 2023, 08:45:45 »
I try to finalize this idea now. I have some questions.

Do we call it MONEYCARD of CREDITCARD?

Atm i build the basic card. So the cheapest card players can buy. How much you think is a card worth, where you can mark it and buy/pay everywhere in the world without money in inventory? Atm i have adjusted it with 1 gold. This is mainly the value when you examine it. Could also that buying the card in bank is more worth then selling it back to shop.

Edit: I have npc selling the card for 10g atm. But that's only fast adjusted without thinking, like it is common for our current item base.  :P

In game i discussed with petar about charisma bonus on a card and a kind of possible to equip a card. But would be much easier to code a kind of discount for cards. So we can have different cards with differents discounts.

Thinking about discounts, also charisma bonus and shop +20/-20% buy/sell, we have a max range from 40% before players, can buy/sell with profit. So if we think we give also bonus to charisma up to 100 charisma or more, we better calculate also 15-20% for charisma bonus.

So we could go up to 20% discount for cards, but i would prefer to adjust not so close to the limit. Perhaps different creditcard types from discount 0%(basic) to 10% ("royal"/best)?
« Last Edit: 16, August 2023, 11:02:59 by Dolfo »
Don't believe the shit, you hear in mainstream. Believe your own body. Your body is speaking always the true to you. But you need to understand your body. Hear to your body, not to your ego. And when body is calling to you: "Hey something is wrong!" find the reason(s) for that. Man in White don't go for that, they don't want to heal you. They want earn money and sell you medicine, you should take rest of your life. You are not the patient, you are their customer. Never forget this!

Dolfo

« Reply #8 on: 16, August 2023, 13:13:08 »
Rtt posted me some infos about credit cards, ... We both think "BANKCARD" would be the best choice.  8)
« Last Edit: 16, August 2023, 14:34:20 by Dolfo »
Don't believe the shit, you hear in mainstream. Believe your own body. Your body is speaking always the true to you. But you need to understand your body. Hear to your body, not to your ego. And when body is calling to you: "Hey something is wrong!" find the reason(s) for that. Man in White don't go for that, they don't want to heal you. They want earn money and sell you medicine, you should take rest of your life. You are not the patient, you are their customer. Never forget this!

Dolfo

« Reply #9 on: 17, August 2023, 12:36:27 »
This is my change to bank.lua script, so bankcard don't bug in deposit logic.

Code: [Select]
-- The actual deposit handler
function topicDeposit(what)
    ib:SetHeader("st_005", me)
    ib:SetTitle( "Deposit - New Balance" )
   
    -- TODO this is not the best logic, but temporary helps here
    -- pl:deposit using shop_pay_amount to burn money and shop_pay_amount is the logic paying with moneycard
    -- so we deposit money to bank account only to burn same amount from bank account
    local mark = pl:FindMarkedObject()
    if mark ~=nil and mark.type==game.TYPE_BANKCARD then
      ib:SetMsg( "|The banker looks at you, shortly silent.|\n\n" )
      ib:AddMsg( "Why you show me your bankcard?\n\n" )
      ib:AddMsg( "~Please unmark your bankcard first.~\n\n" )
      return
    end
...

Better logic would be to unmark card shortly, then deposit the money, then mark card again. But atm i don't spend more time here to build logics in lua for mark/unmarking objects.

So bankcard should work. Could be the bankers and merchants from "fruitlands" close their harbour till we build in there taxes. So bankcard must be tested there. Dunno how grommit coded the fruit payment logics there?

I also have a npc selling the bankcard. Atm for 10g where it's examine price is 1 g.
« Last Edit: 17, August 2023, 21:58:11 by Dolfo »
Don't believe the shit, you hear in mainstream. Believe your own body. Your body is speaking always the true to you. But you need to understand your body. Hear to your body, not to your ego. And when body is calling to you: "Hey something is wrong!" find the reason(s) for that. Man in White don't go for that, they don't want to heal you. They want earn money and sell you medicine, you should take rest of your life. You are not the patient, you are their customer. Never forget this!

Dolfo

« Reply #10 on: 17, August 2023, 14:34:05 »
Ok rtt and me found a logical problem with the marked bankcards. We can't mark another item, for example to reforge an item.

I must read deeper how tricky it is to allow credit cards on torch spot. This would be a nice spot. This way we can also build bankcards with charisma bonus for example like Petar suggested. Or a teddybear with charima+1.  :o
« Last Edit: 17, August 2023, 21:58:00 by Dolfo »
Don't believe the shit, you hear in mainstream. Believe your own body. Your body is speaking always the true to you. But you need to understand your body. Hear to your body, not to your ego. And when body is calling to you: "Hey something is wrong!" find the reason(s) for that. Man in White don't go for that, they don't want to heal you. They want earn money and sell you medicine, you should take rest of your life. You are not the patient, you are their customer. Never forget this!

Dolfo

« Reply #11 on: 17, August 2023, 22:14:10 »
Hm, looks like this is more complicated. Torch slot is also handled different. All other slots have PLAYER_EQUIP_X definitions, but not the torch slot. I have seen that it is mostly setting apply flags to ready stuff and server logic ends in FixPlayer. So looks like this is also a workflow for client side? I really don't want to go in there. So our torch spot is a waste, would be perfect for special items.  ::)

Alternate i could try to use the shield slot for "teddy bear" or bankcard. I could simply define this items as shield and give it an own subtype? This would be much easier. This reminds me i can also try a dirty hack and define bankcard as a lightsource. So this would work on client site without the need to change things there.

On serversite i need a split to check if item is really a lightsource or another item. Theoretically i could interpret

TYPE_LIGHT_APPLY
as
TYPE_ITEM_APPLY

where i make a split to

"this is a torch" and "this is a bankcard" by different subtypes.

And then its no more the type TYPE_LIGHT_APPLY, where we decide this is a light, instead we have a subtype

x (or a subtype range) where we decide this is light.

This would open the torch slot for aditional items?  ::)
« Last Edit: 17, August 2023, 23:10:43 by Dolfo »
Don't believe the shit, you hear in mainstream. Believe your own body. Your body is speaking always the true to you. But you need to understand your body. Hear to your body, not to your ego. And when body is calling to you: "Hey something is wrong!" find the reason(s) for that. Man in White don't go for that, they don't want to heal you. They want earn money and sell you medicine, you should take rest of your life. You are not the patient, you are their customer. Never forget this!

Dolfo

« Reply #12 on: 11, October 2023, 12:12:37 »
I hope i can end this some day. I have build now 4 different bank cards. 3 versions should be sold by bank. 1 version is the royal version. All normal cards are named "bankcard", but they get their prefix from their material. royal card is named "royal bankcard" and also gets his prefix from his material.
For bankcard material i choosed bronze, silver, gold. For royal bankcard i choosed mithril.


First card should be around 1 gold, so it's a small goal for early players to get a card, last card should be 1 mith, perhaps also connected to royal experience? The 2 other cards should be between this. Atm i choosed 50g for silver and 500g for gold card?

These cards missing their bonus stats. Here we must adjust.
Perhaps
10% discount for gold card?
5% discount for silver card?
0% discount for bronze card?
and
10% discount for mithril royal card?
+1 charisma?
(Shroud wants to run around in town, with a + charisma card. Could be more than 1 charisma?)   :P

Also thinking where i store the discount? If i put this in level, this means we can not go higher than 10. Or i need a kind of level/10 to get the discount. Could be also interesting that cards get an item_level instead, so a player 1 can't use a royal card.

Also i think bankcards are for sure an item to force an egobind when buying them and don't allow to unbind this. On the other side players can still support other player by giving them the money to buy these cards, except the royal version.
« Last Edit: 11, October 2023, 12:14:46 by Dolfo »
Don't believe the shit, you hear in mainstream. Believe your own body. Your body is speaking always the true to you. But you need to understand your body. Hear to your body, not to your ego. And when body is calling to you: "Hey something is wrong!" find the reason(s) for that. Man in White don't go for that, they don't want to heal you. They want earn money and sell you medicine, you should take rest of your life. You are not the patient, you are their customer. Never forget this!

Dolfo

« Reply #13 on: 15, October 2023, 20:54:15 »
If no one answers, I do this alone.  :P I uploaded all to trunk now. Here is screenshot of npc dialog to buy cards.


You can only buy the 3 normal versions in stonehaven bank. The royal version should be harder to get for players. Also this version should be sold in the royal shop later. Need to implement the "royal fame" skill first. So you need first to have level "X" in "royal fame" before you can buy this card. But this card is finished.

I don't made it charisma. I don't want to force priests to run around with bankcards to have more heal. Also later we have for sure better items for the item slot, when players are outside town hunting mobs. So this card should be more usefully in town when players are shoping. The royalcard is item_level 110, so limited to 110 players. The discount is 11%. But this card is a magic bankcard and magic bankcards can send money back to account. So when players drop their loot in shop with an applied royal bankcard, the money goes straight to their bankaccounts. Additionally the discount works here to. So you get 11% more profit when you sell with the royal bankcard. This is a total bonus of 22% buy/sell. I think this is much better, than some charima on it. For charisma buffing special items we can find better ideas later. Perhaps a kind of orb for this slot, like orb of superior charima. But this is future. I think I focus next on the "royal fame" skill. This is mainly a skill you can transfer your royal experience to level this. I also think a good idea here is, that this skill grants also discount and profit on buy sell, so level 110 could be 11% discount when buying and 11% profit when selling.

Also with this skill we have a kind of threshold for the royal shop items. So we can think of the royal bankcard. I think price is clear 1 mithril. Also thinking of a player leveling to 110 could be around level 11 royal fame skill, when he transfers all his royal experience to this skill, so the threshold to allow to buy the royal bankcard should be at least level 11 royal fame.  ::)
« Last Edit: 15, October 2023, 21:03:51 by Dolfo »
Don't believe the shit, you hear in mainstream. Believe your own body. Your body is speaking always the true to you. But you need to understand your body. Hear to your body, not to your ego. And when body is calling to you: "Hey something is wrong!" find the reason(s) for that. Man in White don't go for that, they don't want to heal you. They want earn money and sell you medicine, you should take rest of your life. You are not the patient, you are their customer. Never forget this!

Tags:
 

Related Topics

  Subject / Started by Replies Last post
18 Replies
14612 Views
Last post 02, July 2007, 22:49:07
by Jer
5 Replies
2318 Views
Last post 28, April 2011, 04:37:23
by Killest_is_awesome
37 Replies
224793 Views
Last post 09, November 2012, 18:43:23
by hydrofiend
14 Replies
2069 Views
Last post 10, June 2015, 20:08:29
by petarkiller