Advertisement
Guest User

asd

a guest
May 10th, 2012
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 67.45 KB | None | 0 0
  1. #include "pokemon/skills/bug.inc"
  2. #include "pokemon/skills/dragon.inc"
  3. #include "pokemon/skills/electric.inc"
  4. #include "pokemon/skills/fighting.inc"
  5. #include "pokemon/skills/fire.inc"
  6. #include "pokemon/skills/flying.inc"
  7. #include "pokemon/skills/ghost.inc"
  8. #include "pokemon/skills/grass.inc"
  9. #include "pokemon/skills/ground.inc"
  10. #include "pokemon/skills/ice.inc"
  11. #include "pokemon/skills/normal.inc"
  12. #include "pokemon/skills/poison.inc"
  13. #include "pokemon/skills/psychic.inc"
  14. #include "pokemon/skills/rock.inc"
  15. #include "pokemon/skills/water.inc"
  16. #include "pokemon/skills/steel.inc"
  17. #include "pokemon/skills/dark.inc"
  18. #include "pokemon/skills/custom.inc"
  19.  
  20. enum
  21. {
  22. SKILL_ABSORB,
  23. SKILL_ACID,
  24. SKILL_ACIDARMOR,
  25. SKILL_AGILITY,
  26. SKILL_AMNESIA,
  27. SKILL_AURORABEAM,
  28. SKILL_BARRAGE,
  29. SKILL_BIDE,
  30. SKILL_BITE,
  31. SKILL_POWDEREDSNOW,
  32. SKILL_BODYSLAM,
  33. SKILL_BONECLUB,
  34. SKILL_BONEMERANG,
  35. SKILL_BUBBLEBEAM,
  36. SKILL_CONFUSERAY,
  37. SKILL_CONFUSION,
  38. SKILL_CONSTRICT,
  39. SKILL_CONVERSION,
  40. SKILL_COUNTER,
  41. SKILL_DEFENSECURL,
  42. SKILL_DIG,
  43. SKILL_DISABLE,
  44. SKILL_DIZZYPUNCH,
  45. SKILL_DOUBLEEDGE,
  46. SKILL_DOUBLEKICK,
  47. SKILL_DOUBLESLAP,
  48. SKILL_DOUBLETEAM,
  49. SKILL_DRAGONRAGE,
  50. SKILL_DREAMEATER,
  51. SKILL_DRILLPECK,
  52. SKILL_EARTHQUAKE,
  53. SKILL_EGGBOMB,
  54. SKILL_EMBER,
  55. SKILL_EXPLOSION,
  56. SKILL_FIREBLAST,
  57. SKILL_FIRESPIN,
  58. SKILL_FISSURE,
  59. SKILL_FLAMETHROWER,
  60. SKILL_FLASH,
  61. SKILL_FLY,
  62. SKILL_GLARE,
  63. SKILL_GROWTH,
  64. SKILL_GUILLOTINE,
  65. SKILL_GUST,
  66. SKILL_HARDER,
  67. SKILL_HAZE,
  68. SKILL_HORNATTACK,
  69. SKILL_HORNDRILL,
  70. SKILL_HYDROPUMP,
  71. SKILL_HYPERBEAM,
  72. SKILL_HYPNOSIS,
  73. SKILL_ICEBEAM,
  74. SKILL_KARATECHOP,
  75. SKILL_LEECHLIFE,
  76. SKILL_LEECHSEED,
  77. SKILL_LEER,
  78. SKILL_LIGHTSCREEN,
  79. SKILL_LOWKICK,
  80. SKILL_MEGADRAIN,
  81. SKILL_MEGAKICK,
  82. SKILL_MEGAPUNCH,
  83. SKILL_MIST,
  84. SKILL_NIGHTSHADE,
  85. SKILL_PAYDAY,
  86. SKILL_PECK,
  87. SKILL_PINMISSILE,
  88. SKILL_POISONGAS,
  89. SKILL_POISONPOWDER,
  90. SKILL_POISONSTING,
  91. SKILL_PSYBEAM,
  92. SKILL_PSYCHIC,
  93. SKILL_PSYWAVE,
  94. SKILL_QUICKATTACK,
  95. SKILL_RAGE,
  96. SKILL_RAZORLEAF,
  97. SKILL_RECOVER,
  98. SKILL_REFLECT,
  99. SKILL_REST,
  100. SKILL_ROAR,
  101. SKILL_ROCKSLIDE,
  102. SKILL_ROCKTRHOW,
  103. SKILL_SANDATTACK,
  104. SKILL_SCRATCH,
  105. SKILL_SCREECH,
  106. SKILL_SEISMICTOSS,
  107. SKILL_SELFDESTRUCT,
  108. SKILL_SING,
  109. SKILL_SKULLBASH,
  110. SKILL_SKYATTACK,
  111. SKILL_SLASH,
  112. SKILL_SLEEPPOWDER,
  113. SKILL_SMOG,
  114. SKILL_SMOKESCREEN,
  115. SKILL_SOLARBEAM,
  116. SKILL_SONICBOOM,
  117. SKILL_SPIKECANNON,
  118. SKILL_SPLASH,
  119. SKILL_SPORE,
  120. SKILL_STOMP,
  121. SKILL_STRENGTH,
  122. SKILL_STRINGSHOT,
  123. SKILL_STUNGSPORE,
  124. SKILL_SUBMISSION,
  125. SKILL_SUBSTITUTE,
  126. SKILL_SUPERSONIC,
  127. SKILL_SWIFT,
  128. SKILL_TACKLE,
  129. SKILL_TAILWHIP,
  130. SKILL_TAKE,
  131. SKILL_TELEPORT,
  132. SKILL_THRASH,
  133. SKILL_THUNDER,
  134. SKILL_THUNDERWAVE,
  135. SKILL_THUNDERBOLT,
  136. SKILL_THUNDERSHOCK,
  137. SKILL_TOXIC,
  138. SKILL_TRANSFORM,
  139. SKILL_TRIATTACK,
  140. SKILL_VICEGRIP,
  141. SKILL_VINEWHIP,
  142. SKILL_WATERFALL,
  143. SKILL_WHIRLWIND,
  144. SKILL_WITHDRAW,
  145. SKILL_WRAP,
  146. SKILL_AEROBLAST,
  147. SKILL_ANCIENTPOWER,
  148. SKILL_AROMATHERAPY,
  149. SKILL_AVALANCHE,
  150. SKILL_BLAZEKICK,
  151. SKILL_BOUNCE,
  152. SKILL_CALMMIND,
  153. SKILL_CRUNCH,
  154. SKILL_ERUPTION,
  155. SKILL_EXTREMESPEED,
  156. SKILL_FAINTATTACK,
  157. SKILL_FIREPUNCH,
  158. SKILL_FLASHCANNON,
  159. SKILL_FORESIGHT,
  160. SKILL_FUTURESIGHT,
  161. SKILL_GIGADRAIN,
  162. SKILL_GUARDSWAP,
  163. SKILL_HEALBELL,
  164. SKILL_ASSIST,
  165. SKILL_HIDDENPOWER,
  166. SKILL_BLIZZARD,
  167. SKILL_INSOMNIA,
  168. SKILL_IRONDEFENSE,
  169. SKILL_LEAFSTORM,
  170. SKILL_LELIVATE,
  171. SKILL_LOVELYKISS,
  172. SKILL_LUSTERPURGE,
  173. SKILL_MAGMAARMOR,
  174. SKILL_MINIMIZE,
  175. SKILL_MIRRORCOAT,
  176. SKILL_OCTOZOOKA,
  177. SKILL_OVERHEAT,
  178. SKILL_POISONFANG,
  179. SKILL_PRESENT,
  180. SKILL_PROTECT,
  181. SKILL_PSYCHOBOOST,
  182. SKILL_RAINDANCE,
  183. SKILL_RAZORWIND,
  184. SKILL_REVERSAL,
  185. SKILL_SACREDFIRE,
  186. SKILL_SANDSTORM,
  187. SKILL_SCARYFACE,
  188. SKILL_SHADOWBALL,
  189. SKILL_SHEERCOLD,
  190. SKILL_SHOCKWAVE,
  191. SKILL_SILENT,
  192. SKILL_SPARK,
  193. SKILL_SPIDERWEB,
  194. SKILL_SOFTBOILED,
  195. SKILL_STEELWING,
  196. SKILL_STONEEDGE,
  197. SKILL_SUNNYDAY,
  198. SKILL_SYNTHESIS,
  199. SKILL_TELEKNESIS,
  200. SKILL_THIEF,
  201. SKILL_THUNDERPUNCH,
  202. SKILL_TRIPLEKICK,
  203. SKILL_WATERPULSE,
  204. SKILL_ZAPCANNON,
  205. SKILL_BLOCK,
  206. SKILL_BUGBITE,
  207. SKILL_DRAGONRUSH,
  208. SKILL_ELECTRABALL,
  209. SKILL_ENDEAVOR,
  210. SKILL_FOCUSENERGY,
  211. SKILL_HEALORDER,
  212. SKILL_ICEBALL,
  213. SKILL_MAGICALLEAF,
  214. SKILL_MIMIC,
  215. SKILL_NIGHTSLASH,
  216. SKILL_SUCKERPUNCH,
  217. SKILL_SWAGGER,
  218. SKILL_SWEETKISS,
  219. SKILL_THUNDERFANG,
  220. SKILL_WATERSPORT,
  221. SKILL_WHIRLPOOL,
  222. SKILL_WINGATTACK,
  223. SKILL_MEDITATE,
  224. SKILL_EPICBOMB,
  225. SKILL_WEATHERBEAM,
  226. SKILL_ICYWIND,
  227. SKILL_HELPINGHAND,
  228. SKILL_SPITFIRE,
  229. SKILL_ICEPUNCH,
  230. SKILL_FLAMEWHEEL,
  231. SKILL_DARKPULSE,
  232. SKILL_MEMENTO,
  233. SKILL_VANISHER,
  234. SKILL_SHADOWSENSOR,
  235. SKILL_ELECTRICTHREADS,
  236. SKILL_HEALINGWAVE,
  237. SKILL_SHELLYCOAT,
  238. SKILL_OVERCOAT,
  239. SKILL_ORACLE,
  240. SKILL_POISONPOINT,
  241. SKILL_BLACKGODFLAMES,
  242. SKILL_LIMBER,
  243. SKILL_EVILROOT,
  244. SKILL_RAPIDRUN,
  245. SKILL_SERPENTEYES,
  246. SKILL_FIREMADNESS,
  247. SKILL_FIREPUNCHES,
  248. SKILL_HIDDENWEAPON,
  249. SKILL_HIDDENHOWL,
  250. SKILL_RUNAWAY,
  251. SKILL_FEROCIOUSHUNTER,
  252. SKILL_TRACKER,
  253. SKILL_PROTECTANT,
  254. SKILL_SAVIOR,
  255. SKILL_ASSASSIN,
  256. SKILL_ANGRYPECKER,
  257. SKILL_CALMSCENE,
  258. SKILL_MASSIVEEXPLOSION,
  259. SKILL_SPEEDYBOLT,
  260. SKILL_STEELER,
  261. SKILL_CRYSTALLIZE,
  262. SKILL_SANDFORCE,
  263. SKILL_SILENTSCREAMING,
  264. SKILL_FRAGRANCE,
  265. SKILL_IRONFIST,
  266. SKILL_STATUE,
  267. SKILL_CONCRETEMISSILE,
  268. SKILL_HELPER,
  269. SKILL_EARTHSHAKER,
  270. SKILL_POISONTOUCH,
  271. SKILL_INVISIBLETHREADS,
  272. SKILL_LEADSLICER,
  273. SKILL_DARKVENOM,
  274. SKILL_QUICKFEAT,
  275. SKILL_DIVERSION,
  276. SKILL_INFILTRATOR,
  277. SKILL_HEALINGLEAF,
  278. SKILL_RECKLESSNESS,
  279. SKILL_BLOCKER,
  280. SKILL_NIGHTVISION,
  281. SKILL_CLOSESIGHT,
  282. SKILL_HEAVYSLEEP,
  283. SKILL_ZENMODE,
  284. SKILL_SCREAMINGSTORM,
  285. SKILL_HIDDENROCK,
  286. SKILL_SHEDSKIN,
  287. SKILL_HOODLUM,
  288. SKILL_MIRRORTOUCH,
  289. SKILL_BODYEATER,
  290. SKILL_SOLIDROCK,
  291. SKILL_TRIBEAM,
  292. SKILL_TRASHGAS,
  293. SKILL_TOXICSPRAY,
  294. SKILL_EXTRAAMMO,
  295. SKILL_REVERSEDAMGE,
  296. SKILL_AMPLIFIER,
  297. SKILL_DARKMOON,
  298. SKILL_MAGICGUARD,
  299. SKILL_WATERPUMPER,
  300. SKILL_HYDRATION,
  301. SKILL_ICEBODY,
  302. SKILL_ICYWINDS,
  303. SKILL_SNOWSTORM,
  304. SKILL_SERENEGRACE,
  305. SKILL_IMITATION,
  306. SKILL_HOSTAGETAKER,
  307. SKILL_CURSEDBODY,
  308. SKILL_ELECTROWEB,
  309. SKILL_THORNYBARRIER,
  310. SKILL_PROJUMPER,
  311. SKILL_CLEARBODY,
  312. SKILL_DISKTHROWER,
  313. SKILL_DISKEXPLOSIVE,
  314. SKILL_UNKNOWNWORLD,
  315. SKILL_BRAINATTACKER,
  316. SKILL_FLAMELIGHTER,
  317. SKILL_SOULTAKER,
  318. SKILL_ADAMANTDRAGON,
  319. SKILL_ICECHILL,
  320. SKILL_ICECHAINS,
  321. SKILL_SHELLARMOR,
  322. SKILL_STEALTH,
  323. SKILL_EARTHLYLIGHTINING,
  324. SKILL_INNERFOCUS,
  325. SKILL_WHIPSLASH,
  326. SKILL_DRAGONLIGHT,
  327. SKILL_REGENERATION,
  328. SKILL_BLADEDHANDS,
  329. SKILL_PRESSURE,
  330. SKILL_HEADCHARGE,
  331. SKILL_HUSTLE,
  332. SKILL_ARMORRESPAWN,
  333. SKILL_WINDDRAGONROAR,
  334. SKILL_WHITESMOKE,
  335. SKILL_TRIPLETEAM,
  336. SKILL_EVILINTENT,
  337. SKILL_BLAZINGTOUCH,
  338. SKILL_DEADLYHORN,
  339. SKILL_SEAOFFLAMES,
  340. SKILL_MINDCONTROL,
  341. SKILL_DEADLYDREAM,
  342. SKILL_WATERSPRAYER,
  343. SKILL_GEYSERNEST,
  344. SKILL_SHININGLIGHT,
  345. SKILL_EMOTIONALPAIN,
  346. SKILL_FLIGHT,
  347. SKILL_ROCKYSKY,
  348. SKILL_HIGHDEFENSE,
  349. SKILL_METALBURST,
  350. SKILL_DECIEVING,
  351. SKILL_FALLENLIFE,
  352. SKILL_NIGHTDAZE,
  353. SKILL_PHANTONDAZE,
  354. SKILL_WATERGOD,
  355. SKILL_RELICSONG,
  356. SKILL_TECHNODRIVE,
  357. SKILL_DEVINEJUDGMENT,
  358. SKILL_DEVINEICE,
  359. SKILL_BLACKDEATH,
  360. SKILL_SHADOWSTALKER,
  361. SKILL_LIGHTNINGFURY,
  362. SKILL_VOLCANOGEYSER,
  363. SKILL_FLYINGJUDGMENT,
  364. SKILL_ACIDRAIN,
  365. SKILL_ANCIENT,
  366. SKILL_FIREEXPLOSION,
  367. SKILL_CALMINGWAVES
  368. };
  369.  
  370. ///////////////////////////////////////
  371. // When someone presses +pokeskill //
  372. ///////////////////////////////////////
  373. public pokeskill_down(id)
  374. {
  375. g_StopSkill[id] = false;
  376. if( !PMon() ){
  377. poke_printlang(id,"POKEMOD_DISABLED")
  378. return PLUGIN_HANDLED
  379. }
  380. else if( PM_disabled == PM_XP ){
  381. poke_printlang(id,"POKEMOD_SKILLSDISABLED")
  382. return PLUGIN_HANDLED
  383. }
  384. else if( !ValidPoke( PlayersPoke[id][0] ) ){
  385. StartMenu(id)
  386. return PLUGIN_HANDLED
  387. }
  388.  
  389. if( g_isItemed[id] ){
  390. SetActionMenu( id, AC_GO );
  391. return PLUGIN_HANDLED;
  392. }
  393.  
  394. if( !Pokemod_Alive(id) ){
  395. new parm[2];
  396. parm[0] = id;
  397. parm[1] = 0;
  398. set_task(0.1, "PokeMenu", 0, parm, 2);
  399. return PLUGIN_HANDLED;
  400. }
  401.  
  402. new skill_num, command[32];
  403. read_argv(0,command,31);
  404. replace(command, 31, "+pokeskill", EMPTY);
  405. skill_num = str_to_num(command);
  406.  
  407. new poke_skills[MAX_SKILLS], skill_count, i;
  408. for( i = 0; i < MAX_SKILLS; i++ )
  409. poke_skills[i] = -1;
  410.  
  411. new pid = Pokemon[id], tempskill, tempcheck, bool:skill_found;
  412. for( i = -1; i<MAX_ACTIVE_POKES; i++ ){
  413. if( i != -1 ){
  414. pid = PlayersPoke[id][i];
  415.  
  416. //if weve already added the skill in, we don't need to add it again
  417. if( i == PlayersActive[id] )
  418. continue;
  419. }
  420. while( pid && skill_count < MAX_SKILLS ){
  421. if( !PokeDisabled(pid) && (tempskill = PokeSkill[pid]) != -1 ){
  422. if( (i==-1 || PokeInfo[pid] & PI_GLOBAL) && SkillInfo[tempskill] & SI_BIND ){
  423. skill_found = false;
  424. for( tempcheck=0; tempcheck < skill_count; tempcheck++ )
  425. if( poke_skills[tempcheck] == tempskill )
  426. skill_found = true;
  427. if( !skill_found ){
  428. poke_skills[skill_count] = tempskill;
  429. skill_count++;
  430. }
  431. }
  432. }
  433.  
  434. pid = AnyEvolveTo(pid);
  435. }
  436. }
  437.  
  438. if( skill_count > 1 && !skill_num ){
  439. if( !ValidSkill( ActiveSkill(id) ) ){
  440. SkillMenu(id);
  441. return PLUGIN_HANDLED;
  442. }
  443. else
  444. tempskill = ActiveSkill(id);
  445. }
  446. else if( skill_num )
  447. SetActiveSkill(id, (tempskill = poke_skills[skill_num-1]) );
  448. else
  449. SetActiveSkill(id, (tempskill = poke_skills[0]) );
  450.  
  451. //couldnt find any skill to use, lets just use their first skill
  452. if( !ValidSkill(tempskill) && !PokeDisabled( Pokemon[id] ) )
  453. SetActiveSkill(id, (tempskill = PokeSkill[Pokemon[id]]) );
  454.  
  455. //stop, they dont have a valid skill
  456. if( !ValidSkill(tempskill) ){
  457. poke_printlang(id,"POKEMOD_NOSKILL" );
  458. return PLUGIN_HANDLED;
  459. }
  460. //stop, they dont have a bind skill
  461. if( !(SkillInfo[tempskill] & SI_BIND) ){
  462. set_hudmessage(0, 255, 0, 0.6, 0.8, 0, 6.0, 1.1, 0.0, 0.0, -1)
  463. show_hudmessage(id, "%s cannot be manually activated.", SkillToName(tempskill))
  464. return PLUGIN_HANDLED;
  465. }
  466. //stop, we arent allowing the skill to be used
  467. if( DisAllowSkill( id, tempskill, true ) )
  468. return PLUGIN_HANDLED;
  469.  
  470. //check spam time. stop if they are spamming
  471. new Float:current_time = get_gametime();
  472. if(current_time-g_lastSkill[id] < SKILL_SPAM){
  473. set_hudmessage(0, 255, 0, 0.6, 0.8, 0, 6.0, 1.1, 0.0, 0.0, -1)
  474. show_hudmessage(id, "Stop trying to spam PokeMod skills.")
  475. return PLUGIN_HANDLED;
  476. }
  477. g_lastSkill[id] = current_time;
  478.  
  479. //send into skill handler
  480. bind_skill_handler(id+POKESKILL_TASK);
  481.  
  482. debugMessage(id,6,"Player", "keyed down with %s", SkillToName( ActiveSkill(id) ) );
  483.  
  484. return PLUGIN_HANDLED;
  485. }
  486.  
  487. ////////////////////////////////////////
  488. // When someone releases +pokeskill //
  489. ////////////////////////////////////////
  490. public pokeskill_up(id)
  491. {
  492. debugMessage(id,6,"Player", "keyed up with %s", SkillToName( ActiveSkill(id) ) );
  493.  
  494. skills_handler(id, SI_RELEASE);
  495.  
  496. if( ValidSkill( ActiveSkill(id) ) ){
  497. if( Action[id] == AC_SKILL )
  498. SkillMenu(id);
  499. }
  500.  
  501. g_StopSkill[id] = true;
  502.  
  503. #if SKILL_UNSPAM == 1
  504. g_lastSkill[id] = 0.0;
  505. #endif
  506.  
  507. return PLUGIN_HANDLED;
  508. }
  509.  
  510. public bind_skill_handler(id)
  511. {
  512. id -= POKESKILL_TASK;
  513.  
  514. if( ValidPlayer( id ) ){
  515. if( !Pokemod_Alive(id) || DisAllowSkill( id, ActiveSkill(id), true ) || g_StopSkill[id] ){
  516. g_StopSkill[id] = false;
  517. }
  518. else if( ValidSkill( ActiveSkill(id) ) ){
  519. CallSkill(id, ActiveSkill(id), SI_BIND);
  520. set_task(0.1,"bind_skill_handler", POKESKILL_TASK+id)
  521. }
  522. }
  523. }
  524. skills_handler(id, call_prop)
  525. {
  526. if( PlayerEventForward > -1 )
  527. {
  528. new functionReturn
  529. ExecuteForward(PlayerEventForward, functionReturn, id, call_prop)
  530. if( functionReturn==PLUGIN_HANDLED )
  531. return;
  532. }
  533.  
  534. new skill, subpoke, bool:auto_globals=false;
  535.  
  536. if( call_prop & SI_RESET || call_prop & SI_ROUNDRESET || call_prop & SI_CONNECT || call_prop & SI_DISCONNECT )
  537. auto_globals = true;
  538.  
  539. if( !PokeDisabled( Pokemon[id] ) ){
  540. skill = PokeSkill[Pokemon[id]];
  541. if( !DisAllowSkill(id, skill) && SkillInfo[ skill ] & call_prop )
  542. CallSkill(id, skill, call_prop)
  543. }
  544.  
  545. //if their active poke is evolved, deal with the skills it had
  546. subpoke = AnyEvolveTo(Pokemon[id])
  547. while(subpoke && subpoke!=Pokemon[id]){
  548. if( !PokeDisabled( subpoke ) ){
  549. skill = PokeSkill[subpoke];
  550. if( !DisAllowSkill(id, skill) && SkillInfo[skill] & call_prop )
  551. CallSkill(id, skill, call_prop)
  552. }
  553. subpoke = AnyEvolveTo(subpoke)
  554. }
  555.  
  556. //now on to the global pokes
  557. new m, pid_global;
  558. for(m=0; m<MAX_ACTIVE_POKES; m++){
  559.  
  560. pid_global = PlayersPoke[id][m]
  561. if( Pokemon[id] == pid_global )
  562. continue;
  563.  
  564. if( (auto_globals || PokeInfo[pid_global] & PI_GLOBAL) && !PokeDisabled(pid_global) ){
  565. skill = PokeSkill[pid_global];
  566. if( !DisAllowSkill(id, skill) && SkillInfo[skill] & call_prop )
  567. CallSkill(id, skill, call_prop)
  568. }
  569.  
  570. //sub globals now
  571. subpoke = AnyEvolveTo(pid_global)
  572. while(subpoke && subpoke!=pid_global){
  573. if( (auto_globals || PokeInfo[subpoke] & PI_GLOBAL) && !PokeDisabled(subpoke) ){
  574. skill = PokeSkill[subpoke];
  575. if( !DisAllowSkill(id, skill) && SkillInfo[skill] & call_prop )
  576. CallSkill(id, skill, call_prop)
  577. }
  578. subpoke = AnyEvolveTo(subpoke)
  579. }
  580. }
  581. }
  582. bool:PokeDisabled( pokemon )
  583. {
  584. if( PokeInfo[pokemon]&PI_DISABLE || SafariLevel(pokemon)==-1000 )
  585. return true;
  586. return false;
  587. }
  588. bool:DisAllowSkill(id, skill, bool:bind=false)
  589. {
  590. if( !ValidSkill( skill ) || !Pokemod_Connected(id) )
  591. return true;
  592. if( PM_disabled == PM_XP ){
  593. if(bind) poke_printlang(id,"POKEMOD_SKILLSDISABLED");
  594. return true;
  595. }
  596.  
  597. else if( SkillInfo[skill] & SI_DISABLE ){
  598. if(bind) poke_printlang(id,"POKEMOD_SKILLDIS");
  599. return true;
  600. }
  601. else if( SkillInfo[skill] & SI_CALL )
  602. return false;
  603. else if( !(SkillInfo[skill] & SI_IGNORE) && BindTime(id) ){
  604. if(bind) sound_deny(id);
  605. return true;
  606. }
  607. else if( g_Status[id][STATUS_ASLEEP] ){
  608. if(bind) poke_printlang(id,"POKEMOD_SKILLASLEEP");
  609. return true;
  610. }
  611. else if( !(SkillInfo[skill] & SI_DEAD) && !Pokemod_Alive(id) ){
  612. if(bind) poke_printlang(id,"POKEMOD_SKILLDEAD");
  613. return true;
  614. }
  615. else if( SkillInfo[skill] & SI_ADMIN && !is_user_admin(id) ){
  616. if(bind) poke_printlang(id,"POKEMOD_SKILLADMIN");
  617. return true;
  618. }
  619. else if( FreezeTime ){
  620. if(bind) poke_printlang(id,"POKEMOD_SKILLFREEZE");
  621. return true;
  622. }
  623. #if MOD==CS
  624. else if( cs_get_user_vip(id) ){
  625. if(bind) poke_printlang(id,"POKEMOD_SKILLVIP");
  626. return true;
  627. }
  628. #endif
  629. #if MOD==NS
  630. else if( ns_get_class(id) == CLASS_COMMANDER ){
  631. if(bind) poke_printlang(id,"POKEMOD_SKILLCOM");
  632. return true;
  633. }
  634. #endif
  635. return false;
  636. }
  637.  
  638. stock RemoveDelayCallSkill(id, skill)
  639. remove_task( SKILLCALL_TASK + (skill * MAX_PLAYERS) + id );
  640.  
  641. stock DelayedCallSkill(Float:time, id, skill, prop)
  642. {
  643. new parm[ 3 ];
  644. parm[ 0 ] = id;
  645. parm[ 1 ] = skill;
  646. parm[ 2 ] = prop;
  647. set_task(time, "task_CallSkill", SKILLCALL_TASK + (skill* MAX_PLAYERS) + id, parm, 3);
  648. }
  649. public task_CallSkill( parm[3] )
  650. CallSkill( parm[0], parm[1], parm[2] );
  651.  
  652. CallSkill(id, skill, prop)
  653. {
  654. if( ValidPlayer(id) && ValidSkill(skill) )
  655. {
  656. debugMessage(id,7,"Player", "calling skill %s", SkillToName( skill ) );
  657.  
  658. new SKILL:call;
  659.  
  660. switch( skill )
  661. {
  662. case SKILL_ABSORB: call = Absorb( id, skill, prop );
  663. case SKILL_ACID: call = Acid ( id, skill, prop );
  664. case SKILL_ACIDARMOR: call = Acid_Armor( id, skill, prop );
  665. case SKILL_AGILITY: call = Agility( id, skill, prop );
  666. case SKILL_AMNESIA: call = Amnesia( id, skill, prop );
  667. case SKILL_AURORABEAM: call = Aurora_Beam( id, skill, prop );
  668. case SKILL_BARRAGE: call = Barrage( id, skill, prop );
  669. case SKILL_BIDE: call = Bide( id, skill, prop );
  670. case SKILL_BITE: call = Bite( id, skill, prop );
  671. case SKILL_POWDEREDSNOW: call = Powdered_Snow( id, skill, prop );
  672. case SKILL_BODYSLAM: call = Body_Slam( id, skill, prop );
  673. case SKILL_BONECLUB: call = Bone_Club( id, skill, prop );
  674. case SKILL_BONEMERANG: call = Bonemerang( id, skill, prop );
  675. case SKILL_BUBBLEBEAM: call = Bubble_Beam( id, skill, prop );
  676. case SKILL_CONFUSERAY: call = Confuse_Ray( id, skill, prop );
  677. case SKILL_CONFUSION: call = Confusion( id, skill, prop );
  678. case SKILL_CONSTRICT: call = Constrict( id, skill, prop );
  679. case SKILL_CONVERSION: call = Conversion( id, skill, prop );
  680. case SKILL_COUNTER: call = Counter( id, skill, prop );
  681. case SKILL_DEFENSECURL: call = Defense_Curl( id, skill, prop );
  682. case SKILL_DIG: call = Dig( id, skill, prop );
  683. case SKILL_DISABLE: call = Disable( id, skill, prop );
  684. case SKILL_DIZZYPUNCH: call = Dizzy_Punch( id, skill, prop );
  685. case SKILL_DOUBLEEDGE: call = Double_Edge( id, skill, prop );
  686. case SKILL_DOUBLEKICK: call = Double_Kick( id, skill, prop );
  687. case SKILL_DOUBLESLAP: call = Double_Slap( id, skill, prop );
  688. case SKILL_DOUBLETEAM: call = Double_Team( id, skill, prop );
  689. case SKILL_DRAGONRAGE: call = Dragon_Rage( id, skill, prop );
  690. case SKILL_DREAMEATER: call = Dream_Eater( id, skill, prop );
  691. case SKILL_DRILLPECK: call = Drill_Peck( id, skill, prop );
  692. case SKILL_EARTHQUAKE: call = Earthquake( id, skill, prop );
  693. case SKILL_EGGBOMB: call = Egg_Bomb( id, skill, prop );
  694. case SKILL_EMBER: call = Ember( id, skill, prop );
  695. case SKILL_EXPLOSION: call = Explosion( id, skill, prop );
  696. case SKILL_FIREBLAST: call = Fire_Blast( id, skill, prop );
  697. case SKILL_FIRESPIN: call = Fire_Spin( id, skill, prop );
  698. case SKILL_FISSURE: call = Fissure( id, skill, prop );
  699. case SKILL_FLAMETHROWER: call = Flamethrower( id, skill, prop );
  700. case SKILL_FLASH: call = Flash( id, skill, prop );
  701. case SKILL_FLY: call = Fly( id, skill, prop );
  702. case SKILL_GLARE: call = Glare( id, skill, prop );
  703. case SKILL_GROWTH: call = Growth( id, skill, prop );
  704. case SKILL_GUILLOTINE: call = Guillotine( id, skill, prop );
  705. case SKILL_GUST: call = Gust( id, skill, prop );
  706. case SKILL_HARDER: call = Harden( id, skill, prop );
  707. case SKILL_HAZE: call = Haze( id, skill, prop );
  708. case SKILL_HORNATTACK: call = Horn_Attack( id, skill, prop );
  709. case SKILL_HORNDRILL: call = Horn_Drill( id, skill, prop );
  710. case SKILL_HYDROPUMP: call = Hydro_Pump( id, skill, prop );
  711. case SKILL_HYPERBEAM: call = Hyper_Beam( id, skill, prop );
  712. case SKILL_HYPNOSIS: call = Hypnosis( id, skill, prop );
  713. case SKILL_ICEBEAM: call = Ice_Beam( id, skill, prop );
  714. case SKILL_KARATECHOP: call = Karate_Chop( id, skill, prop );
  715. case SKILL_LEECHLIFE: call = Leech_Life( id, skill, prop );
  716. case SKILL_LEECHSEED: call = Leech_Seed( id, skill, prop );
  717. case SKILL_LEER: call = Leer( id, skill, prop );
  718. case SKILL_LIGHTSCREEN: call = Light_Screen( id, skill, prop );
  719. case SKILL_LOWKICK: call = Low_Kick( id, skill, prop );
  720. case SKILL_MEGADRAIN: call = Mega_Drain( id, skill, prop );
  721. case SKILL_MEGAKICK: call = Mega_Kick( id, skill, prop );
  722. case SKILL_MEGAPUNCH: call = Mega_Punch( id, skill, prop );
  723. case SKILL_MIST: call = Mist( id, skill, prop );
  724. case SKILL_NIGHTSHADE: call = Night_Shade( id, skill, prop );
  725. case SKILL_PAYDAY: call = Pay_Day( id, skill, prop );
  726. case SKILL_PECK: call = Peck( id, skill, prop );
  727. case SKILL_PINMISSILE: call = Pin_Missile( id, skill, prop );
  728. case SKILL_POISONGAS: call = Poison_Gas( id, skill, prop );
  729. case SKILL_POISONPOWDER: call = Poison_Powder( id, skill, prop );
  730. case SKILL_POISONSTING: call = Poison_Sting( id, skill, prop );
  731. case SKILL_PSYBEAM: call = Psybeam( id, skill, prop );
  732. case SKILL_PSYCHIC: call = Psychic( id, skill, prop );
  733. case SKILL_PSYWAVE: call = Psywave( id, skill, prop );
  734. case SKILL_QUICKATTACK: call = Quick_Attack( id, skill, prop );
  735. case SKILL_RAGE: call = Rage( id, skill, prop );
  736. case SKILL_RAZORLEAF: call = Razor_Leaf( id, skill, prop );
  737. case SKILL_RECOVER: call = Recover( id, skill, prop );
  738. case SKILL_REFLECT: call = Reflect( id, skill, prop );
  739. case SKILL_REST: call = Rest( id, skill, prop );
  740. case SKILL_ROAR: call = Roar( id, skill, prop );
  741. case SKILL_ROCKSLIDE: call = Rock_Slide( id, skill, prop );
  742. case SKILL_ROCKTRHOW: call = Rock_Throw( id, skill, prop );
  743. case SKILL_SANDATTACK: call = Sand_Attack( id, skill, prop );
  744. case SKILL_SCRATCH: call = Scratch( id, skill, prop );
  745. case SKILL_SCREECH: call = Screech( id, skill, prop );
  746. case SKILL_SEISMICTOSS: call = Seismic_Toss( id, skill, prop );
  747. case SKILL_SELFDESTRUCT: call = Self_Destruct( id, skill, prop );
  748. case SKILL_SING: call = Sing( id, skill, prop );
  749. case SKILL_SKULLBASH: call = Skullbash( id, skill, prop );
  750. case SKILL_SKYATTACK: call = Sky_Attack( id, skill, prop );
  751. case SKILL_SLASH: call = Slash( id, skill, prop );
  752. case SKILL_SLEEPPOWDER: call = Sleep_Powder( id, skill, prop );
  753. case SKILL_SMOG: call = Smog( id, skill, prop );
  754. case SKILL_SMOKESCREEN: call = Smokescreen( id, skill, prop );
  755. case SKILL_SOLARBEAM: call = Solar_Beam( id, skill, prop );
  756. case SKILL_SONICBOOM: call = Sonic_Boom( id, skill, prop );
  757. case SKILL_SPIKECANNON: call = Spike_Cannon( id, skill, prop );
  758. case SKILL_SPLASH: call = Splash( id, skill, prop );
  759. case SKILL_SPORE: call = Spore( id, skill, prop );
  760. case SKILL_STOMP: call = Stomp( id, skill, prop );
  761. case SKILL_STRENGTH: call = Strength( id, skill, prop );
  762. case SKILL_STRINGSHOT: call = String_Shot( id, skill, prop );
  763. case SKILL_STUNGSPORE: call = Stun_Spore( id, skill, prop );
  764. case SKILL_SUBMISSION: call = Submission( id, skill, prop );
  765. case SKILL_SUBSTITUTE: call = Substitute( id, skill, prop );
  766. case SKILL_SUPERSONIC: call = Supersonic( id, skill, prop );
  767. case SKILL_SWIFT: call = Swift( id, skill, prop );
  768. case SKILL_TACKLE: call = Tackle( id, skill, prop );
  769. case SKILL_TAILWHIP: call = Tail_Whip( id, skill, prop );
  770. case SKILL_TAKE: call = Take_Down( id, skill, prop );
  771. case SKILL_TELEPORT: call = Teleport( id, skill, prop );
  772. case SKILL_THRASH: call = Thrash( id, skill, prop );
  773. case SKILL_THUNDER: call = Thunder( id, skill, prop );
  774. case SKILL_THUNDERWAVE: call = Thunder_Wave( id, skill, prop );
  775. case SKILL_THUNDERBOLT: call = Thunderbolt( id, skill, prop );
  776. case SKILL_THUNDERSHOCK: call = Thundershock( id, skill, prop );
  777. case SKILL_TOXIC: call = Toxic( id, skill, prop );
  778. case SKILL_TRANSFORM: call = Transform( id, skill, prop );
  779. case SKILL_TRIATTACK: call = Tri_Attack( id, skill, prop );
  780. case SKILL_VICEGRIP: call = Vice_Grip( id, skill, prop );
  781. case SKILL_VINEWHIP: call = Vine_Whip( id, skill, prop );
  782. case SKILL_WATERFALL: call = Waterfall( id, skill, prop );
  783. case SKILL_WHIRLWIND: call = Whirlwind( id, skill, prop );
  784. case SKILL_WITHDRAW: call = Withdraw( id, skill, prop );
  785. case SKILL_WRAP: call = Wrap( id, skill, prop );
  786. case SKILL_AEROBLAST: call = Aeroblast( id, skill, prop );
  787. case SKILL_ANCIENTPOWER: call = Ancient_Power( id, skill, prop );
  788. case SKILL_AROMATHERAPY: call = Aromatherapy( id, skill, prop );
  789. case SKILL_AVALANCHE: call = Avalanche( id, skill, prop );
  790. case SKILL_BLAZEKICK: call = Blaze_Kick( id, skill, prop );
  791. case SKILL_BOUNCE: call = Bounce( id, skill, prop );
  792. case SKILL_CALMMIND: call = Calm_Mind( id, skill, prop );
  793. case SKILL_CRUNCH: call = Crunch( id, skill, prop );
  794. case SKILL_ERUPTION: call = Eruption( id, skill, prop );
  795. case SKILL_EXTREMESPEED: call = Extreme_Speed( id, skill, prop );
  796. case SKILL_FAINTATTACK: call = Faint_Attack( id, skill, prop );
  797. case SKILL_FIREPUNCH: call = Fire_Punch( id, skill, prop );
  798. case SKILL_FLASHCANNON: call = Flash_Cannon( id, skill, prop );
  799. case SKILL_FORESIGHT: call = Foresight( id, skill, prop );
  800. case SKILL_FUTURESIGHT: call = Future_Sight( id, skill, prop );
  801. case SKILL_GIGADRAIN: call = Giga_Drain( id, skill, prop );
  802. case SKILL_GUARDSWAP: call = Guard_Swap( id, skill, prop );
  803. case SKILL_HEALBELL: call = Heal_Bell( id, skill, prop );
  804. case SKILL_ASSIST: call = Assist( id, skill, prop );
  805. case SKILL_HIDDENPOWER: call = Hidden_Power( id, skill, prop );
  806. case SKILL_BLIZZARD: call = Blizzard( id, skill, prop );
  807. case SKILL_INSOMNIA: call = Insomnia( id, skill, prop );
  808. case SKILL_IRONDEFENSE: call = Iron_Defense( id, skill, prop );
  809. case SKILL_LEAFSTORM: call = Leaf_Storm( id, skill, prop );
  810. case SKILL_LELIVATE: call = Levitate( id, skill, prop );
  811. case SKILL_LOVELYKISS: call = Lovely_Kiss( id, skill, prop );
  812. case SKILL_LUSTERPURGE: call = Luster_Purge( id, skill, prop );
  813. case SKILL_MAGMAARMOR: call = Magma_Armor( id, skill, prop );
  814. case SKILL_MINIMIZE: call = Minimize( id, skill, prop );
  815. case SKILL_MIRRORCOAT: call = Mirror_Coat( id, skill, prop );
  816. case SKILL_OCTOZOOKA: call = Octozooka( id, skill, prop );
  817. case SKILL_OVERHEAT: call = Overheat( id, skill, prop );
  818. case SKILL_POISONFANG: call = Poison_Fang( id, skill, prop );
  819. case SKILL_PRESENT: call = Present( id, skill, prop );
  820. case SKILL_PROTECT: call = Protect( id, skill, prop );
  821. case SKILL_PSYCHOBOOST: call = Psycho_Boost( id, skill, prop );
  822. case SKILL_RAINDANCE: call = Rain_Dance( id, skill, prop );
  823. case SKILL_RAZORWIND: call = Razor_Wind( id, skill, prop );
  824. case SKILL_REVERSAL: call = Reversal( id, skill, prop );
  825. case SKILL_SACREDFIRE: call = Sacred_Fire( id, skill, prop );
  826. case SKILL_SANDSTORM: call = Sandstorm( id, skill, prop );
  827. case SKILL_SCARYFACE: call = Scary_Face( id, skill, prop );
  828. case SKILL_SHADOWBALL: call = Shadow_Ball( id, skill, prop );
  829. case SKILL_SHEERCOLD: call = Sheer_Cold( id, skill, prop );
  830. case SKILL_SHOCKWAVE: call = Shock_Wave( id, skill, prop );
  831. case SKILL_SILENT: call = Silent( id, skill, prop );
  832. case SKILL_SPARK: call = Spark( id, skill, prop );
  833. case SKILL_SPIDERWEB: call = Spider_Web( id, skill, prop );
  834. case SKILL_SOFTBOILED: call = Softboiled( id, skill, prop );
  835. case SKILL_STEELWING: call = Steel_Wing( id, skill, prop );
  836. case SKILL_STONEEDGE: call = Stone_Edge( id, skill, prop );
  837. case SKILL_SUNNYDAY: call = Sunny_Day( id, skill, prop );
  838. case SKILL_SYNTHESIS: call = Synthesis( id, skill, prop );
  839. case SKILL_TELEKNESIS: call = Telekenesis( id, skill, prop );
  840. case SKILL_THIEF: call = Thief( id, skill, prop );
  841. case SKILL_THUNDERPUNCH: call = Thunder_Punch( id, skill, prop );
  842. case SKILL_TRIPLEKICK: call = Triple_Kick( id, skill, prop );
  843. case SKILL_WATERPULSE: call = Water_Pulse( id, skill, prop );
  844. case SKILL_ZAPCANNON: call = Zap_Cannon( id, skill, prop );
  845. case SKILL_BLOCK: call = Block( id, skill, prop );
  846. case SKILL_BUGBITE: call = Bug_Bite( id, skill, prop );
  847. case SKILL_DRAGONRUSH: call = Dragon_Rush( id, skill, prop );
  848. case SKILL_ELECTRABALL: call = Electra_Ball( id, skill, prop );
  849. case SKILL_ENDEAVOR: call = Endeavor( id, skill, prop );
  850. case SKILL_FOCUSENERGY: call = Focus_Energy( id, skill, prop );
  851. case SKILL_HEALORDER: call = Heal_Order( id, skill, prop );
  852. case SKILL_ICEBALL: call = Ice_Ball( id, skill, prop );
  853. case SKILL_MAGICALLEAF: call = Magical_Leaf( id, skill, prop );
  854. case SKILL_MIMIC: call = Mimic( id, skill, prop );
  855. case SKILL_NIGHTSLASH: call = Night_Slash( id, skill, prop );
  856. case SKILL_SUCKERPUNCH: call = Sucker_Punch( id, skill, prop );
  857. case SKILL_SWAGGER: call = Swagger( id, skill, prop );
  858. case SKILL_SWEETKISS: call = Sweet_Kiss( id, skill, prop );
  859. case SKILL_THUNDERFANG: call = Thunder_Fang( id, skill, prop );
  860. case SKILL_WATERSPORT: call = Water_Sport( id, skill, prop );
  861. case SKILL_WHIRLPOOL: call = Whirl_Pool( id, skill, prop );
  862. case SKILL_WINGATTACK: call = Wing_Attack( id, skill, prop );
  863. case SKILL_MEDITATE: call = Meditate( id, skill, prop );
  864. case SKILL_EPICBOMB: call = Epic_Bomb( id, skill, prop );
  865. case SKILL_WEATHERBEAM: call = Weather_Beam( id, skill, prop );
  866. case SKILL_ICYWIND: call = Icy_Wind( id, skill, prop );
  867. case SKILL_HELPINGHAND: call = Helping_Hand( id, skill, prop );
  868. case SKILL_SPITFIRE: call = Spit_Fire( id, skill, prop );
  869. case SKILL_ICEPUNCH: call = Ice_Punch( id, skill, prop );
  870. case SKILL_FLAMEWHEEL: call = Flame_Wheel( id, skill, prop );
  871. case SKILL_DARKPULSE: call = Dark_Pulse( id, skill, prop );
  872. case SKILL_MEMENTO: call = Memento( id, skill, prop );
  873. case SKILL_VANISHER: call = Vanisher( id, skill, prop );
  874. case SKILL_SHADOWSENSOR: call = Shadow_Sensor( id, skill, prop );
  875. case SKILL_ELECTRICTHREADS: call = Electric_Threads( id, skill, prop );
  876. case SKILL_HEALINGWAVE: call = Healing_Wave( id, skill, prop );
  877. case SKILL_SHELLYCOAT: call = Shelly_Coat( id, skill, prop );
  878. case SKILL_OVERCOAT: call = Overcoat( id, skill, prop );
  879. case SKILL_ORACLE: call = Oracle( id, skill, prop );
  880. case SKILL_POISONPOINT: call = Poison_Point( id, skill, prop );
  881. case SKILL_BLACKGODFLAMES: call = Black_God_Flames( id, skill, prop );
  882. case SKILL_LIMBER: call = Limber( id, skill, prop );
  883. case SKILL_EVILROOT: call = Evil_Root( id, skill, prop );
  884. case SKILL_RAPIDRUN: call = Rapid_Run( id, skill, prop );
  885. case SKILL_SERPENTEYES: call = Serpent_Eyes( id, skill, prop );
  886. case SKILL_FIREMADNESS: call = Fire_Madness( id, skill, prop );
  887. case SKILL_FIREPUNCHES: call = Fire_Punches( id, skill, prop );
  888. case SKILL_HIDDENWEAPON: call = Hidden_Weapon( id, skill, prop );
  889. case SKILL_HIDDENHOWL: call = Hidden_Howl( id, skill, prop );
  890. case SKILL_RUNAWAY: call = Runaway( id, skill, prop );
  891. case SKILL_FEROCIOUSHUNTER: call = Ferocious_Hunter( id, skill, prop );
  892. case SKILL_TRACKER: call = Tracker( id, skill, prop );
  893. case SKILL_PROTECTANT: call = Protectant( id, skill, prop );
  894. case SKILL_SAVIOR: call = Savior( id, skill, prop );
  895. case SKILL_ASSASSIN: call = Assassin( id, skill, prop );
  896. case SKILL_ANGRYPECKER: call = Angry_Pecker( id, skill, prop );
  897. case SKILL_CALMSCENE: call = Calm_Scene( id, skill, prop );
  898. case SKILL_MASSIVEEXPLOSION: call = Massive_Explosion( id, skill, prop );
  899. case SKILL_SPEEDYBOLT: call = Speedy_Bolts( id, skill, prop );
  900. case SKILL_STEELER: call = Steeler( id, skill, prop );
  901. case SKILL_CRYSTALLIZE: call = Crystallize( id, skill, prop );
  902. case SKILL_SANDFORCE: call = Sand_Force( id, skill, prop );
  903. case SKILL_SILENTSCREAMING: call = Silent_Screaming( id, skill, prop );
  904. case SKILL_FRAGRANCE: call = Fragrance( id, skill, prop );
  905. case SKILL_IRONFIST: call = Iron_Fist( id, skill, prop );
  906. case SKILL_STATUE: call = Statue( id, skill, prop );
  907. case SKILL_CONCRETEMISSILE: call = Concrete_Missile( id, skill, prop );
  908. case SKILL_HELPER: call = Helper( id, skill, prop );
  909. case SKILL_EARTHSHAKER: call = Earth_Shaker( id, skill, prop );
  910. case SKILL_POISONTOUCH: call = Poison_Touch( id, skill, prop );
  911. case SKILL_INVISIBLETHREADS: call = Invisible_Threads( id, skill, prop );
  912. case SKILL_LEADSLICER: call = Leaf_Slicer( id, skill, prop );
  913. case SKILL_DARKVENOM: call = Dark_Venom( id, skill, prop );
  914. case SKILL_QUICKFEAT: call = Quick_Feat( id, skill, prop );
  915. case SKILL_DIVERSION: call = Diversion( id, skill, prop );
  916. case SKILL_INFILTRATOR: call = Infiltrator( id, skill, prop );
  917. case SKILL_HEALINGLEAF: call = Healing_Leaf( id, skill, prop );
  918. case SKILL_RECKLESSNESS: call = Recklessness( id, skill, prop );
  919. case SKILL_BLOCKER: call = Blocker( id, skill, prop );
  920. case SKILL_NIGHTVISION: call = Night_Vision( id, skill, prop );
  921. case SKILL_CLOSESIGHT: call = Close_Sight( id, skill, prop );
  922. case SKILL_HEAVYSLEEP: call = Heavy_Sleep( id, skill, prop );
  923. case SKILL_ZENMODE: call = Zen_Mode( id, skill, prop );
  924. case SKILL_SCREAMINGSTORM: call = Screaming_Storm( id, skill, prop );
  925. case SKILL_HIDDENROCK: call = Hidden_Rock( id, skill, prop );
  926. case SKILL_SHEDSKIN: call = Shed_Skin( id, skill, prop );
  927. case SKILL_HOODLUM: call = Hoodlum( id, skill, prop );
  928. case SKILL_MIRRORTOUCH: call = Mirror_Touch( id, skill, prop );
  929. case SKILL_BODYEATER: call = Body_Eater( id, skill, prop );
  930. case SKILL_SOLIDROCK: call = Solid_Rock( id, skill, prop );
  931. case SKILL_TRIBEAM: call = Tri_Beam( id, skill, prop );
  932. case SKILL_TRASHGAS: call = Trash_Gas( id, skill, prop );
  933. case SKILL_TOXICSPRAY: call = Toxic_Spray( id, skill, prop );
  934. case SKILL_EXTRAAMMO: call = Extra_Ammo( id, skill, prop );
  935. case SKILL_REVERSEDAMGE: call = Reverse_Damge( id, skill, prop );
  936. case SKILL_AMPLIFIER: call = Amplifier( id, skill, prop );
  937. case SKILL_DARKMOON: call = Dark_Moon( id, skill, prop );
  938. case SKILL_MAGICGUARD: call = Magic_Guard( id, skill, prop );
  939. case SKILL_WATERPUMPER: call = Water_Pumper( id, skill, prop );
  940. case SKILL_HYDRATION: call = Hydration( id, skill, prop );
  941. case SKILL_ICEBODY: call = Ice_Body( id, skill, prop );
  942. case SKILL_ICYWINDS: call = Icy_Winds( id, skill, prop );
  943. case SKILL_SNOWSTORM: call = Snow_Storm( id, skill, prop );
  944. case SKILL_SERENEGRACE: call = Serene_Grace( id, skill, prop );
  945. case SKILL_IMITATION: call = Imitation( id, skill, prop );
  946. case SKILL_HOSTAGETAKER: call = Hostage_Taker( id, skill, prop );
  947. case SKILL_CURSEDBODY: call = Cursed_Body ( id, skill, prop );
  948. case SKILL_ELECTROWEB: call = Electroweb( id, skill, prop );
  949. case SKILL_THORNYBARRIER: call = Thorny_Barrier( id, skill, prop );
  950. case SKILL_PROJUMPER: call = Pro_Jumper( id, skill, prop );
  951. case SKILL_CLEARBODY: call = Clear_Body( id, skill, prop );
  952. case SKILL_DISKTHROWER: call = Disk_Thrower( id, skill, prop );
  953. case SKILL_DISKEXPLOSIVE: call = Disk_Explosive( id, skill, prop );
  954. case SKILL_UNKNOWNWORLD: call = Unknown_World( id, skill, prop );
  955. case SKILL_BRAINATTACKER: call = Brain_Attacker( id, skill, prop );
  956. case SKILL_FLAMELIGHTER: call = Flame_Lighter( id, skill, prop );
  957. case SKILL_SOULTAKER: call = Soul_Taker( id, skill, prop );
  958. case SKILL_ADAMANTDRAGON: call = Adamant_Dragon( id, skill, prop );
  959. case SKILL_ICECHILL: call = Ice_Chill( id, skill, prop );
  960. case SKILL_ICECHAINS: call = Ice_Chains( id, skill, prop );
  961. case SKILL_SHELLARMOR: call = Shell_Armor( id, skill, prop );
  962. case SKILL_STEALTH: call = Stealth( id, skill, prop );
  963. case SKILL_EARTHLYLIGHTINING: call = Earthly_Lighting( id, skill, prop );
  964. case SKILL_INNERFOCUS: call = Inner_Focus( id, skill, prop );
  965. case SKILL_WHIPSLASH: call = Whip_Slash( id, skill, prop );
  966. case SKILL_DRAGONLIGHT: call = Dragon_Light( id, skill, prop );
  967. case SKILL_REGENERATION: call = Regeneration( id, skill, prop );
  968. case SKILL_BLADEDHANDS: call = Bladed_Hands( id, skill, prop );
  969. case SKILL_PRESSURE: call = Pressure( id, skill, prop );
  970. case SKILL_HEADCHARGE: call = Head_Charge( id, skill, prop );
  971. case SKILL_HUSTLE: call = Hustle( id, skill, prop );
  972. case SKILL_ARMORRESPAWN: call = Armor_Respawn( id, skill, prop );
  973. case SKILL_WINDDRAGONROAR: call = Wind_Dragon_Roar( id, skill, prop);
  974. case SKILL_WHITESMOKE: call = White_Smoke( id, skill, prop );
  975. case SKILL_TRIPLETEAM: call = Triple_Team( id, skill, prop );
  976. case SKILL_EVILINTENT: call = Evil_Intent( id, skill, prop );
  977. case SKILL_BLAZINGTOUCH: call = Blazing_Touch( id, skill, prop );
  978. case SKILL_DEADLYHORN: call = Deadly_Horn( id, skill, prop );
  979. case SKILL_SEAOFFLAMES: call = Sea_Of_Flames( id, skill, prop );
  980. case SKILL_MINDCONTROL: call = Mind_Control( id, skill, prop );
  981. case SKILL_DEADLYDREAM: call = Deadly_Dream( id, skill, prop );
  982. case SKILL_WATERSPRAYER: call = Water_Sprayer( id, skill, prop );
  983. case SKILL_GEYSERNEST: call = Geyser_Nest( id, skill, prop );
  984. case SKILL_SHININGLIGHT: call = Shining_Light( id, skill, prop );
  985. case SKILL_EMOTIONALPAIN: call = Emotional_Pain( id, skill, prop );
  986. case SKILL_FLIGHT: call = Flight( id, skill, prop );
  987. case SKILL_ROCKYSKY: call = Rocky_Sky( id, skill, prop );
  988. case SKILL_HIGHDEFENSE: call = High_Defense( id, skill, prop );
  989. case SKILL_METALBURST: call = Metal_Burst( id, skill, prop );
  990. case SKILL_DECIEVING: call = Decieving( id, skill, prop );
  991. case SKILL_FALLENLIFE: call = Fallen_life( id, skill, prop );
  992. case SKILL_NIGHTDAZE: call = Night_Daze( id, skill, prop );
  993. case SKILL_PHANTONDAZE: call = Phanton_Daze( id, skill, prop );
  994. case SKILL_WATERGOD: call = Water_God( id, skill, prop );
  995. case SKILL_RELICSONG: call = Relic_Song( id, skill, prop );
  996. case SKILL_TECHNODRIVE: call = Techno_Drive( id, skill, prop );
  997. case SKILL_DEVINEJUDGMENT: call = Divine_Judgement( id, skill, prop );
  998. case SKILL_DEVINEICE: call = Divine_Ice( id, skill, prop );
  999. case SKILL_BLACKDEATH: call = Black_Death( id, skill, prop );
  1000. case SKILL_SHADOWSTALKER: call = Shadow_Stalker( id, skill, prop );
  1001. case SKILL_LIGHTNINGFURY: call = Lightning_Fury( id, skill, prop );
  1002. case SKILL_VOLCANOGEYSER: call = Volcano_Geyser( id, skill, prop );
  1003. case SKILL_FLYINGJUDGMENT: call = Flying_Judgement( id, skill, prop );
  1004. case SKILL_ACIDRAIN: call = Acid_Rain( id, skill, prop );
  1005. case SKILL_ANCIENT: call = Ancient( id, skill, prop );
  1006. case SKILL_FIREEXPLOSION: call = Fire_Explosion( id, skill, prop );
  1007. case SKILL_CALMINGWAVES: call = Calming_Waves( id, skill, prop );
  1008. }
  1009.  
  1010. switch ( call )
  1011. {
  1012. case SKILL_USED:
  1013. {
  1014. if( prop & SI_BIND )
  1015. bind_used( id, skill );
  1016. else{
  1017. #if ONE_SKILL_USE == 0
  1018. parm[0] = id;
  1019. parm[1] = skill;
  1020. set_task(0.0, "delayed_bind_used", 0, parm, 2);
  1021. #else
  1022. bind_used( id, skill );
  1023. #endif
  1024. }
  1025. return true;
  1026. }
  1027. }
  1028. }
  1029. return false;
  1030. }
  1031.  
  1032. /////////////////////////
  1033. // Resets all skills //
  1034. /////////////////////////
  1035. ResetSkills(id, bool:Round_Skills)
  1036. {
  1037. debugMessage(id,4,"Player", "reset skills");
  1038.  
  1039. //things to be reset only after death/round end
  1040. if(Round_Skills){
  1041. skills_handler(id, SI_ROUNDRESET);
  1042. }
  1043.  
  1044. skills_handler(id, SI_RESET);
  1045. CheckRepUsed(id);
  1046.  
  1047. SetActiveSkill(id);
  1048.  
  1049. PlayerStat[id][STAT_ATTACK] = PlayerStat[id][STAT_DEFENSE] = PlayerStat[id][STAT_SPECIAL] = PlayersLevel(id);
  1050. PlayerStat[id][STAT_SPEED] = 0;
  1051.  
  1052. fm_set_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 255);
  1053.  
  1054. if(pev_valid(PlayerEnt[id])){
  1055. new szClass[32];
  1056. pev(PlayerEnt[id], pev_classname, szClass, 31);
  1057. if(equali(szClass, "psy_beam"))
  1058. psybeam_touch(PlayerEnt[id], 0);
  1059. }
  1060. PlayerEnt[id] = 0;
  1061. g_Charge[id] = 0;
  1062.  
  1063. screenflash(id);
  1064. SetSpeed(id);
  1065. }
  1066.  
  1067. ActiveSkill(id)
  1068. return g_isSkilled[id];
  1069. SetActiveSkill(id, skill=-1)
  1070. {
  1071. g_isSkilled[id] = skill;
  1072. debugMessage(id,6,"Player", "set active skill to %s(%d)",SkillToName(skill),skill);
  1073. }
  1074.  
  1075. /////////////////////////////
  1076. // Organized bind delays //
  1077. /////////////////////////////
  1078. public delayed_bind_used( parm[] )
  1079. bind_used( parm[0], parm[1] );
  1080. bind_used(id, skill=-1, Float:over_ride=0.0)
  1081. {
  1082. new Float:gametime = get_gametime();
  1083. new Float:newtime;
  1084. if( !BindUsed[id] || BindUsed[id]==WAIT_TIME ) newtime = gametime;
  1085. else newtime = BindUsed[id];
  1086.  
  1087. if( over_ride != 0.0 )
  1088. newtime += over_ride;
  1089. else if( skill != -1 ){
  1090. new Float:tasktime, Float:oldtime;
  1091. tasktime = oldtime = SkillDelay[skill];
  1092.  
  1093. tasktime -= (PlayersLevel(id)*DELAY_LEVEL_REDUCE);
  1094.  
  1095. if(tasktime < oldtime/3)
  1096. tasktime = oldtime/3;
  1097.  
  1098. newtime += tasktime;
  1099. }
  1100.  
  1101. if( newtime > gametime ){
  1102. BindUsed[id] = newtime;
  1103. g_StopSkill[id] = true;
  1104. }
  1105. }
  1106.  
  1107. /////////////////////////////////////////////////
  1108. // If we want to set it to exactly something //
  1109. /////////////////////////////////////////////////
  1110. set_bind(id, Float:time=0.0)
  1111. BindUsed[id] = time;
  1112.  
  1113. ///////////////////////////////////////////////////////////////////
  1114. // If I need to stop them after they've used it a couple times //
  1115. ///////////////////////////////////////////////////////////////////
  1116. end_rep_use(id, skill, Float:max)
  1117. {
  1118. SetActiveSkill(id, skill);
  1119. if( ++g_Charge[id] >= max*10 ){
  1120. g_Charge[id] = 0;
  1121. if( Action[id] != AC_SKILL )
  1122. SetActiveSkill(id);
  1123. return true;
  1124. }
  1125. return false;
  1126. }
  1127. CheckRepUsed(id)
  1128. {
  1129. if( g_Charge[id] && ValidSkill( ActiveSkill(id) ) ){
  1130. bind_used(id, ActiveSkill(id));
  1131. g_Charge[id] = 0;
  1132. SetActiveSkill(id);
  1133. return true;
  1134. }
  1135. return false;
  1136. }
  1137.  
  1138. public create_sprite_spray(parm[])
  1139. {
  1140. message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  1141. write_byte(120)
  1142. write_coord(parm[0]) //origin
  1143. write_coord(parm[1])
  1144. write_coord(parm[2])
  1145. write_coord(parm[3]) //velocity
  1146. write_coord(parm[4])
  1147. write_coord(parm[5])
  1148. write_short(parm[6]) //sprite
  1149. write_byte(8) //count
  1150. write_byte(10) //speed
  1151. write_byte(100) //noise
  1152. write_byte(5) //rendermode
  1153. message_end()
  1154. }
  1155. public spray_check(parm[])
  1156. {
  1157. new id = parm[0]
  1158. new flame = parm[1] //this is 0 for smoke, 1 for fire
  1159. new skill = parm[2] //this is 0 for smoke, 1 for fire
  1160.  
  1161. //direct damage first
  1162. new ent, body
  1163. get_user_aiming(id, ent, body, 600)
  1164.  
  1165. if(Pokemod_Alive(ent))
  1166. {
  1167. if(flame==1)
  1168. ApplyStatus( id, ent, STATUS_BURN, 0.0 )
  1169. else if(flame==2)
  1170. screenflash(ent,139,59,19,200)
  1171. else
  1172. screenflash(ent,255,255,255,255)
  1173. }
  1174.  
  1175. //now indirect damage
  1176. new Players[32], iNum, target
  1177. poke_get_players(Players, iNum, PLAYER_ALIVE|PLAYER_MORTAL)
  1178.  
  1179. new Float:fOrigin[3], Float:fOrigin2[3]
  1180. new temp[3], Float:fAim[3]
  1181. new Float:fDistance = 600.0
  1182. new iDistance
  1183.  
  1184. for(new i = 0; i < iNum; i++)
  1185. {
  1186. target = Players[i]
  1187. if( target == id )
  1188. continue
  1189.  
  1190. pev(id, pev_origin, fOrigin)
  1191. pev(target, pev_origin, fOrigin2)
  1192.  
  1193. get_user_origin(id, temp, 3)
  1194. IVecFVec(temp, fAim)
  1195.  
  1196. if(get_distance_f(fOrigin, fOrigin2) > fDistance)
  1197. continue
  1198.  
  1199. iDistance = get_distance_to_line(fOrigin, fOrigin2, fAim)
  1200. if( iDistance > 40 || iDistance < 0 || !fm_is_ent_visible(id, target) )
  1201. continue
  1202.  
  1203. if(flame==1){
  1204. skilldamage(target, id, 1, skill)
  1205. if(Chance(id))
  1206. ApplyStatus( id, target, STATUS_BURN, 0.0 )
  1207. }
  1208. else if(flame==2)
  1209. screenflash(target,139,59,19,200)
  1210. else
  1211. screenflash(target,255,255,255,255)
  1212. }
  1213. }
  1214. BlowUp(id)
  1215. {
  1216. get_user_origin(id,origin[id])
  1217.  
  1218. poke_sound(id,CHAN_STATIC, SND_SUCK)
  1219.  
  1220. message_begin( MSG_BROADCAST, SVC_TEMPENTITY )
  1221. write_byte(TE_IMPLOSION)
  1222. write_coord(origin[id][0])
  1223. write_coord(origin[id][1])
  1224. write_coord(origin[id][2])
  1225. write_byte(100)
  1226. write_byte(20)
  1227. write_byte(5)
  1228. message_end()
  1229.  
  1230. // random explosions
  1231. message_begin( MSG_PVS, SVC_TEMPENTITY, origin[id] )
  1232. write_byte(TE_EXPLOSION) // This just makes a dynamic light now
  1233. write_coord( origin[id][0] + random_num( -100, 100 ))
  1234. write_coord( origin[id][1] + random_num( -100, 100 ))
  1235. write_coord( origin[id][2] + random_num( -50, 50 ))
  1236. write_short( SPRITE_INDEX[SPR_EEXPLO] )
  1237. write_byte( random_num(0,20) + 20 ) // scale * 10
  1238. write_byte( 12 ) // framerate
  1239. write_byte(0)
  1240. message_end()
  1241.  
  1242. // lots of smoke
  1243. message_begin( MSG_PVS, SVC_TEMPENTITY, origin[id] )
  1244. write_byte(TE_SMOKE)
  1245. write_coord( origin[id][0] + random_num( -100, 100 ))
  1246. write_coord( origin[id][1] + random_num( -100, 100 ))
  1247. write_coord( origin[id][2] + random_num( -50, 50 ))
  1248. write_short( SPRITE_INDEX[SPR_STEAM1] )
  1249. write_byte( 60 ) // scale * 10
  1250. write_byte( 10 ) // framerate
  1251. message_end()
  1252.  
  1253. // blast circles
  1254. message_begin( MSG_PAS, SVC_TEMPENTITY, origin[id] )
  1255. write_byte(TE_BEAMCYLINDER)
  1256. write_coord( origin[id][0])
  1257. write_coord( origin[id][1])
  1258. write_coord( origin[id][2] - 16)
  1259. write_coord( origin[id][0])
  1260. write_coord( origin[id][1])
  1261. write_coord( origin[id][2] - 16 + EXPLOSION_RADIUS)
  1262. write_short( SPRITE_INDEX[SPR_SHOCKWAVE] )
  1263. write_byte( 0 ) // startframe
  1264. write_byte( 0 ) // framerate
  1265. write_byte( 6 ) // life
  1266. write_byte( 16 ) // width
  1267. write_byte( 0 ) // noise
  1268. write_byte( 188 )
  1269. write_byte( 220 )
  1270. write_byte( 255 )
  1271. write_byte( 255 ) //brightness
  1272. write_byte( 0 ) // speed
  1273. message_end()
  1274.  
  1275. }
  1276. public make_powder(parm[])
  1277. {
  1278. new id = parm[0];
  1279. if(!PMon() || !Pokemod_Alive(id))
  1280. return
  1281.  
  1282. new Float:fl_Origin[3], ptime = POWDER_TIME
  1283.  
  1284. pev(id, pev_origin, fl_Origin)
  1285.  
  1286. new newEnt = fm_create_entity("info_target")
  1287.  
  1288. set_pev(newEnt, pev_classname, "pokemod_ent")
  1289. fm_entity_set_model(newEnt, MODELS[MDL_POWDER])
  1290.  
  1291. // Change height of entity origin to hands
  1292. fl_Origin[2] += 6
  1293.  
  1294. // Set entity postion
  1295. fm_entity_set_origin(newEnt, fl_Origin)
  1296.  
  1297. // Set properties of the entity
  1298. set_pev( newEnt, pev_rendermode, 5)
  1299. set_pev( newEnt, pev_renderamt, 255.0)
  1300. set_pev( newEnt, pev_owner, id)
  1301.  
  1302. set_pev( newEnt, pev_animtime, 1.0);
  1303. set_pev( newEnt, pev_framerate, 1.0);
  1304. set_pev( newEnt, pev_sequence, 0);
  1305.  
  1306. new parm2[3];
  1307. parm2[0] = newEnt;
  1308. parm2[1] = parm[1];
  1309. parm2[2] = parm[2];
  1310. check_powder(parm2)
  1311. set_task(0.5,"check_powder",0, parm2, 3 , "a", 2*ptime-1)
  1312. set_task(ptime*1.0,"poke_remove_entity",newEnt+REMOVE_TASK)
  1313. }
  1314. public check_powder(parm[])
  1315. {
  1316. new spowder = parm[0];
  1317. new check_poison = parm[1];
  1318. new check_sleep = parm[2];
  1319.  
  1320. if(!pev_valid(spowder))
  1321. return
  1322.  
  1323. new id = pev(spowder, pev_owner)
  1324.  
  1325. new Float:poison_time = get_ppcvar_float(pm_poisontime)
  1326. new Float:sleep_time = get_ppcvar_float(pm_sleeptime)
  1327. new range = POWDER_RANGE
  1328. AddLvl(id, range)
  1329.  
  1330. new aid, players[MAX_PLAYERS], pnum
  1331. poke_get_players(players,pnum,PLAYER_ALIVE|PLAYER_MORTAL|PLAYER_NOTEAM,Pokemod_Team(id))
  1332.  
  1333. for(new i = 0; i<pnum; i++)
  1334. {
  1335. aid = players[i]
  1336.  
  1337. if( fm_entity_range(spowder,aid) < range ) {
  1338.  
  1339. if( check_poison && !g_Status[aid][STATUS_POISON] ){
  1340. ApplyStatus( id, aid, STATUS_POISON, poison_time )
  1341. }
  1342.  
  1343. if( check_sleep && !g_Status[aid][STATUS_ASLEEP] ){
  1344. ApplyStatus( id, aid, STATUS_ASLEEP, sleep_time )
  1345. }
  1346. }
  1347. }
  1348. }
  1349. public check_spore(parm[])
  1350. {
  1351. new ent = parm[0];
  1352. parm[2]--;
  1353.  
  1354. if( pev_valid(ent) ){
  1355. new Float:health;
  1356. pev(ent, pev_health, health);
  1357. if( health-POKE_HP_OFFSET < 0 ){
  1358. new Float:origfl[3], orig[3];
  1359. pev( ent, pev_origin, origfl );
  1360. FVecIVec(origfl, orig);
  1361.  
  1362. new parmlol[7];
  1363. parmlol[0] = orig[0];
  1364. parmlol[1] = orig[1];
  1365. parmlol[2] = orig[2]+100;
  1366. parmlol[3] = 0;
  1367. parmlol[4] = 0;
  1368. parmlol[5] = 50;
  1369. parmlol[6] = SPRITE_INDEX[SPR_STEAM1];
  1370. create_sprite_spray( parmlol );
  1371.  
  1372. set_task(1.0,"poke_remove_entity",ent+REMOVE_TASK);
  1373. set_task(0.1, "check_spore", 0, parm, 4);
  1374.  
  1375. return;
  1376. }
  1377.  
  1378. if( !parm[2] ){
  1379. fm_remove_entity(ent);
  1380. return;
  1381. }
  1382. }
  1383. else
  1384. return;
  1385.  
  1386. new id = pev(ent, pev_owner);
  1387.  
  1388. new range = SPORE_RANGE;
  1389. AddLvl(id, range);
  1390.  
  1391. new aid, players[MAX_PLAYERS], pnum
  1392. poke_get_players(players,pnum,PLAYER_ALIVE|PLAYER_MORTAL|PLAYER_NOTEAM,Pokemod_Team(id))
  1393. for(new i = 0; i<pnum; i++)
  1394. {
  1395. aid = players[i]
  1396.  
  1397. if( fm_entity_range(ent,aid) < range ) {
  1398.  
  1399. if( parm[3] ){
  1400. if( !g_Status[aid][STATUS_POISON] )
  1401. ApplyStatus( id, aid, STATUS_POISON, 5.0 )
  1402. }
  1403. else
  1404. set_pev( aid, pev_velocity, Float:{0.0,0.0,0.0} );
  1405. }
  1406. }
  1407.  
  1408. new Float:origfl[3], orig[3];
  1409. pev( ent, pev_origin, origfl );
  1410. FVecIVec(origfl, orig);
  1411.  
  1412. if( (parm[2] % 10) == 0 ){
  1413. message_begin( MSG_PAS, SVC_TEMPENTITY, orig )
  1414. write_byte(TE_BEAMCYLINDER)
  1415. write_coord( orig[0])
  1416. write_coord( orig[1])
  1417. write_coord( orig[2] + 20 )
  1418. write_coord( orig[0])
  1419. write_coord( orig[1])
  1420. write_coord( orig[2] + 20 + range)
  1421. write_short( SPRITE_INDEX[SPR_GAS] )
  1422. write_byte( 0 ) // startframe
  1423. write_byte( 0 ) // framerate
  1424. write_byte( 10 ) // life
  1425. write_byte( 16 ) // width
  1426. write_byte( 0 ) // noise
  1427. write_byte( 88 )
  1428. write_byte( 20 )
  1429. write_byte( parm[3] ? 255 : 50 )
  1430. write_byte( 255 ) //brightness
  1431. write_byte( 0 ) // speed
  1432. message_end()
  1433. }
  1434.  
  1435. if( (parm[2] % 5) == 0 ){
  1436. new parmlol[7];
  1437. parmlol[0] = orig[0];
  1438. parmlol[1] = orig[1];
  1439. parmlol[2] = orig[2]+100;
  1440. parmlol[3] = 0;
  1441. parmlol[4] = 0;
  1442. parmlol[5] = -20;
  1443. parmlol[6] = parm[3] ? SPRITE_INDEX[SPR_BIGSPIT] : SPRITE_INDEX[SPR_MUZZLEFLASH1];
  1444. create_sprite_spray( parmlol );
  1445. }
  1446.  
  1447. set_task(0.1, "check_spore", 0, parm, 4);
  1448. }
  1449. public delayed_grenade(parm[])
  1450. give_grenade(parm[0],parm[1],bool:parm[2]);
  1451. give_grenade(id, how_many=1, bool:add_with=false)
  1452. {
  1453. if( !Pokemod_Alive(id) )
  1454. return;
  1455. new old_amount, new_amount
  1456. #if MOD==CS
  1457. give_item(id, "weapon_hegrenade")
  1458. old_amount = cs_get_user_bpammo(id, CSW_HEGRENADE)
  1459. new_amount = add_with ? (old_amount+how_many) : ( max(how_many,old_amount) )
  1460. cs_set_user_bpammo(id, CSW_HEGRENADE, new_amount)
  1461. #endif
  1462. #if MOD==DOD
  1463. new wpnid
  1464. if(Pokemod_Team(id)==2){
  1465. give_item(id, "weapon_stickgrenade")
  1466. wpnid = DODW_STICKGRENADE
  1467. }
  1468. else{
  1469. give_item(id, "weapon_handgrenade")
  1470. wpnid = DODW_HANDGRENADE
  1471. }
  1472. old_amount = dod_get_user_ammo(id,wpnid)
  1473. new_amount = add_with ? (old_amount+how_many) : ( max(how_many,old_amount) )
  1474. dod_set_user_ammo(id, wpnid, new_amount)
  1475. #endif
  1476. #if MOD==NS
  1477. if(Pokemod_Team(id)==1){
  1478. new wpn[32], bpammo
  1479. get_user_weapon(id, old_amount, bpammo)
  1480. get_weaponname(WEAPON_GRENADE,wpn,31)
  1481.  
  1482. ns_give_item(id, "weapon_grenade")
  1483. new_amount = add_with ? (old_amount+how_many) : ( max(how_many,old_amount) )
  1484. new iWPNidx = -1
  1485. while ((iWPNidx = fm_find_ent_by_class(iWPNidx, wpn)) != 0) {
  1486. if (id == pev(iWPNidx, pev_owner)) {
  1487. ns_set_weap_clip(iWPNidx, new_amount)
  1488. }
  1489. }
  1490. }
  1491. #endif
  1492. }
  1493. Gas(id, bool:smog=false, bool:poison=false)
  1494. {
  1495. if( !Pokemod_Alive(id) || ( !smog && !poison ) )
  1496. return;
  1497.  
  1498. get_user_origin(id, origin[id])
  1499. message_begin(MSG_BROADCAST, SVC_TEMPENTITY) //message begin
  1500. write_byte(TE_SPRITE)
  1501. write_coord(origin[id][0]) // start position
  1502. write_coord(origin[id][1])
  1503. write_coord(origin[id][2])
  1504. write_short(SPRITE_INDEX[SPR_GAS]) // sprite index
  1505. write_byte(10) // scale in 0.1's
  1506. write_byte(100) // brightness
  1507. message_end()
  1508.  
  1509. new aid, playersa[MAX_PLAYERS], pnuma
  1510. poke_get_players(playersa,pnuma,PLAYER_ALIVE|PLAYER_MORTAL|PLAYER_NOTEAM,Pokemod_Team(id))
  1511.  
  1512. new Float:poison_time = get_ppcvar_float(pm_poisontime)
  1513. new distance
  1514. new maxdist = 300
  1515. AddLvl(id, maxdist)
  1516.  
  1517. for(new ick = 0; ick<pnuma; ick++)
  1518. {
  1519. aid = playersa[ick]
  1520.  
  1521. get_user_origin(aid, origin[aid])
  1522.  
  1523. distance = get_distance(origin[aid], origin[id])
  1524. if(distance <= maxdist){
  1525. if(smog){
  1526. poke_print(aid,print_center,LANG,aid,"POKEMOD_SMOG")
  1527. screenflash(aid, 139, 59, 19, 222, 1.0)
  1528. }
  1529. if(poison && !g_Status[aid][STATUS_POISON]){
  1530. ApplyStatus( id, aid, STATUS_POISON, poison_time )
  1531. }
  1532. }
  1533. }
  1534. }
  1535. make_snow(id)
  1536. {
  1537. get_user_origin(id,origin[id]);
  1538.  
  1539. //lets put one on each side of them
  1540. new sides[4][2];
  1541. sides[0][0] = sides[0][1] = sides[2][0] = sides[3][1] = 100;
  1542. sides[1][0] = sides[1][1] = sides[2][1] = sides[3][0] = -100;
  1543.  
  1544. for(new i=0; i<4; i++){
  1545. message_begin(MSG_BROADCAST, SVC_TEMPENTITY) //message begin
  1546. write_byte( TE_SPRITE ) // additive sprite, plays 1 cycle
  1547. write_coord(origin[id][0] + sides[i][0] + random_num(-10,10))
  1548. write_coord(origin[id][1] + sides[i][1] + random_num(-10,10))
  1549. write_coord(origin[id][2])
  1550. write_short( SPRITE_INDEX[SPR_SNOW] )
  1551. write_byte( 14 ) // byte (scale in 0.1's)
  1552. write_byte( 255 ) // byte (brightness)
  1553. message_end()
  1554. }
  1555.  
  1556. return PLUGIN_HANDLED
  1557. }
  1558. PokeSkillTarget(id, &damage=-1, &weapon=-1)
  1559. {
  1560. new victim;
  1561. // If they were damaged
  1562. if( PlayerDamageInfo[id][PD_DAMAGE] ){
  1563. damage = PlayerDamageInfo[id][PD_DAMAGE];
  1564. weapon = PlayerDamageInfo[id][PD_WEAPON];
  1565. return PlayerDamageInfo[id][PD_ATTACKER];
  1566. }
  1567. // If they damaged someone else
  1568. for( victim=0; victim<MAX_PLAYERS; victim++ )
  1569. if( PlayerDamageInfo[victim][PD_ATTACKER] == id ){
  1570. damage = PlayerDamageInfo[victim][PD_DAMAGE];
  1571. weapon = PlayerDamageInfo[victim][PD_WEAPON];
  1572. return victim;
  1573. }
  1574. // If they touched someone
  1575. if( PlayerDamageInfo[id][PD_ATTACKER] ){
  1576. damage = weapon = 0;
  1577. return PlayerDamageInfo[id][PD_ATTACKER];
  1578. }
  1579. // Get who they are looking at
  1580. get_user_aiming(id, victim, weapon);
  1581. if( Pokemod_Alive(victim) ){
  1582. weapon = get_user_weapon(id);
  1583. damage = 0;
  1584. return victim;
  1585. }
  1586. return 0;
  1587. }
  1588.  
  1589. SkillLevel(id, skill)
  1590. {
  1591. if( is_user_connected(id) && ValidSkill(skill) ){
  1592. static pid, i;
  1593. pid = Pokemon[id];
  1594. for( i = -1; i<MAX_ACTIVE_POKES; i++ ){
  1595. if( i != -1 ){
  1596. //if weve already added the skill in, we don't need to add it again
  1597. if( i == PlayersActive[id] )
  1598. continue;
  1599. else
  1600. pid = PlayersPoke[id][i];
  1601. }
  1602. while( ValidPoke(pid) ){
  1603. if( !PokeDisabled(pid) && PokeSkill[pid] == skill ){
  1604. if( i==-1 || PokeInfo[pid] & PI_GLOBAL ){
  1605. return PlayersLevel(id, i);
  1606. }
  1607. }
  1608.  
  1609. pid = AnyEvolveTo(pid);
  1610. }
  1611. }
  1612. }
  1613. return 0;
  1614. }
  1615. make_inferno(id)
  1616. {
  1617. get_user_origin(id,origin[id]);
  1618.  
  1619. //lets put one on each side of them
  1620. new sides[4][2];
  1621. sides[0][0] = sides[0][1] = sides[2][0] = sides[3][1] = 100;
  1622. sides[1][0] = sides[1][1] = sides[2][1] = sides[3][0] = -100;
  1623.  
  1624. for(new i=0; i<4; i++){
  1625. message_begin(MSG_BROADCAST, SVC_TEMPENTITY) //message begin
  1626. write_byte( TE_SPRITE ) // additive sprite, plays 1 cycle
  1627. write_coord(origin[id][0] + sides[i][0] + random_num(-10,10))
  1628. write_coord(origin[id][1] + sides[i][1] + random_num(-10,10))
  1629. write_coord(origin[id][2])
  1630. write_short( SPRITE_INDEX[SPR_SACRED])
  1631. write_byte( 14 ) // byte (scale in 0.1's)
  1632. write_byte( 255 ) // byte (brightness)
  1633. message_end()
  1634. }
  1635.  
  1636. return PLUGIN_HANDLED
  1637. }
  1638. make_inferno_b(id)
  1639. {
  1640. get_user_origin(id,origin[id]);
  1641.  
  1642. //lets put one on each side of them
  1643. new sides[4][2];
  1644. sides[0][0] = sides[0][1] = sides[2][0] = sides[3][1] = 100;
  1645. sides[1][0] = sides[1][1] = sides[2][1] = sides[3][0] = -100;
  1646.  
  1647. for(new i=0; i<4; i++){
  1648. message_begin(MSG_BROADCAST, SVC_TEMPENTITY) //message begin
  1649. write_byte( TE_SPRITE ) // additive sprite, plays 1 cycle
  1650. write_coord(origin[id][0] + sides[i][0] + random_num(-10,10))
  1651. write_coord(origin[id][1] + sides[i][1] + random_num(-10,10))
  1652. write_coord(origin[id][2])
  1653. write_short( SPRITE_INDEX[SPR_BFLAME])
  1654. write_byte( 14 ) // byte (scale in 0.1's)
  1655. write_byte( 255 ) // byte (brightness)
  1656. message_end()
  1657. }
  1658.  
  1659. return PLUGIN_HANDLED
  1660. }
  1661. make_snow_o(vorigin[3])
  1662. {
  1663.  
  1664. //lets put one on each side of them
  1665. new sides[4][2];
  1666. sides[0][0] = sides[0][1] = sides[2][0] = sides[3][1] = 100;
  1667. sides[1][0] = sides[1][1] = sides[2][1] = sides[3][0] = -100;
  1668.  
  1669. for(new i=0; i<4; i++){
  1670. message_begin(MSG_BROADCAST, SVC_TEMPENTITY) //message begin
  1671. write_byte( TE_SPRITE ) // additive sprite, plays 1 cycle
  1672. write_coord(vorigin[0] + sides[i][0] + random_num(-10,10))
  1673. write_coord(vorigin[1] + sides[i][1] + random_num(-10,10))
  1674. write_coord(vorigin[2])
  1675. write_short( SPRITE_INDEX[SPR_SNOW] )
  1676. write_byte( 14 ) // byte (scale in 0.1's)
  1677. write_byte( 255 ) // byte (brightness)
  1678. message_end()
  1679. }
  1680.  
  1681. return PLUGIN_HANDLED
  1682. }
  1683.  
  1684. Kenesis(id, bool:smog=false, bool:poison=false)
  1685. {
  1686. if( !Pokemod_Alive(id) || ( !smog && !poison ) )
  1687. return;
  1688.  
  1689. get_user_origin(id, origin[id])
  1690. message_begin(MSG_BROADCAST, SVC_TEMPENTITY) //message begin
  1691. write_byte(TE_SPRITE)
  1692. write_coord(origin[id][0]) // start position
  1693. write_coord(origin[id][1])
  1694. write_coord(origin[id][2])
  1695. write_short(SPRITE_INDEX[SPR_SHOCKWAVE]) // sprite index
  1696. write_byte(10) // scale in 0.1's
  1697. write_byte(20) // brightness
  1698. message_end()
  1699.  
  1700. new aid, playersa[MAX_PLAYERS], pnuma
  1701. poke_get_players(playersa,pnuma,PLAYER_ALIVE|PLAYER_MORTAL|PLAYER_NOTEAM,Pokemod_Team(id))
  1702.  
  1703. new Float:poison_time = get_ppcvar_float(pm_poisontime)
  1704. new distance
  1705. new maxdist = 500
  1706. AddLvl(id, maxdist)
  1707.  
  1708. for(new ick = 0; ick<pnuma; ick++)
  1709. {
  1710. aid = playersa[ick]
  1711.  
  1712. get_user_origin(aid, origin[aid])
  1713.  
  1714. distance = get_distance(origin[aid], origin[id])
  1715. if(distance <= maxdist){
  1716. if(smog){
  1717. poke_print(aid,print_center,LANG,aid,"POKEMOD_SMOG")
  1718. }
  1719. if(poison && !g_Status[aid][STATUS_SLOW]){
  1720. ApplyStatus( id, aid, STATUS_SLOW, poison_time )
  1721. }
  1722. }
  1723. }
  1724. }
  1725. Flamewheel(id, bool:smog=false, bool:poison=false)
  1726. {
  1727. if( !Pokemod_Alive(id) || ( !smog && !poison ) )
  1728. return;
  1729.  
  1730. get_user_origin(id, origin[id])
  1731. message_begin(MSG_BROADCAST, SVC_TEMPENTITY) //message begin
  1732. write_byte(TE_SPRITE)
  1733. write_coord(origin[id][0]) // start position
  1734. write_coord(origin[id][1])
  1735. write_coord(origin[id][2])
  1736. write_short(SPRITE_INDEX[SPR_FIRE]) // sprite index
  1737. write_byte(10) // scale in 0.1's
  1738. write_byte(10) // brightness
  1739. message_end()
  1740.  
  1741. new aid, playersa[MAX_PLAYERS], pnuma
  1742. poke_get_players(playersa,pnuma,PLAYER_ALIVE|PLAYER_MORTAL|PLAYER_NOTEAM,Pokemod_Team(id))
  1743.  
  1744. new Float:poison_time = get_ppcvar_float(pm_poisontime)
  1745. new distance
  1746. new maxdist = 100
  1747. AddLvl(id, maxdist)
  1748.  
  1749. for(new var = 0; var<pnuma; var++)
  1750. {
  1751. aid = playersa[var]
  1752.  
  1753. get_user_origin(aid, origin[aid])
  1754.  
  1755. distance = get_distance(origin[aid], origin[id])
  1756. if(distance <= maxdist){
  1757. if(smog){
  1758. poke_print(aid,print_center,LANG,aid,"POKEMOD_SMOG")
  1759. }
  1760. if(poison && !g_Status[aid][STATUS_BURN]){
  1761. ApplyStatus( id, aid, STATUS_BURN, poison_time )
  1762. }
  1763.  
  1764. }
  1765. }
  1766. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement