Jump to content
  • 0
gweilo321

open Owners items with bonuses

Question

So in the database 'item' you have all of the items that every player has in their inventory. Is it possible to also read the bonuses of those items into php for example?

Share this post


Link to post

5 answers to this question

Recommended Posts

  • 0
2 minutes ago, Alerin said:

Yes,

socket - soul stone etc

attrtype and attrvalue - bonus

 

Here you have a class to read bonuses https://github.com/Alerinos/M2-WWW-Bonus

Thanks! Thats what i been looking for. So it looks like theyre coming from item_attr and the attrype is just the order in the database. Thanks.

Share this post


Link to post
  • 0
Posted (edited)

item_attr are bonuses that can be earned in the game. There are more bonuses in the source code, the ID is important.

TValueName c_aApplyTypeNames[] =
{
    { "STR",      APPLY_STR     },
    { "DEX",      APPLY_DEX     },
    { "CON",      APPLY_CON     },
    { "INT",      APPLY_INT     },
    { "MAX_HP",       APPLY_MAX_HP      },
    { "MAX_SP",       APPLY_MAX_SP      },
    { "MAX_STAMINA",   APPLY_MAX_STAMINA  },
    { "POISON_REDUCE", APPLY_POISON_REDUCE    },
    { "EXP_DOUBLE_BONUS", APPLY_EXP_DOUBLE_BONUS },
    { "GOLD_DOUBLE_BONUS", APPLY_GOLD_DOUBLE_BONUS },
    { "ITEM_DROP_BONUS", APPLY_ITEM_DROP_BONUS },
    { "HP_REGEN",  APPLY_HP_REGEN    },
    { "SP_REGEN",  APPLY_SP_REGEN    },
    { "ATTACK_SPEED",  APPLY_ATT_SPEED       },
    { "MOVE_SPEED",    APPLY_MOV_SPEED       },
    { "CAST_SPEED",    APPLY_CAST_SPEED   },
    { "ATT_BONUS", APPLY_ATT_GRADE_BONUS  },
    { "DEF_BONUS", APPLY_DEF_GRADE_BONUS  },
    { "MAGIC_ATT_GRADE",APPLY_MAGIC_ATT_GRADE  },
    { "MAGIC_DEF_GRADE",APPLY_MAGIC_DEF_GRADE  },
    { "SKILL",    APPLY_SKILL       },
    { "ATTBONUS_ANIMAL",APPLY_ATTBONUS_ANIMAL  },
    { "ATTBONUS_UNDEAD",APPLY_ATTBONUS_UNDEAD  },
    { "ATTBONUS_DEVIL", APPLY_ATTBONUS_DEVIL   },
    { "ATTBONUS_HUMAN", APPLY_ATTBONUS_HUMAN   },
    { "ADD_BOW_DISTANCE",APPLY_BOW_DISTANCE    },
    { "DODGE",    APPLY_DODGE       },
    { "BLOCK",    APPLY_BLOCK       },
    { "RESIST_SWORD",  APPLY_RESIST_SWORD },
    { "RESIST_TWOHAND",    APPLY_RESIST_TWOHAND   },
    { "RESIST_DAGGER", APPLY_RESIST_DAGGER    },
    { "RESIST_BELL",   APPLY_RESIST_BELL  },
    { "RESIST_FAN",    APPLY_RESIST_FAN   },
    { "RESIST_BOW",    APPLY_RESIST_BOW   },
    { "RESIST_FIRE",   APPLY_RESIST_FIRE  },
    { "RESIST_ELEC",   APPLY_RESIST_ELEC  },
    { "RESIST_MAGIC",  APPLY_RESIST_MAGIC },
    { "RESIST_WIND",   APPLY_RESIST_WIND  },
   { "REFLECT_MELEE", APPLY_REFLECT_MELEE },
   { "REFLECT_CURSE", APPLY_REFLECT_CURSE },
    { "RESIST_ICE",       APPLY_RESIST_ICE   },
    { "RESIST_EARTH",  APPLY_RESIST_EARTH },
    { "RESIST_DARK",   APPLY_RESIST_DARK  },
    { "RESIST_CRITICAL",   APPLY_ANTI_CRITICAL_PCT    },
    { "RESIST_PENETRATE",  APPLY_ANTI_PENETRATE_PCT   },
    { "POISON",       APPLY_POISON_PCT   },
    { "SLOW",     APPLY_SLOW_PCT    },
    { "STUN",     APPLY_STUN_PCT    },
    { "STEAL_HP",  APPLY_STEAL_HP    },
    { "STEAL_SP",  APPLY_STEAL_SP    },
    { "MANA_BURN_PCT", APPLY_MANA_BURN_PCT    },
    { "CRITICAL",  APPLY_CRITICAL_PCT },
    { "PENETRATE", APPLY_PENETRATE_PCT    },
    { "KILL_SP_RECOVER",APPLY_KILL_SP_RECOVER  },
    { "KILL_HP_RECOVER",APPLY_KILL_HP_RECOVER  },
    { "PENETRATE_PCT", APPLY_PENETRATE_PCT    },
    { "CRITICAL_PCT",  APPLY_CRITICAL_PCT },
    { "POISON_PCT",    APPLY_POISON_PCT   },
    { "STUN_PCT",  APPLY_STUN_PCT    },
    { "ATT_BONUS_TO_WARRIOR",  APPLY_ATTBONUS_WARRIOR  },
    { "ATT_BONUS_TO_ASSASSIN", APPLY_ATTBONUS_ASSASSIN },
    { "ATT_BONUS_TO_SURA", APPLY_ATTBONUS_SURA        },
    { "ATT_BONUS_TO_SHAMAN",   APPLY_ATTBONUS_SHAMAN   },
    { "ATT_BONUS_TO_MONSTER",  APPLY_ATTBONUS_MONSTER  },
    { "ATT_BONUS_TO_MOB",  APPLY_ATTBONUS_MONSTER  },
    { "MALL_ATTBONUS", APPLY_MALL_ATTBONUS    },
    { "MALL_EXPBONUS", APPLY_MALL_EXPBONUS    },
    { "MALL_DEFBONUS", APPLY_MALL_DEFBONUS    },
    { "MALL_ITEMBONUS",    APPLY_MALL_ITEMBONUS   },
    { "MALL_GOLDBONUS", APPLY_MALL_GOLDBONUS   },
    { "MAX_HP_PCT",    APPLY_MAX_HP_PCT   },
    { "MAX_SP_PCT",    APPLY_MAX_SP_PCT   },
    { "SKILL_DAMAGE_BONUS",    APPLY_SKILL_DAMAGE_BONUS   },
    { "NORMAL_HIT_DAMAGE_BONUS",APPLY_NORMAL_HIT_DAMAGE_BONUS  },
    { "SKILL_DEFEND_BONUS",    APPLY_SKILL_DEFEND_BONUS   },
    { "NORMAL_HIT_DEFEND_BONUS",APPLY_NORMAL_HIT_DEFEND_BONUS  },
    { "PCBANG_EXP_BONUS", APPLY_PC_BANG_EXP_BONUS  },
    { "PCBANG_DROP_BONUS", APPLY_PC_BANG_DROP_BONUS    },

    { "RESIST_WARRIOR",    APPLY_RESIST_WARRIOR},
    { "RESIST_ASSASSIN",   APPLY_RESIST_ASSASSIN},
    { "RESIST_SURA",      APPLY_RESIST_SURA},
    { "RESIST_SHAMAN", APPLY_RESIST_SHAMAN},
    // by mhh game/affect.h 정의되어있음. INFINITE_AFFECT_DURATION = 0x1FFFFFFF
    { "INFINITE_AFFECT_DURATION", 0x1FFFFFFF   },
   { "ENERGY", APPLY_ENERGY },       // 기력
   { "COSTUME_ATTR_BONUS", APPLY_COSTUME_ATTR_BONUS },       // 기력
   { "MAGIC_ATTBONUS_PER",    APPLY_MAGIC_ATTBONUS_PER   },
    { "MELEE_MAGIC_ATTBONUS_PER",  APPLY_MELEE_MAGIC_ATTBONUS_PER },

#ifdef ENABLE_WOLFMAN_CHARACTER -> NIE MA
   { "BLEEDING_REDUCE",APPLY_BLEEDING_REDUCE },
   { "BLEEDING_PCT",APPLY_BLEEDING_PCT },
   { "ATT_BONUS_TO_WOLFMAN",APPLY_ATTBONUS_WOLFMAN },
   { "RESIST_WOLFMAN",APPLY_RESIST_WOLFMAN },
   { "RESIST_CLAW",APPLY_RESIST_CLAW },
#endif

#ifdef ENABLE_ACCE_COSTUME_SYSTEM
   { "ACCEDRAIN_RATE",APPLY_ACCEDRAIN_RATE },
#endif
#ifdef ENABLE_MAGIC_REDUCTION_SYSTEM
   { "RESIST_MAGIC_REDUCTION",APPLY_RESIST_MAGIC_REDUCTION },
#endif

    { NULL,       0        }

 

Edited by Alerin (see edit history)

Share this post


Link to post
  • 0
3 hours ago, Alerin said:

item_attr are bonuses that can be earned in the game. There are more bonuses in the source code, the ID is important.


TValueName c_aApplyTypeNames[] =
{
    { "STR",      APPLY_STR     },
    { "DEX",      APPLY_DEX     },
    { "CON",      APPLY_CON     },
    { "INT",      APPLY_INT     },
    { "MAX_HP",       APPLY_MAX_HP      },
    { "MAX_SP",       APPLY_MAX_SP      },
    { "MAX_STAMINA",   APPLY_MAX_STAMINA  },
    { "POISON_REDUCE", APPLY_POISON_REDUCE    },
    { "EXP_DOUBLE_BONUS", APPLY_EXP_DOUBLE_BONUS },
    { "GOLD_DOUBLE_BONUS", APPLY_GOLD_DOUBLE_BONUS },
    { "ITEM_DROP_BONUS", APPLY_ITEM_DROP_BONUS },
    { "HP_REGEN",  APPLY_HP_REGEN    },
    { "SP_REGEN",  APPLY_SP_REGEN    },
    { "ATTACK_SPEED",  APPLY_ATT_SPEED       },
    { "MOVE_SPEED",    APPLY_MOV_SPEED       },
    { "CAST_SPEED",    APPLY_CAST_SPEED   },
    { "ATT_BONUS", APPLY_ATT_GRADE_BONUS  },
    { "DEF_BONUS", APPLY_DEF_GRADE_BONUS  },
    { "MAGIC_ATT_GRADE",APPLY_MAGIC_ATT_GRADE  },
    { "MAGIC_DEF_GRADE",APPLY_MAGIC_DEF_GRADE  },
    { "SKILL",    APPLY_SKILL       },
    { "ATTBONUS_ANIMAL",APPLY_ATTBONUS_ANIMAL  },
    { "ATTBONUS_UNDEAD",APPLY_ATTBONUS_UNDEAD  },
    { "ATTBONUS_DEVIL", APPLY_ATTBONUS_DEVIL   },
    { "ATTBONUS_HUMAN", APPLY_ATTBONUS_HUMAN   },
    { "ADD_BOW_DISTANCE",APPLY_BOW_DISTANCE    },
    { "DODGE",    APPLY_DODGE       },
    { "BLOCK",    APPLY_BLOCK       },
    { "RESIST_SWORD",  APPLY_RESIST_SWORD },
    { "RESIST_TWOHAND",    APPLY_RESIST_TWOHAND   },
    { "RESIST_DAGGER", APPLY_RESIST_DAGGER    },
    { "RESIST_BELL",   APPLY_RESIST_BELL  },
    { "RESIST_FAN",    APPLY_RESIST_FAN   },
    { "RESIST_BOW",    APPLY_RESIST_BOW   },
    { "RESIST_FIRE",   APPLY_RESIST_FIRE  },
    { "RESIST_ELEC",   APPLY_RESIST_ELEC  },
    { "RESIST_MAGIC",  APPLY_RESIST_MAGIC },
    { "RESIST_WIND",   APPLY_RESIST_WIND  },
   { "REFLECT_MELEE", APPLY_REFLECT_MELEE },
   { "REFLECT_CURSE", APPLY_REFLECT_CURSE },
    { "RESIST_ICE",       APPLY_RESIST_ICE   },
    { "RESIST_EARTH",  APPLY_RESIST_EARTH },
    { "RESIST_DARK",   APPLY_RESIST_DARK  },
    { "RESIST_CRITICAL",   APPLY_ANTI_CRITICAL_PCT    },
    { "RESIST_PENETRATE",  APPLY_ANTI_PENETRATE_PCT   },
    { "POISON",       APPLY_POISON_PCT   },
    { "SLOW",     APPLY_SLOW_PCT    },
    { "STUN",     APPLY_STUN_PCT    },
    { "STEAL_HP",  APPLY_STEAL_HP    },
    { "STEAL_SP",  APPLY_STEAL_SP    },
    { "MANA_BURN_PCT", APPLY_MANA_BURN_PCT    },
    { "CRITICAL",  APPLY_CRITICAL_PCT },
    { "PENETRATE", APPLY_PENETRATE_PCT    },
    { "KILL_SP_RECOVER",APPLY_KILL_SP_RECOVER  },
    { "KILL_HP_RECOVER",APPLY_KILL_HP_RECOVER  },
    { "PENETRATE_PCT", APPLY_PENETRATE_PCT    },
    { "CRITICAL_PCT",  APPLY_CRITICAL_PCT },
    { "POISON_PCT",    APPLY_POISON_PCT   },
    { "STUN_PCT",  APPLY_STUN_PCT    },
    { "ATT_BONUS_TO_WARRIOR",  APPLY_ATTBONUS_WARRIOR  },
    { "ATT_BONUS_TO_ASSASSIN", APPLY_ATTBONUS_ASSASSIN },
    { "ATT_BONUS_TO_SURA", APPLY_ATTBONUS_SURA        },
    { "ATT_BONUS_TO_SHAMAN",   APPLY_ATTBONUS_SHAMAN   },
    { "ATT_BONUS_TO_MONSTER",  APPLY_ATTBONUS_MONSTER  },
    { "ATT_BONUS_TO_MOB",  APPLY_ATTBONUS_MONSTER  },
    { "MALL_ATTBONUS", APPLY_MALL_ATTBONUS    },
    { "MALL_EXPBONUS", APPLY_MALL_EXPBONUS    },
    { "MALL_DEFBONUS", APPLY_MALL_DEFBONUS    },
    { "MALL_ITEMBONUS",    APPLY_MALL_ITEMBONUS   },
    { "MALL_GOLDBONUS", APPLY_MALL_GOLDBONUS   },
    { "MAX_HP_PCT",    APPLY_MAX_HP_PCT   },
    { "MAX_SP_PCT",    APPLY_MAX_SP_PCT   },
    { "SKILL_DAMAGE_BONUS",    APPLY_SKILL_DAMAGE_BONUS   },
    { "NORMAL_HIT_DAMAGE_BONUS",APPLY_NORMAL_HIT_DAMAGE_BONUS  },
    { "SKILL_DEFEND_BONUS",    APPLY_SKILL_DEFEND_BONUS   },
    { "NORMAL_HIT_DEFEND_BONUS",APPLY_NORMAL_HIT_DEFEND_BONUS  },
    { "PCBANG_EXP_BONUS", APPLY_PC_BANG_EXP_BONUS  },
    { "PCBANG_DROP_BONUS", APPLY_PC_BANG_DROP_BONUS    },

    { "RESIST_WARRIOR",    APPLY_RESIST_WARRIOR},
    { "RESIST_ASSASSIN",   APPLY_RESIST_ASSASSIN},
    { "RESIST_SURA",      APPLY_RESIST_SURA},
    { "RESIST_SHAMAN", APPLY_RESIST_SHAMAN},
    // by mhh game/affect.h 정의되어있음. INFINITE_AFFECT_DURATION = 0x1FFFFFFF
    { "INFINITE_AFFECT_DURATION", 0x1FFFFFFF   },
   { "ENERGY", APPLY_ENERGY },       // 기력
   { "COSTUME_ATTR_BONUS", APPLY_COSTUME_ATTR_BONUS },       // 기력
   { "MAGIC_ATTBONUS_PER",    APPLY_MAGIC_ATTBONUS_PER   },
    { "MELEE_MAGIC_ATTBONUS_PER",  APPLY_MELEE_MAGIC_ATTBONUS_PER },

#ifdef ENABLE_WOLFMAN_CHARACTER -> NIE MA
   { "BLEEDING_REDUCE",APPLY_BLEEDING_REDUCE },
   { "BLEEDING_PCT",APPLY_BLEEDING_PCT },
   { "ATT_BONUS_TO_WOLFMAN",APPLY_ATTBONUS_WOLFMAN },
   { "RESIST_WOLFMAN",APPLY_RESIST_WOLFMAN },
   { "RESIST_CLAW",APPLY_RESIST_CLAW },
#endif

#ifdef ENABLE_ACCE_COSTUME_SYSTEM
   { "ACCEDRAIN_RATE",APPLY_ACCEDRAIN_RATE },
#endif
#ifdef ENABLE_MAGIC_REDUCTION_SYSTEM
   { "RESIST_MAGIC_REDUCTION",APPLY_RESIST_MAGIC_REDUCTION },
#endif

    { NULL,       0        }

 

Thanks alot. So in your bonus.php most of the bonuses are included? And is it possible to get the stones from the items aswell?

Share this post


Link to post
  • 0

Unfortunately, this class is for bonuses. I never wondered how soul stones work. I need to look at the source code.

  • Love 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.