Guest User

No stones v1 by pan

a guest
Dec 25th, 2013
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 4.00 KB | None | 0 0
  1. src/map/map.h   |  2 +-
  2.  src/map/pc.c    | 15 +++++++++++++++
  3.  src/map/pc.h    |  3 +++
  4.  src/map/skill.c |  9 +++++++++
  5.  4 files changed, 28 insertions(+), 1 deletion(-)
  6.  
  7. diff --git a/src/map/map.h b/src/map/map.h
  8. index 906202f..9ab5202 100644
  9. --- a/src/map/map.h
  10. +++ b/src/map/map.h
  11. @@ -410,7 +410,7 @@ enum _sp {
  12.     SP_EMATK, SP_SP_GAIN_RACE_ATTACK, SP_HP_GAIN_RACE_ATTACK, SP_SKILL_USE_SP_RATE, //2046-2049
  13.     SP_SKILL_COOLDOWN,SP_SKILL_FIXEDCAST, SP_SKILL_VARIABLECAST, SP_FIXCASTRATE, SP_VARCASTRATE, //2050-2054
  14.     SP_SKILL_USE_SP,SP_MAGIC_ATK_ELE, SP_ADD_FIXEDCAST, SP_ADD_VARIABLECAST,  //2055-2058
  15. -  
  16. +   SP_NO_CATALYSTSTONES, SP_NO_ELEMENTALSTONES,SP_NO_PAINTCANS, // 2059-2061 [pan]
  17.    
  18.     /* must be the last, plugins add bonuses from this value onwards */
  19.     SP_LAST_KNOWN,
  20. diff --git a/src/map/pc.c b/src/map/pc.c
  21. index fc1d56b..ca4d932 100644
  22. --- a/src/map/pc.c
  23. +++ b/src/map/pc.c
  24. @@ -2493,6 +2493,18 @@ int pc_bonus(struct map_session_data *sd,int type,int val) {
  25.             if(sd->state.lr_flag != 2)
  26.                 sd->special_state.no_gemstone = 1;
  27.             break;
  28. +       case SP_NO_CATALYSTSTONES:
  29. +           if(sd->state.lr_flag != 2)
  30. +               sd->special_state.no_catalyststones = 1;
  31. +           break;
  32. +       case SP_NO_ELEMENTALSTONES:
  33. +           if(sd->state.lr_flag != 2)
  34. +               sd->special_state.no_elementalstones = 1;
  35. +           break;
  36. +       case SP_NO_PAINTCANS:
  37. +           if(sd->state.lr_flag != 2)
  38. +               sd->special_state.no_paintcans = 1;
  39. +           break;
  40.         case SP_INTRAVISION: // Maya Purple Card effect allowing to see Hiding/Cloaking people [DracoRPG]
  41.             if(sd->state.lr_flag != 2) {
  42.                 sd->special_state.intravision = 1;
  43. @@ -7225,6 +7237,9 @@ int pc_readparam(struct map_session_data* sd,int type)
  44.         case SP_NO_WEAPON_DAMAGE:val = sd->special_state.no_weapon_damage; break;
  45.         case SP_NO_MISC_DAMAGE:  val = sd->special_state.no_misc_damage; break;
  46.         case SP_NO_GEMSTONE:     val = sd->special_state.no_gemstone?1:0; break;
  47. +       case SP_NO_CATALYSTSTONES: val = sd->special_state.no_catalyststones?1:0; break;
  48. +       case SP_NO_ELEMENTALSTONES:val = sd->special_state.no_elementalstones?1:0; break;
  49. +       case SP_NO_PAINTCANS:    val = sd->special_state.no_paintcans?1:0; break;
  50.         case SP_INTRAVISION:     val = sd->special_state.intravision?1:0; break;
  51.         case SP_NO_KNOCKBACK:    val = sd->special_state.no_knockback?1:0; break;
  52.         case SP_SPLASH_RANGE:    val = sd->bonus.splash_range; break;
  53. diff --git a/src/map/pc.h b/src/map/pc.h
  54. index 5264fa5..424a80a 100644
  55. --- a/src/map/pc.h
  56. +++ b/src/map/pc.h
  57. @@ -192,6 +192,9 @@ struct map_session_data {
  58.         unsigned int perfect_hiding : 1; // [Valaris]
  59.         unsigned int no_knockback : 1;
  60.         unsigned int bonus_coma : 1;
  61. +       unsigned int no_catalyststones : 1;
  62. +       unsigned int no_elementalstones : 1;
  63. +       unsigned int no_paintcans : 1;
  64.     } special_state;
  65.     int login_id1, login_id2;
  66.     unsigned short class_;  //This is the internal job ID used by the map server to simplify comparisons/queries/etc. [Skotlex]
  67. diff --git a/src/map/skill.c b/src/map/skill.c
  68. index 71e343d..97e05c0 100644
  69. --- a/src/map/skill.c
  70. +++ b/src/map/skill.c
  71. @@ -13721,6 +13721,15 @@ struct skill_condition skill_get_requirement(struct map_session_data* sd, uint16
  72.                     req.amount[i] = 1; // Hocus Pocus always use at least 1 gem
  73.             }
  74.         }
  75. +       // 7521 to 7524 ninja stones
  76. +       if( (req.itemid[i] >= 7521 && req.itemid[i] <= 7524) && sd->special_state.no_catalyststones )
  77. +           req.itemid[i] = req.amount[i] = 0;
  78. +       // 990 to 997 sorcerer stones only works when using summon skills
  79. +       if( (req.itemid[i] >= 990 && req.itemid[i] <= 997) && sd->special_state.no_elementalstones
  80. +           && (skill_id >= SO_SUMMON_AQUA && skill_id <= SO_SUMMON_TERA) )
  81. +           req.itemid[i] = req.amount[i] = 0;
  82. +       if( req.itemid[i] == 6123 && sd->special_state.no_paintcans )
  83. +           req.itemid[i] = req.amount[i] = 0;
  84.         if( skill_id >= HT_SKIDTRAP && skill_id <= HT_TALKIEBOX && pc->checkskill(sd, RA_RESEARCHTRAP) > 0){
  85.             int16 itIndex;
  86.             if( (itIndex = pc->search_inventory(sd,req.itemid[i])) < 0  || ( itIndex >= 0 && sd->status.inventory[itIndex].amount < req.amount[i] ) ){
Advertisement
Add Comment
Please, Sign In to add comment