
 public Solar_Beam(id, skill, prop)
 {
	if(is_user_outside(id)){
		new level = PlayersLevel(id, PlayersActive[id])
		new origin[3], aimvec[3], Float:f_origin[3], Float:f_aimvec[3]

		get_user_origin(id, origin)
		get_user_origin(id, aimvec, 2)
		IVecFVec(origin, f_origin)
		IVecFVec(aimvec, f_aimvec)

		skillLinedamage(id, f_origin, f_aimvec, level/2, level, skill)
		MakeLine(0,origin,aimvec,SPRITE_INDEX[SPR_ZBEAM6],1,1,1,level,0,255,255,255,255,0)
		poke_sound(id,CHAN_VOICE, SND_SUCK)

		end_rep_use(id, skill, 1.0)
	}
	else{
		poke_print(id, print_center, "Musisz byc na zewnatrz by uzyc %s", SkillToName(skill) )
	}
	return PLUGIN_CONTINUE;
 }
 public Sky_Uppercut(id, skill, prop)
 {
	if(is_user_outside(id)){
		new level = PlayersLevel(id, PlayersActive[id])
		new origin[3], aimvec[3], Float:f_origin[3], Float:f_aimvec[3]

		get_user_origin(id, origin)
		get_user_origin(id, aimvec, 2)
		IVecFVec(origin, f_origin)
		IVecFVec(aimvec, f_aimvec)

		skillLinedamage(id, f_origin, f_aimvec, level/2, level, skill)
		MakeLine(0,origin,aimvec,SPRITE_INDEX[SPR_ZBEAM6],1,1,1,level,0,255,0,0,255,0)
		poke_sound(id,CHAN_VOICE, SND_TU_FIRE)

		end_rep_use(id, skill, 1.0)
	}
	else{
		poke_print(id, print_center, "Musisz byc na zewnatrz by uzyc %s", SkillToName(skill) )
	}
	return PLUGIN_CONTINUE;
 }
 public Leech_Seed(id, skill, prop)
 {
	new aid = PokeSkillTarget(id);

	if( is_user_alive(aid) && (Team(id)!=Team(aid) || FFon()) ){
		g_isLeeched[id][aid] = true
		new parm[3];
		parm[0] = id;
		parm[1] = aid;
		parm[2] = skill;
		leech_seed_loop( parm );
		return PLUGIN_HANDLED;
	}
	return PLUGIN_CONTINUE;
 }
 public leech_seed_loop(parm[])
 {
	new id = parm[0], aid = parm[1], skill = parm[2];
	new aliveI = is_user_alive(id), aliveA = is_user_alive(aid)

	if(!aliveI || !aliveA || !g_isLeeched[id][aid] ){
		g_isLeeched[id][aid] = false
		return
	}

	new aName[32], iName[32], dmg = LEECH_SEED

	AddLvl(id, dmg)

	sound_hit(id)
	sound_hit(aid)

	MakeLine_Ent(0,id,aid,SPRITE_INDEX[SPR_ROPE],1,1,10,5,0,0,255,0,100,0)

	get_user_name(id, iName, 31)
	get_user_name(aid, aName, 31)

	poke_print(id,print_center,"Zostales zaatakowany Leechem %s", aName)
	poke_print(aid,print_center,"Zostales zaatakowany Leechem przez %s", iName)

	screenflash(id, 0, 255, 0, 50)
	screenflash(aid, 0, 255, 0, 50)

	Heal(id, skilldamage(aid, id, dmg, skill) );

	new Float:tasktime = LEECH_SEED_TIME - f_LevelPercent(id, LEECH_SEED_TIME/2, -1)

	set_task(tasktime, "leech_seed_loop",0, parm, 3)
 }
 public Vine_Whip(id, skill, prop)
 {
	new aid = PokeSkillTarget(id);

	if(is_user_alive(aid) && (Team(id)!=Team(aid) || FFon())){
		new Float:velocity[3]
		new Float:jump = VINE_WHIP_JUMP
		new whipdamage = VINE_WHIP_DAMAGE

		f_AddLvl(id, jump)
		AddLvl(id, whipdamage)

		skilldamage( aid, id, whipdamage, skill)

		sound_hit(id)
		sound_hit(aid)

		MakeLine_Ent(0,id,aid,SPRITE_INDEX[SPR_ROPE],1,1,10,10,10,0,255,0,100,0)

		pev(id, pev_velocity, velocity)

		if( !HeavyPoke(Pokemon[aid]) )
			velocity[2] += jump

		set_pev(aid, pev_velocity, velocity)
		set_pev(aid, pev_gaitsequence, 6)
		return PLUGIN_HANDLED;
	}
	return PLUGIN_CONTINUE;
 }
 public Absorb(id, skill, prop)
 {
	new victim = PokeSkillTarget(id)

	if( !is_user_alive(victim) )
		return PLUGIN_CONTINUE;

	new armor = get_user_armor(victim)
	new level = PlayersLevel(id, -1)
	new totake = (armor*level)/(TotalLevels+1)

	if(level<armor)
		clamp(totake, level, armor)
	else
		totake = armor

	Repair(id, totake)
	set_user_armor(victim, armor-totake)

	sound_hit(id)
	sound_hit(victim)

	MakeLine_Ent(0,id,victim,SPRITE_INDEX[SPR_ROPE],1,1,10,5,10,0,255,200,255,0)
	return PLUGIN_HANDLED;
 }
 public Razor_Leaf(id, skill, prop)
 {
	new level = PlayersLevel(id,PlayersActive[id])
	new aimvec[3], Float:f_origin[3], Float:f_aimvec[3]

	get_user_origin(id, origin[id])
	get_user_origin(id, aimvec, 2)
	IVecFVec(origin[id], f_origin)
	IVecFVec(aimvec, f_aimvec)

	skillLinedamage(id, f_origin, f_aimvec, level/3, level*RAZOR_LEAF_FACTOR, skill)

	new sprites = get_distance(origin[id], aimvec)/75

	message_begin(MSG_BROADCAST, SVC_TEMPENTITY)	//message begin
	write_byte(15)
	write_coord(origin[id][0])		// start position
	write_coord(origin[id][1])
	write_coord(origin[id][2])
	write_coord(aimvec[0])	// end position
	write_coord(aimvec[1])
	write_coord(aimvec[2])
	write_short(SPRITE_INDEX[SPR_BIGSPIT])		// sprite index
	write_byte(sprites)		// count
	write_byte(1)		// life in 0.1's
	write_byte(level/15)		// scale in 0.1's
	write_byte(5)		// velocity along vector in 10's
	write_byte(5)	// randomness of velocity in 10's
	message_end()

	poke_sound(id,CHAN_VOICE, SND_STEP);

	end_rep_use(id, skill, 0.5);
	return PLUGIN_CONTINUE;
 }
