
 public Thunderbolt(id, skill, prop)
 {
	poke_sound(id, CHAN_VOICE, SND_SPARK)
	new players[MAX_PLAYERS], pnum, aid, damage = PlayersLevel(id, PlayersActive[id])
	poke_get_players(players, pnum, "ai", Team(id))
	for( new i = 0; i < pnum; i++ )
	{
		aid = players[i]
		if(fm_entity_range(id, aid)<THUNDERBOLT_DISTANCE && fm_is_ent_visible(id, aid))
		{
			MakeLine_Ent(0,id,aid,SPRITE_INDEX[SPR_LGTNING],1,1,10,damage*2,5,250,250,10,100,0)

			skilldamage(aid, id, damage, skill)
			poke_print(aid, print_center, "Dostales z Thuderbolt")
			poke_sound(aid, CHAN_VOICE, SND_SPARK)
		}
	}
	return PLUGIN_HANDLED;
 }
 public Thunder(id, skill, prop)
 {
	poke_sound(id, CHAN_VOICE, SND_BIGGUN)

	new origin[3], toporigin[3], temporigin[3], Float:tempdist
	new aid, tid, x, damage = PlayersLevel(id, PlayersActive[id])
	new players[MAX_PLAYERS], pnum, i;
	poke_get_players(players, pnum, "agi", Team(id))

	get_user_origin(id, origin)
	get_user_origin(id, toporigin)
	for( i=0 ; i<5; i++){
		temporigin[0] = toporigin[0] + random_num(-1*damage, damage)
		temporigin[1] = toporigin[1] + random_num(-1*damage, damage)
		temporigin[2] = toporigin[2] + random_num(-1*damage, damage)
		MakeLine(0,origin,temporigin,SPRITE_INDEX[SPR_LGTNING],1,1,10,damage,damage,250,250,10,100,0)
	}

	for( i=0; i < pnum; i++ ){
		aid = players[i]
		tempdist = fm_entity_range(id, aid)
		if(	(tempdist<1000 && (is_user_outside(id) || fm_is_ent_visible(id, aid)))
		||	(tempdist<2000 && fm_is_ent_visible(id, aid)))
		{
			get_user_origin(aid, origin)
			toporigin[0] = origin[0]
			toporigin[1] = origin[1]
			toporigin[2] = origin[2]+1000
			MakeLine(0,origin,toporigin,SPRITE_INDEX[SPR_LGTNING],1,1,10,damage*2,10,250,250,10,100,0)

			if(Health(aid)>1)
				skilldamage(aid, id, damage, skill)
			poke_print(aid, print_center, "Walnal w ciebie Piorun")
			poke_sound(aid, CHAN_VOICE, SND_SPARK)

			for ( x = 0; x < pnum; x++ )
			{
				tid = players[x]
				if(aid==tid)
					continue
				if(!fm_is_ent_visible(id,tid) && fm_is_ent_visible(aid, tid) && fm_entity_range(aid, tid)<500)
				{
					MakeLine_Ent(0,aid,tid,SPRITE_INDEX[SPR_LGTNING],1,1,10,damage,10,250,250,10,100,0)
					if(Health(tid)>5)
						skilldamage(tid, id, damage/4, skill)
					poke_print(tid, print_center, "You were hit by thunder")
					poke_sound(tid, CHAN_VOICE, SND_SPARK)
				}
			}
		}
	}
	return PLUGIN_HANDLED;
 }
 public Thunder_Wave(id, skill, prop)
 {
	new victim = PokeSkillTarget(id);
	if( is_user_alive(victim) && Chance(id) ){
		poke_sound(id, CHAN_VOICE, SND_BIGGUN);
		MakeLine_Ent(0,id,victim,SPRITE_INDEX[SPR_ARBOK],1,1,5,40,99,89,89,89,200,0)
		ApplyStatus( id, victim, STATUS_PARALYZE, THUNDER_WAVE_TIME )
		poke_print( victim, print_center, "Dostales z Thunder Wave")
		return PLUGIN_HANDLED;
	}
	return PLUGIN_CONTINUE;
 }
 public Thundershock(id, skill, prop)
 {
	poke_sound(id, CHAN_VOICE, SND_BIGGUN);
	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 );
	else
		aim[id][2] += 40;

	new level = PlayersLevel(id, PlayersActive[id]) + 20;

	MakeLine(0,origin[id],aim[id],SPRITE_INDEX[SPR_LGTNING],1,1,50,level*2,10,250,250,10,100,0)

	new parm[3];
	parm[0] = id;
	parm[1] = skill;
	parm[2] = level;
	set_task(0.5,"thunder_shock", _, parm, 3, "a", 1+(level/THUNDERSHOCKS))

	return PLUGIN_HANDLED
 }
 public thunder_shock(parm[])
 {
	new id = parm[0], skill = parm[1], level = parm[2];
	if( !is_user_alive(id) )
		return;
	new temporigin[3];
	for( new i=0 ; i<5; i++){
		temporigin[0] = aim[id][0] + random_num(-1*level, level)
		temporigin[1] = aim[id][1] + random_num(-1*level, level)
		temporigin[2] = aim[id][2] + random_num(-1*level, level)
		MakeLine(0,aim[id],temporigin,SPRITE_INDEX[SPR_LGTNING],1,1,10,level,level,250,250,10,100,0)
	}

	poke_sound(id, CHAN_VOICE, SND_SPARK);

	new Float:aimvec[3];
	IVecFVec( aim[id], aimvec );
	skillAoEdamage(id, aimvec, level, 10+level, skill, AOE_NORMAL, _, STATUS_PARALYZE);
 }