Jump to content
  • 0

Multiplying Card Slot Bonus


Humble_Bee

Question


  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.03
  • Content Count:  112
  • Reputation:   9
  • Joined:  09/22/19
  • Last Seen:  

Hi Gang. I'm looking for a source mod that would check how many equip spots a weapon or armor takes up and then would use that number to multiply how many cards an equipment has.

Example: A sword has a card in it that gives a 5% atk boost. A two-handed sword has that same card in it, but the game reads it as two cards, giving the player a 10% atk boost.

I'm doing this to balance two-handed weapons and multi-equip-spot armor in my game. If this seems difficult to code, but multiplying the bonus of the cards would be easier, I'm open to that for now, but I want to have my game think there are two cards present in two-handed weapons for the purpose of card combo bonuses.

Example 2: An upper headgear has a card in it that boosts Def by 30.  A upper/mid/lower headgear has that same card in it, but the game reads it as if it were 3 cards, so the Def boost is 90.

Also, obviously this wouldn't only apply to cards themselves, but also any bonus that goes into a card slot, like enchants.

Thanks for any leads! If you can do this through scripting but aren't confident in your ability to do this through source mod, I'd be happy to try that out, as at least it would give me a working model for the time being.

(Mods: Woops. Should have posted this in Source Request instead of Source Support. My bad. Feel free to move it, since I can't delete it on my own.)

Edited by Humble_Bee
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  862
  • Reputation:   115
  • Joined:  05/23/12
  • Last Seen:  

Maybe this is what ur looking for:

*getiteminfo(<item ID<type>)
   
  This function will look up the item with the specified ID number in the database
  and return the info set by TYPE argument.
  It will return -1 if there is no such item.
   
  Valid types are:
  0 - Buy Price
  1 - Sell Price
  2 - Type
  3 - maxchance (max drop chance of this item, e.g. 1 = 0.01%)
  if = 0, then monsters don't drop it at all (rare or a quest item)
  if = 10000, then this item is sold in NPC shops only
  4 - Gender
  5 - Loc
  6 - Weight
  7 - ATK
  8 - DEF
  9 - Range
  10 - Slot
  11 - View
  12 - eLV
  13 - wLV
  14 - SpriteID from 'db/item_avail.txt'
  15 - eLVMax
  16 - matk if RENEWAL is defined
 
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.03
  • Content Count:  112
  • Reputation:   9
  • Joined:  09/22/19
  • Last Seen:  

On 3/14/2021 at 8:54 PM, Rynbef said:

Maybe this is what ur looking for:

 

While I can see how getiteminfo perhaps could be used to pull up what view an item was in, it's not quite what I'm looking for, because I don't know how I would include it in code to do what I want.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  46
  • Topics Per Day:  0.01
  • Content Count:  292
  • Reputation:   17
  • Joined:  12/12/11
  • Last Seen:  

On 3/14/2021 at 6:57 AM, Humble_Bee said:

Hi Gang. I'm looking for a source mod that would check how many equip spots a weapon or armor takes up and then would use that number to multiply how many cards an equipment has.

Example: A sword has a card in it that gives a 5% atk boost. A two-handed sword has that same card in it, but the game reads it as two cards, giving the player a 10% atk boost.

I'm doing this to balance two-handed weapons and multi-equip-spot armor in my game. If this seems difficult to code, but multiplying the bonus of the cards would be easier, I'm open to that for now, but I want to have my game think there are two cards present in two-handed weapons for the purpose of card combo bonuses.

Example 2: An upper headgear has a card in it that boosts Def by 30.  A upper/mid/lower headgear has that same card in it, but the game reads it as if it were 3 cards, so the Def boost is 90.

Also, obviously this wouldn't only apply to cards themselves, but also any bonus that goes into a card slot, like enchants.

Thanks for any leads! If you can do this through scripting but aren't confident in your ability to do this through source mod, I'd be happy to try that out, as at least it would give me a working model for the time being.

(Mods: Woops. Should have posted this in Source Request instead of Source Support. My bad. Feel free to move it, since I can't delete it on my own.)

hmm i think this is what you need:

 

---------------------------------------

*isequipped(<id>{,<id>{,..}})

This function will return 1 if the invoking character has all of the item
IDs given equipped (if card IDs are passed, then it checks if the cards are
inserted into slots in the equipment they are currently wearing). Theoretically
there is no limit to the number of items that may be tested for at the same time.
If even one of the items given is not equipped, 0 will be returned.

    // (Poring,Santa Poring,Poporing,Marin)
    if (isequipped(4001,4005,4033,4196)) mes "Wow! You're wearing a full complement of possible poring cards!";
    // (Poring)
    if (isequipped(4001)) mes "A poring card is useful, don't you think?";

The function was meant for item scripts to support the cards released by Gravity
in February 2005, but it will work just fine in normal NPC scripts.

---------------------------------------

*isequippedcnt(<id>{,<id>{,..}})

This function is similar to 'isequipped', but instead of 1 or 0, it will return
the amount of item/card equipped that were found on the invoking character from the given list.

Example:
    if (isequippedcnt(4001,4005,4033,4196) == 5)
		mes "Finally got 5 cards from poring monsters type?";

---------------------------------------

*checkequipedcard(<card id>)

This function will return 1 if the card specified by its item ID number is
inserted into any equipment they have in their inventory, currently equipped or
not.

---------------------------------------

check doc/script_commands.txt

 

way back before, to stop kiel card from stacking

bonus bDelayRate,( -30 / isequippedcnt(4403) );

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.03
  • Content Count:  112
  • Reputation:   9
  • Joined:  09/22/19
  • Last Seen:  

In order to use that response, I think I would have to put the first person's suggestion together with yours, looking for the view number of the item, and if the item view was taking up more than one equip spot, then look to see if there was a card, and if there was a card, then multiply it by how many slots the equip is taking up. I imagine there might be an easier way to code it, but perhaps not. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...