public Focus_Energy(id, skill, prop)
 {
	new level = PlayersLevel(id,PlayersActive[id])
	new aimvec[3], Float:f_origin[3], Float:f_aimvec[3]

	get_user_origin(id, origin[id])
	get_user_origin(id, aimvec, 2)
	IVecFVec(origin[id], f_origin)
	IVecFVec(aimvec, f_aimvec)

	skillLinedamage(id, f_origin, f_aimvec, level/3, level*RAZOR_LEAF_FACTOR, skill,  _, STATUS_BURN, -1)

	new sprites = get_distance(origin[id], aimvec)/75

	message_begin(MSG_BROADCAST, SVC_TEMPENTITY)	//message begin
	write_byte(15)
	write_coord(origin[id][0])		// start position
	write_coord(origin[id][1])
	write_coord(origin[id][2])
	write_coord(aimvec[0])	// end position
	write_coord(aimvec[1])
	write_coord(aimvec[2])
	write_short(SPRITE_INDEX[SPR_XFIRE])		// sprite index
	write_byte(sprites)		// count
	write_byte(1)		// life in 0.1's
	write_byte(level/15)		// scale in 0.1's
	write_byte(5)		// velocity along vector in 10's
	write_byte(5)	// randomness of velocity in 10's
	message_end()

	poke_sound(id,CHAN_VOICE, SND_BELL);

	end_rep_use(id, skill, 0.5);
	return PLUGIN_CONTINUE;
 }

 public Mega_Drain(id, skill, prop)
 {
	new weapon, victim = PokeSkillTarget(id, _, weapon);
	if( !is_user_alive(victim) || knife_weapon(weapon) || grenade_weapon(weapon) )
		return PLUGIN_CONTINUE;
	new vweapon = get_user_weapon(victim);
	if( knife_weapon(vweapon) || grenade_weapon(vweapon) )
		return PLUGIN_CONTINUE;

	if( Chance(id) ){

		new wpn[32], ammo;
		new vwpn[32], vammo;
		get_user_weapon(id, ammo);
		get_weaponname(weapon,wpn,31);
		get_user_weapon(victim, vammo);
		get_weaponname(vweapon,vwpn,31);

		new drain = LevelPercent(id, vammo);

		#if MOD==CS
			new iWPNidx = -1;
			while( (iWPNidx = fm_find_ent_by_class(iWPNidx, wpn)) ){
				if( id == pev(iWPNidx, pev_owner) ){
					cs_set_weapon_ammo(iWPNidx, ammo+drain);
				}
			}
			iWPNidx = -1;
			while( (iWPNidx = fm_find_ent_by_class(iWPNidx, vwpn)) ){
				if( victim == pev(iWPNidx, pev_owner) ){
					cs_set_weapon_ammo(iWPNidx, vammo-drain);
				}
			}
		#endif
		#if MOD==DOD
			ammo = dod_get_user_ammo(id, weapon);
			dod_set_user_ammo(id, weapon, ammo+drain);
			vammo = dod_get_user_ammo(victim, vweapon);
			dod_set_user_ammo(victim, vweapon, vammo-drain);
		#endif
		#if MOD==NS
			new iWPNidx = -1;
			while( (iWPNidx = fm_find_ent_by_class(iWPNidx, wpn)) ){
				if( id == pev(iWPNidx, pev_owner) ){
					ns_set_weap_clip(iWPNidx, ammo+drain);
				}
			}
			iWPNidx = -1;
			while( (iWPNidx = fm_find_ent_by_class(iWPNidx, vwpn)) ){
				if( victim == pev(iWPNidx, pev_owner) ){
					ns_set_weap_clip(iWPNidx, vammo-drain);
				}
			}
		#endif

		sound_hit(id);
		sound_hit(victim);
		MakeLine_Ent(0,id,victim,SPRITE_INDEX[SPR_XPLODE],1,1,5,40,99,150,150,150,100,0);

		return PLUGIN_HANDLED;
	}
	return PLUGIN_CONTINUE;
 }
 public Spore(id, skill, prop)
 {
	if( !PassTest(id, 1) )
		return PLUGIN_CONTINUE;

	new Float:f_aimvec[3];
	get_user_origin(id, origin[id]);
	get_user_origin(id, aim[id], 3);
	if(-50>aim[id][0]-origin[id][0]>50)			//only change it if they are at least that far away
		aim[id][0] += ( ( aim[id][0] - origin[id][0] > 0 ) ? -50 : 50 );
	if(-50>aim[id][1]-origin[id][1]>50)			//only change it if they are at least that far away
		aim[id][1] += ( ( aim[id][1] - origin[id][1] > 0 ) ? -50 : 50 );
	if(-50>aim[id][2]-origin[id][2]>50)			//only change it if they are at least that far away
		aim[id][2] += ( ( aim[id][2] - origin[id][2] > 0 ) ? -50 : 50 );

	IVecFVec(aim[id], f_aimvec);

	new ent = fm_create_entity("info_target");
	set_pev( ent, pev_classname, "pokemod_ent");

	fm_entity_set_model(ent, MODELS[MDL_FUNGUS]);
	set_pev( ent, pev_mins, Float:{-50.0, -50.0, -50.0});
	set_pev( ent, pev_maxs, Float:{50.0, 50.0, 50.0});

	fm_entity_set_origin(ent, f_aimvec);
	set_pev( ent, pev_solid, SOLID_BBOX);
	set_pev( ent, pev_movetype, MOVETYPE_FLY);

	set_pev( ent, pev_rendermode, 5);
	set_pev( ent, pev_renderamt, 255.0);
	set_pev( ent, pev_scale, 1.20);
	set_pev( ent, pev_owner, id);
	fm_set_rendering( ent, kRenderFxGlowShell, 255, 0, 255, kRenderNormal, 20);

	set_pev( ent, pev_takedamage, 1.0);
	set_pev( ent, pev_health, POKE_HP_OFFSET+50.0+PlayersLevel(id));

	new parm[4]
	parm[0] = ent;
	parm[1] = skill;
	parm[2] = SPORE_TIME * 10;
	parm[3] = 1;
	AddLvl(id, parm[2]);

	check_spore(parm)

	return PLUGIN_HANDLED;
 }
 public Stun_Spore(id, skill, prop)
 {
	if( !PassTest(id, 1) )
		return PLUGIN_CONTINUE;

	new Float:f_aimvec[3];
	get_user_origin(id, origin[id]);
	get_user_origin(id, aim[id], 3);
	if(-50>aim[id][0]-origin[id][0]>50)			//only change it if they are at least that far away
		aim[id][0] += ( ( aim[id][0] - origin[id][0] > 0 ) ? -50 : 50 );
	if(-50>aim[id][1]-origin[id][1]>50)			//only change it if they are at least that far away
		aim[id][1] += ( ( aim[id][1] - origin[id][1] > 0 ) ? -50 : 50 );
	if(-50>aim[id][2]-origin[id][2]>50)			//only change it if they are at least that far away
		aim[id][2] += ( ( aim[id][2] - origin[id][2] > 0 ) ? -50 : 50 );

	IVecFVec(aim[id], f_aimvec);

	new ent = fm_create_entity("info_target");
	set_pev( ent, pev_classname, "pokemod_ent");

	fm_entity_set_model(ent, MODELS[MDL_FUNGUS]);
	set_pev( ent, pev_mins, Float:{-50.0, -50.0, -50.0});
	set_pev( ent, pev_maxs, Float:{50.0, 50.0, 50.0});

	fm_entity_set_origin(ent, f_aimvec);
	set_pev( ent, pev_solid, SOLID_BBOX);
	set_pev( ent, pev_movetype, MOVETYPE_FLY);

	set_pev( ent, pev_rendermode, 5);
	set_pev( ent, pev_renderamt, 255.0);
	set_pev( ent, pev_scale, 1.20);
	set_pev( ent, pev_owner, id);

	set_pev( ent, pev_takedamage, 1.0);
	set_pev( ent, pev_health, POKE_HP_OFFSET+50.0+PlayersLevel(id));

	new parm[4]
	parm[0] = ent;
	parm[1] = skill;
	parm[2] = SPORE_TIME * 10;
	parm[3] = 0;
	AddLvl(id, parm[2]);

	check_spore(parm)

	return PLUGIN_HANDLED;
 }
