Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2014
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.77 KB | None | 0 0
  1. int __thiscall CSkillSlot::AddAffectSkill(CSkillSlot *this, _tagAffectSkill *pAffectedSkill)
  2. {
  3. void *v3; // eax@57
  4. void *v4; // [sp+8h] [bp-B4h]@57
  5. signed int v5; // [sp+Ch] [bp-B0h]@1
  6. CSkillSlot *thisa; // [sp+10h] [bp-ACh]@1
  7. char v7; // [sp+84h] [bp-38h]@59
  8. unsigned __int16 v8; // [sp+8Ch] [bp-30h]@59
  9. int v9; // [sp+90h] [bp-2Ch]@59
  10. std::pair<unsigned int const ,SiegeBuildingInfomation *> _Val; // [sp+94h] [bp-28h]@59
  11. void *v11; // [sp+9Ch] [bp-20h]@56
  12. void *p; // [sp+A0h] [bp-1Ch]@55
  13. std::_Tree<std::_Tmap_traits<enum eCASTLE_TYPE,SiegeCastleInfomationManager *,std::less<enum eCASTLE_TYPE>,std::allocator<std::pair<enum eCASTLE_TYPE const ,SiegeCastleInfomationManager *> >,0> >::iterator result; // [sp+A4h] [bp-18h]@51
  14. std::_Tree_nod<std::_Tmap_traits<unsigned long,_tagAffectSkill *,std::less<unsigned long>,std::allocator<std::pair<unsigned long const ,_tagAffectSkill *> >,0> >::_Node *v14; // [sp+A8h] [bp-14h]@49
  15. unsigned int _Keyval; // [sp+ACh] [bp-10h]@49
  16. std::_Tree<std::_Tmap_traits<enum eCASTLE_TYPE,SiegeCastleInfomationManager *,std::less<enum eCASTLE_TYPE>,std::allocator<std::pair<enum eCASTLE_TYPE const ,SiegeCastleInfomationManager *> >,0> >::iterator iter; // [sp+B0h] [bp-Ch]@49
  17. int bRet; // [sp+B4h] [bp-8h]@49
  18. int pAS; // [sp+B8h] [bp-4h]@49
  19.  
  20. thisa = this;
  21. v5 = pAffectedSkill->nKind;
  22. if ( v5 > 4129 )
  23. {
  24. if ( v5 > 32787 )
  25. {
  26. if ( v5 <= 32978 )
  27. {
  28. if ( v5 != 32978 )
  29. {
  30. switch ( v5 )
  31. {
  32. case 32820:
  33. case 32821:
  34. case 32822:
  35. case 32823:
  36. case 32824:
  37. case 32825:
  38. case 32826:
  39. case 32827:
  40. case 32828:
  41. case 32829:
  42. case 32830:
  43. case 32831:
  44. case 32832:
  45. case 32833:
  46. case 32834:
  47. case 32835:
  48. case 32836:
  49. case 32837:
  50. case 32838:
  51. case 32839:
  52. case 32840:
  53. case 32841:
  54. case 32842:
  55. case 32843:
  56. case 32844:
  57. case 32845:
  58. case 32846:
  59. case 32847:
  60. case 32848:
  61. case 32849:
  62. case 32850:
  63. case 32851:
  64. case 32852:
  65. case 32853:
  66. case 32854:
  67. case 32855:
  68. case 32856:
  69. case 32857:
  70. case 32858:
  71. case 32859:
  72. case 32860:
  73. case 32861:
  74. case 32862:
  75. case 32863:
  76. case 32864:
  77. case 32937:
  78. case 32938:
  79. case 32939:
  80. case 32940:
  81. case 32941:
  82. case 32942:
  83. case 32943:
  84. case 32944:
  85. case 32945:
  86. case 32972:
  87. goto $L57653;
  88. default:
  89. goto LABEL_49;
  90. }
  91. goto LABEL_49;
  92. }
  93. goto $L57653;
  94. }
  95. if ( v5 > 36933 )
  96. {
  97. if ( v5 == 40965 )
  98. goto $L57653;
  99. }
  100. else
  101. {
  102. if ( v5 == 36933 || v5 >= 32983 && v5 <= 32984 )
  103. goto $L57653;
  104. }
  105. }
  106. else
  107. {
  108. if ( v5 == 32787 )
  109. goto $L57653;
  110. if ( v5 > 16430 )
  111. {
  112. if ( v5 == 32772 || v5 == 32780 || v5 == 32785 )
  113. goto $L57653;
  114. }
  115. else
  116. {
  117. if ( v5 == 16430 )
  118. goto $L57653;
  119. if ( v5 > 16412 )
  120. {
  121. if ( v5 == 16415 )
  122. goto $L57653;
  123. }
  124. else
  125. {
  126. if ( v5 >= 16411 || v5 == 4148 || v5 == 4150 )
  127. goto $L57653;
  128. }
  129. }
  130. }
  131. }
  132. else
  133. {
  134. if ( v5 == 4129 )
  135. goto $L57653;
  136. if ( v5 <= 544 )
  137. {
  138. if ( v5 < 543 )
  139. {
  140. switch ( v5 )
  141. {
  142. case 130:
  143. case 133:
  144. case 177:
  145. case 178:
  146. case 197:
  147. case 259:
  148. case 275:
  149. case 306:
  150. case 308:
  151. goto $L57653;
  152. default:
  153. goto LABEL_49;
  154. }
  155. goto LABEL_49;
  156. }
  157. $L57653:
  158. if ( CSkillSlot::IsAffectSkill(this, 0xC1u)
  159. || CSkillSlot::IsAffectSkill(thisa, 0x454u)
  160. || CSkillSlot::IsAffectSkill(thisa, 0x835u)
  161. || CSkillSlot::IsAffectSkill(thisa, 0x1017u)
  162. || CSkillSlot::IsAffectSkill(thisa, 0x102Au) )
  163. return 0;
  164. goto LABEL_49;
  165. }
  166. if ( v5 > 1103 )
  167. {
  168. if ( v5 == 2093 || v5 == 2116 || v5 == 4105 )
  169. goto $L57653;
  170. }
  171. else
  172. {
  173. if ( v5 == 1103 || v5 == 1031 )
  174. goto $L57653;
  175. if ( v5 == 1056 )
  176. {
  177. if ( CSkillSlot::IsAffectSkill(this, 0x454u) )
  178. return 0;
  179. }
  180. else
  181. {
  182. if ( v5 == 1081 )
  183. goto $L57653;
  184. }
  185. }
  186. }
  187. LABEL_49:
  188. bRet = 1;
  189. pAS = 0;
  190. EnterCriticalSection(&thisa->m_lock.m_critical_section);
  191. _Keyval = pAffectedSkill->nKind;
  192. std::_Tree<std::_Tmap_traits<unsigned_long_CWorld___std::less<unsigned_long>_std::allocator<std::pair<unsigned_long_const_CWorld__>>_0>>::find(
  193. (std::_Tree<std::_Tmap_traits<unsigned int,QuestTemplate *,std::less<unsigned int>,std::allocator<std::pair<unsigned int const ,QuestTemplate *> >,0> > *)&thisa->m_mapAffectedSkill,
  194. (std::_Tree<std::_Tmap_traits<unsigned int,QuestTemplate *,std::less<unsigned int>,std::allocator<std::pair<unsigned int const ,QuestTemplate *> >,0> >::iterator *)&iter,
  195. &_Keyval);
  196. v14 = thisa->m_mapAffectedSkill.baseclass_0._Myhead;
  197. if ( (std::_Tree_nod<std::_Tmap_traits<unsigned long,_tagAffectSkill *,std::less<unsigned long>,std::allocator<std::pair<unsigned long const ,_tagAffectSkill *> >,0> >::_Node *)iter != v14 )
  198. {
  199. pAS = *(_DWORD *)(*(_DWORD *)&iter + 16);
  200. if ( *(_BYTE *)(pAS + 2) > pAffectedSkill->nLevel )
  201. bRet = 0;
  202. else
  203. std::_Tree<std::_Tmap_traits<unsigned_int_SoundRegionScript___std::less<unsigned_int>_std::allocator<std::pair<unsigned_int_const_SoundRegionScript__>>_0>>::erase(
  204. (std::_Tree<std::_Tmap_traits<enum eCASTLE_TYPE,SiegeCastleInfomationManager *,std::less<enum eCASTLE_TYPE>,std::allocator<std::pair<enum eCASTLE_TYPE const ,SiegeCastleInfomationManager *> >,0> > *)&thisa->m_mapAffectedSkill,
  205. &result,
  206. iter);
  207. }
  208. LeaveCriticalSection(&thisa->m_lock.m_critical_section);
  209. if ( bRet )
  210. {
  211. if ( pAS )
  212. {
  213. ((void (__thiscall *)(CSkillSlot *, signed int, int, _DWORD, _DWORD))thisa->baseclass_0.vfptr[11].OnSkillEvent)(
  214. thisa,
  215. 7,
  216. pAS,
  217. 0,
  218. 0);
  219. p = (void *)pAS;
  220. operator delete((void *)pAS);
  221. }
  222. v11 = operator new(0x20u);
  223. if ( v11 )
  224. {
  225. _tagAffectSkill::_tagAffectSkill((_tagAffectSkill *)v11);
  226. v4 = v3;
  227. }
  228. else
  229. {
  230. v4 = 0;
  231. }
  232. pAS = (int)v4;
  233. memcpy(v4, pAffectedSkill, 0x20u);
  234. EnterCriticalSection(&thisa->m_lock.m_critical_section);
  235. v8 = *(_WORD *)pAS;
  236. v9 = pAS;
  237. _Val.first = v8;
  238. _Val.second = (SiegeBuildingInfomation *)pAS;
  239. std::_Tree<std::_Tmap_traits<unsigned_int_SoundRegionScript___std::less<unsigned_int>_std::allocator<std::pair<unsigned_int_const_SoundRegionScript__>>_0>>::insert(
  240. (std::_Tree<std::_Tmap_traits<unsigned int,SiegeBuildingInfomation *,std::less<unsigned int>,std::allocator<std::pair<unsigned int const ,SiegeBuildingInfomation *> >,0> > *)&thisa->m_mapAffectedSkill,
  241. (std::pair<std::_Tree<std::_Tmap_traits<unsigned int,SiegeBuildingInfomation *,std::less<unsigned int>,std::allocator<std::pair<unsigned int const ,SiegeBuildingInfomation *> >,0> >::iterator,bool> *)&v7,
  242. &_Val);
  243. LeaveCriticalSection(&thisa->m_lock.m_critical_section);
  244. }
  245. return bRet;
  246. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement