Parsing

AW Set Perk (untested)

Dec 24th, 2014
418
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 KB | None | 0 0
  1. void SetPerk(int Client, const char* Perk)
  2. {
  3. unsigned int PerkID = BG_GetPerkIndexForName(Perk), PS, gEnt = gEntity(Client);
  4. if(!(PS = *(int *)(gEnt + 0x158)))
  5. if(!(PS = *(int *)(gEnt + 0x160)))
  6. return;
  7. __asm
  8. {
  9. mr r25, PS
  10. mr r31, PerkID
  11. mr r27, gEnt
  12. addi r11, r25, 0x130C
  13. rlwinm r10, r31, 29,3,29
  14. clrlwi r8, r31, 27
  15. li r7, 1
  16. srwi r9, r31, 5
  17. slw r8, r7, r8
  18. lwzx r6, r10, r11
  19. or r5, r8, r6
  20. stwx r5, r10, r11
  21. }
  22. if(*(int *)(gEnt + 0x158) != 0)
  23. {
  24. __asm
  25. {
  26. lwz r11, 0x158(r27)
  27. addi r11, r11, 0x3B5C
  28. slwi r10, r9, 2
  29. lwzx r7, r10, r11
  30. or r6, r7, r8
  31. //stwx r7, r10, r11
  32. }
  33. }
  34. else if(*(int *)(gEnt + 0x160) != 0)
  35. {
  36. __asm
  37. {
  38. lwz r11, 0x160(r27)
  39. addi r11, r11, 0x3A88
  40. slwi r10, r9, 2
  41. lwzx r7, r10, r11
  42. or r6, r8, r7
  43. //stwx r7, r10, r11
  44. }
  45. }
  46. }
  47.  
  48. specialty_marathon
  49. specialty_fastreload
  50. specialty_scavenger
  51. specialty_blindeye
  52. specialty_paint
  53. specialty_hardline
  54. specialty_coldblooded
  55. specialty_heartbreaker
  56. specialty_quickdraw
  57. specialty_twoprimaries
  58. specialty_detectexplosive
  59. specialty_autospot
  60. specialty_bulletaccuracy
  61. specialty_steadyaimpro
  62. specialty_quieter
  63. specialty_stalker
  64. specialty_fastmantle
  65. specialty_quickswap
  66. specialty_extraammo
  67. specialty_fasterlockon
  68. specialty_armorpiercing
  69. specialty_paint_pro
  70. specialty_rollover
  71. specialty_assists
  72. specialty_spygame
  73. specialty_empimmune
  74. specialty_fastoffhand
  75. specialty_overkillpro
  76. specialty_stun_resistance
  77. specialty_holdbreath
  78. specialty_improvedholdbreath
  79. specialty_selectivehearing
  80. specialty_fastsprintrecovery
  81. specialty_falldamage
  82. specialty_delaymine
Advertisement
Add Comment
Please, Sign In to add comment