19 #ifndef __LOOTRANDOMIZER_H__ 20 #define __LOOTRANDOMIZER_H__ 114 bool GetModifiers(uint32_t itemID, csArray<psGMSpawnMods::ItemModifier>& mods);
123 psItem* SetModifiers(
psItem* item, csArray<uint32_t>& mods);
136 bool lootTesting =
false,
137 size_t numModifiers = 0);
164 float GetModifierPercentProbability(
int modifierID,
int modifierType);
185 bool SetAttribute(
const csString &op,
const csString &attrName,
float modifier,
RandomizedOverlay* overlay,
psItemStats* baseItem, csArray<ValueModifier> &values);
195 void SetAttributeApplyOP(
float* value[],
float modifier,
size_t amount,
const csString &op);
206 csString GenerateScriptXML(csString &
name, csString &
equip_script, csArray<ValueModifier> &values);
This class stores an array of LootModifiers and randomizes loot stats.
uint32_t id
The id assigned to this modifier in the db. It's referenced by psitem.
csString not_usable_with
Defines which modifiers this isn't usable with.
csString op
The operation parsed for this reference to the variable ADD, MUL, VAL (VAL is the default value...
float cost_modifier
The cost of this modifier.
A MathScript is a mini-program to run.
csHash< LootModifier *, uint32_t > LootModifiersById
Keeps all the lootmodifiers for faster access when we know the id.
float probabilityRange
The probability for this loot modifier expressed as range between current number and previous one...
csString modifier_type
The type of modifier (suffix, prefix, adjective)
float value
The value to apply to the variable through the requested operation in op.
This structure contains the parsed data from Attributes recarding script variables.
csString equip_script
The part of equip_script to add to the item when this modifier is used.
csString stat_req_modifier
The additional requirements to stats when this modifier is used.
csString mesh
The mesh this modifier will use for the random item generated.
csArray< LootModifier * > adjectives
Keeps all the loot modifiers of type "adjective".
csHash< bool, uint32_t > itemRestrain
Contains if the itemid is allowed or not. item id 0 means all items, false means disallowed.
csArray< LootModifier * > suffixes
Keeps all the loot modifiers of type "suffix".
bool IsAllowed(uint32_t itemID)
csString effect
Declares modifiers to some stats like weight, weapon speed, resistance/attack types.
This huge class stores all the properties of any object a player can have in the game.
This class manages the caching of data that is unchanging during server operation.
float probability
The probability for this loot modifier to happen when generating a random item.
uint32_t mod_id
The modifier position ID.
This class holds one loot modifier The lootRandomizer contions arrays of these.
csString name
The part of name which this modifier will add when used. The position is determined by modifier_type...
csString icon
The icon this modifier will use for the random item generated.
csString name
The name of the variable.
Stores the randomized stats from the loot randomizer, it could be used to apply any global special ef...
csArray< LootModifier * > prefixes
Keeps all the loot modifiers of type "prefix".
CacheManager * cacheManager
A reference to the cachemanager.
This class embodies item instances in the game.
MathScript * modifierCostCalc
A cached reference to the LootModifierCap math script.