Advertisement
dreamunreal

CHARM_improve

Jun 9th, 2011
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.89 KB | None | 0 0
  1. e.g:
  2. 12623,eg,神奇灵巧护符,12,50,,70,,,,,0xFFFFFFFF,7,2,,,60,,,{ bonus bDex,200; },{},{}
  3.  
  4. item type 12.
  5.  
  6. 0xFFFFFFF,7 -> witch job/upper? have effect
  7.  
  8.  
  9. //------------------------------- DB ---------------------------------\\
  10. db/const.txt
  11. found:
  12. IT_DELAYCONSUME 11
  13.  
  14. add after:
  15. IT_CHARM 12
  16.  
  17.  
  18. //------------------------------- SRC ---------------------------------\\
  19. mmo.h
  20. found
  21. IT_DELAYCONSUME,//11
  22.  
  23. add after
  24. IT_CHARM = 12,//12
  25.  
  26.  
  27. clif.c
  28. found
  29. return ( type == IT_PETEGG ) ? IT_WEAPON : type;
  30.  
  31. replace by
  32. return ( type == IT_PETEGG ) ? IT_WEAPON : (type == IT_CHARM) ? IT_ETC : type;
  33.  
  34.  
  35. found
  36. if(map[sd->bl.m].flag.loadevent) // Lance
  37.     npc_script_event(sd, NPCE_LOADMAP);
  38.  
  39. add after
  40. // recalc charm data change when warp
  41.     status_calc_pc(sd,0);
  42.  
  43.  
  44. itemdb.c
  45. found
  46. case IT_PETARMOR:       return "Pet Accessory";
  47.  
  48. add after
  49. case IT_CHARM:          return "Charms";
  50.  
  51.  
  52. found
  53. case IT_PETARMOR:    // <-------------  two times
  54.  
  55. add after
  56. case IT_CHARM: 
  57.  
  58.  
  59. found
  60. if( id->type < 0 || id->type == IT_UNKNOWN || id->type == IT_UNKNOWN2 || ( id->type > IT_DELAYCONSUME && id->type < IT_CASH ) || id->type >= IT_MAX )
  61.  
  62. replace by
  63. if( id->type < 0 || id->type == IT_UNKNOWN || id->type == IT_UNKNOWN2 || ( id->type > IT_CHARM && id->type < IT_CASH ) || id->type >= IT_MAX )
  64.  
  65.  
  66.  
  67. pc.c
  68. found:
  69. //Auto-equip
  70. if(data->flag.autoequip) pc_equipitem(sd, i, data->equip);
  71.  
  72. add after:
  73. if(sd->inventory_data[i]->type == IT_CHARM) status_calc_pc(sd,0);
  74.  
  75.  
  76. found:
  77. int pc_delitem(struct map_session_data *sd,int n,int amount,int type, short reason)
  78.  {
  79.  
  80. add after:
  81. int mem = 0;
  82.  
  83. found:
  84. if(sd->status.inventory[n].equip)
  85.     pc_unequipitem(sd,n,3);
  86. add after:
  87. mem = sd->inventory_data[n]->type;
  88.  
  89.  
  90. found:
  91. if(!(type&2))
  92.     clif_updatestatus(sd,SP_WEIGHT);
  93.  
  94. add after:
  95. if(mem == IT_CHARM) status_calc_pc(sd,0);
  96.  
  97. found
  98. npc_script_event(sd,NPCE_DIE);
  99.  
  100. add after
  101. // recalc charm data change.when dead
  102. status_calc_pc(sd,0);
  103.  
  104.  
  105.  
  106. status.c
  107.  
  108. found:
  109.  
  110. for(i=0;i<EQI_MAX-1;i++) {
  111.         current_equip_item_index = index = sd->equip_index[i]; //We pass INDEX to current_equip_item_index - for EQUIP_SCRIPT (new cards solution) [Lupus]
  112.  
  113.  
  114. add before:
  115. for(i=0;i<MAX_INVENTORY;i++){
  116.             if(!sd->inventory_data[i])
  117.                 continue;
  118.         if(sd->inventory_data[i]->type == IT_CHARM){
  119.                 if(sd->inventory_data[i]->script && sd->inventory_data[i]->elv <=sd->status.base_level) {
  120.                 if((!((1<<(sd->class_&MAPID_BASEMASK)) &(sd->inventory_data[i]->class_base[sd->class_&JOBL_2_1?1:(sd->class_&JOBL_2_2?2:0)])))
  121.                 || (!((1<<(sd->class_&JOBL_UPPER?1:(sd->class_&JOBL_BABY?2:0))) &sd->inventory_data[i]->class_upper))) continue;            
  122.                     run_script(sd->inventory_data[i]->script,0,sd->bl.id,0);
  123.                 if (!calculating) //Abort, run_script retriggered this. [Skotlex]
  124.                     return 1;
  125.                 }
  126.     }
  127. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement