Existing user? Sign in
Sign up
Games
Servers
Useful
User
Pass
2FA
[PLUGIN] Alient Boss Mod
Freakz Forum Index
->
Trash Bin
->
CS 2006-2019 (Archived)
->
Resources
Author
Message
3232
EDUTz
[HardcoreAmxxScripter]
Status: Offline
(since 15-08-2021 16:34)
Joined: 27 Dec 2010
Posts: 4306
,
Topics: 244
Location:
Jud. Miserupia, sat Bagadanc
Reputation:
4085
Votes
: 179
Posted: 18-03-2015, 19:58:01
| Translate post to:
... (
Click for more languages
)
Descriere:
Porneste o runda custom (boss mode)
Info:
Nume: Alien Boss Mode
Versiune: 1.0
Autor: @bdul!/EDUTz
*FUNCTIONEAZA DOAR PE ZOMBIE PLAGUE ADVANCED (1.6.1)
*POSIBIL SA APARA BUGURI SAU SA PICE SERVERUL, FOLOSITI-L PE RISCUL VOSTRU!
*RESURSELE LE CAUTATI PE NET(LE GASITI IN SMA)
*Am pus 2 surse(nu mai stiu care dintre ele era mai ok...)
Descarcare:
CLICK
Instalare:
Fisierul bossround.amxx il puneti in addons/amxmodx/plugins
Intrati in fisierul addons->amxmodx->configs->plugins-zplague.ini si adaugati la urma:
Code:
bossround.amxx
Poze:
Pentru pluginuri complicate le fac cu $$ pe paypal/psc. PM
Last edited by
EDUTz
on 18-03-2015, 20:19:02; edited 2 times in total
0
0
Back to top
destroi112
[DEV]
Status: Offline
(since 12-03-2020 22:13)
Joined: 24 May 2014
Posts: 4042
,
Topics: 119
Location:
---------
Reputation:
515.9
Votes
: 118
Posted: 18-03-2015, 20:14:48
| Translate post to:
... (
Click for more languages
)
interesant un plugin asemanator am vazut la diaz dar pt a folosi pluginul iti trebuie si o mapa cu cat mai putine resurse(simpla) so ...
Retired from Amxmodx
0
0
Back to top
EDUTz
[HardcoreAmxxScripter]
Status: Offline
(since 15-08-2021 16:34)
Joined: 27 Dec 2010
Posts: 4306
,
Topics: 244
Location:
Jud. Miserupia, sat Bagadanc
Reputation:
4085
Votes
: 179
Posted: 18-03-2015, 20:38:04
| Translate post to:
... (
Click for more languages
)
Eu am folosit npc-ul creat de el si l-am bagat intr-un mod valabil de zm .. Il foloseam mai demult si era pacat sa nu-l fac public ...
Pentru pluginuri complicate le fac cu $$ pe paypal/psc. PM
0
0
Back to top
AnAcKiNNN12345
[Mentally Stable]
Status: Offline
(since 30-01-2017 13:00)
Joined: 22 Feb 2015
Posts: 230
,
Topics: 42
Location:
Romania
Reputation:
104
Votes
: 4
Posted: 21-04-2015, 11:02:43
| Translate post to:
... (
Click for more languages
)
Salut Edutz ai putea sa imi lasi si mie in PM .sma de la plugin??
#Intr-un sistem corupt, totul e posibil!
0
0
Back to top
destroi112
[DEV]
Status: Offline
(since 12-03-2020 22:13)
Joined: 24 May 2014
Posts: 4042
,
Topics: 119
Location:
---------
Reputation:
515.9
Votes
: 118
Posted: 21-04-2015, 14:42:01
| Translate post to:
... (
Click for more languages
)
Daca ai fii dat click pe download ai fii vazut ca fisierele sunt .sma.
PS:EDUTz ,din cate stiu diaz facuse un astfel de npc dar era bugat (npc -ul omora human din 1 atac si cand murea 1 om mureau toti.).Sunt curios daca are vreun bug sau ai reusit sa le rezolvi pe toate >?
Retired from Amxmodx
0
0
Back to top
-P!C@-
[Simply Normal]
Status: Offline
(since 21-04-2022 19:07)
Joined: 28 May 2012
Posts: 21086
,
Topics: 1601
Location:
Constanta
Reputation:
1870.3
Votes
: 781
Posted: 21-04-2015, 15:48:22
| Translate post to:
... (
Click for more languages
)
Uite sma-urile:
Spoiler:
#include < amxmodx >
#include < amxmisc >
#include < engine >
#include < fakemeta >
#include < hamsandwich >
#include < xs >
#include < zombie_plague_advance >
/****************[ Customizations Section ]***************/
// This is the chance value according to which this game mode will be called
// The higher the value the lesser the chance of calling this game mode
new const g_chance = 89
// This is the access flag required to start the game mode
// through the admin menu. Look in users.ini for more details
new const g_access_flag[] = "u"
// This is the sound which is played when the game mode is triggered
// Add as many as you want [Randomly chosen if more than one]
/*
new const g_play_sounds[][] =
{
"zombie_plague/nemesis1.wav" ,
"zombie_plague/survivor1.wav"
}
*/
// Comment the following line to disable ambience sounds
// Just add two slashes ( // )
//#define AMBIENCE_SOUNDS
#if defined AMBIENCE_SOUNDS
// Ambience Sounds (only .wav and .mp3 formats supported)
// Add as many as you want [Randomly chosen if more than one]
new const g_sound_ambience[][] =
{
"zombie_plague/ambience.wav"
}
// Duration in seconds of each sound
new const Float:g_sound_ambience_duration[] = { 58.0 , 56.0 }
#endif
/****************[ Customizations End....!!! ]***************/
// Variables
new g_gameid, g_maxplayers, g_msg_sync
// Ambience sounds task
#define TASK_AMB 3256
const alien_hp = 50000
const boss_speed = 600
const Float:prepare_time = 5.0
const dmg_attack = 1000
const dmg_ms = 1000
const dmg_sw = 1000
static Float:Origin[3]
static g_Alien
static HPspr
static g_BossTarget
static VictimID
static Float:g_Health
static Ability
new const Resource[][] = {
"models/npc/alien/alien.mdl",
"sprites/blood.spr",
"sprites/bloodspray.spr",
"sprites/npc/hp.spr",
"sprites/shockwave.spr", // 4
"sprites/npc/alien/fluxing.spr" // 5
}
static g_Resource[sizeof Resource]
enum {
IDLE,
WALK,
MS,
ATTACK,
SW
}
new Float:g_fUserDamage[33]
public plugin_init( )
{
// Plugin registeration.
register_plugin( "[ZP] Boss Mode","1.0", "@bdul!/EDUTz" )
// Register some cvars
// Edit these according to your liking
// Get maxplayers
g_maxplayers = get_maxplayers( )
// Hud stuff
g_msg_sync = CreateHudSyncObj()
register_think("AlienBossik", "Think_Boss")
register_think("HP", "Think_HP")
register_touch("AlienBossik", "player", "Touch_Boss")
RegisterHam(Ham_TakeDamage, "info_target", "TakeDamage")
RegisterHam(Ham_TraceAttack, "info_target", "TraceAttack")
}
// Game modes MUST be registered in plugin precache ONLY
public plugin_precache( )
{
for(new i; i <= charsmax(Resource); i++)
g_Resource[i] = precache_model(Resource[i])
// Read the access flag
new access_flag = read_flags( g_access_flag )
//new i
// Precache the play sounds
//for (i = 0; i < sizeof g_play_sounds; i++)
//precache_sound( g_play_sounds[i] )
// Precache the ambience sounds
#if defined AMBIENCE_SOUNDS
new sound[100]
for (i = 0; i < sizeof g_sound_ambience; i++)
{
if (equal(g_sound_ambience[i][strlen(g_sound_ambience[i])-4], ".mp3"))
{
formatex(sound, sizeof sound - 1, "sound/%s", g_sound_ambience[i])
precache_generic( sound )
}
else
{
precache_sound( g_sound_ambience[i] )
}
}
#endif
// Register our game mode
g_gameid = zp_register_game_mode( "Boss Mode", access_flag, g_chance, 0, ZP_DM_NONE )
}
// Player spawn post
public zp_player_spawn_post( id, should_be_zombie )
{
// Check for current mode
if( zp_get_current_mode() == g_gameid )
{
}
}
public zp_round_started_pre( game )
{
// Check if it is our game mode
if( game == g_gameid )
{
static i_alive, id
i_alive = 0
for ( id = 1; id <= g_maxplayers; id++ )
{
if( is_user_alive( id ) )
i_alive++
}
// Check for min players
if( i_alive < 1 )
{
/**
* Note:
* This very necessary, you should return ZP_PLUGIN_HANDLED if
* some conditions required by your game mode are not met
* This will inform the main plugin that you have rejected
* the offer and so the main plugin will allow other game modes
* to be given a chance
*/
return ZP_PLUGIN_HANDLED
}
// Start our new mode
}
// Make the compiler happy =)
return PLUGIN_CONTINUE
}
public zp_round_started( game, id )
{
// Check if it is our game mode
if( game == g_gameid )
{
// Show HUD notice
set_hudmessage(221, 156, 21, -1.0, 0.17, 1, 0.0, 5.0, 1.0, 1.0, -1)
ShowSyncHudMsg(0, g_msg_sync, "Boss Mode !!!")
// Play the starting sound
//client_cmd(0, "spk ^"%s^"", g_play_sounds[ random_num(0, sizeof g_play_sounds -1) ] )
// Remove ambience task affects
remove_task( TASK_AMB )
start_avs_mode( )
// Set task to start ambience sounds
#if defined AMBIENCE_SOUNDS
set_task( 2.0, "start_ambience_sounds", TASK_AMB )
#endif
}
}
public zp_game_mode_selected( gameid, id )
{
// Check if our game mode was called
if( gameid == g_gameid )
return PLUGIN_CONTINUE
// Make the compiler happy again =)
return PLUGIN_CONTINUE
}
// This function contains the whole code behind this game mode
start_avs_mode( )
{
new player = random(get_maxplayers())
if( is_user_connected(player) && is_user_alive(player) )
pev(player, pev_origin, Origin)
set_task(2.2, "spawn")
}
public spawn()
{
g_Alien = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
HPspr = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
engfunc(EngFunc_SetModel, g_Alien, Resource[0])
engfunc(EngFunc_SetSize, g_Alien, { -32.0, -32.0, -36.0 }, { 32.0, 32.0, 96.0 })
engfunc(EngFunc_SetOrigin, g_Alien, Origin)
set_pev(g_Alien, pev_classname, "AlienBossik")
set_pev(g_Alien, pev_solid, SOLID_BBOX)
set_pev(g_Alien, pev_movetype, MOVETYPE_PUSHSTEP)
set_pev(g_Alien, pev_takedamage, DAMAGE_AIM)
set_pev(g_Alien, pev_health, float(alien_hp))
set_pev(g_Alien, pev_deadflag, DEAD_NO)
set_pev(g_Alien, pev_nextthink, get_gametime() + prepare_time)
Ability = IDLE
Anim(g_Alien, 2)
static Float:Origin[3]
pev(g_Alien, pev_origin, Origin)
Origin[2] += 200.0
engfunc(EngFunc_SetOrigin, HPspr, Origin)
engfunc(EngFunc_SetModel, HPspr, Resource[3])
entity_set_float(HPspr, EV_FL_scale, 0.5)
set_pev(HPspr, pev_classname, "HP")
set_pev(HPspr, pev_solid, SOLID_NOT)
set_pev(HPspr, pev_movetype, MOVETYPE_NOCLIP)
set_pev(HPspr, pev_frame, 100.0)
set_pev(HPspr, pev_nextthink, get_gametime() + prepare_time)
}
#if defined AMBIENCE_SOUNDS
public start_ambience_sounds( )
{
// Variables
static amb_sound[64], sound, Float:duration
// Select our ambience sound
sound = random_num( 0, sizeof g_sound_ambience - 1 )
copy( amb_sound, sizeof amb_sound - 1 , g_sound_ambience[ sound ] )
duration = g_sound_ambience_duration[ sound ]
// Check whether it's a wav or mp3, then play it on clients
if ( equal( amb_sound[ strlen( amb_sound ) - 4 ], ".mp3" ) )
client_cmd( 0, "mp3 play ^"sound/%s^"", amb_sound )
else
client_cmd( 0, "spk ^"%s^"", sound )
// Start the ambience sounds
set_task( duration, "start_ambience_sounds", TASK_AMB )
}
public zp_round_ended( winteam )
{
// Stop ambience sounds on round end
remove_task( TASK_AMB )
while((g_Alien = engfunc(EngFunc_FindEntityByString, g_Alien, "classname", "AlienBossik")))
{
if(pev_valid(g_Alien))
{
engfunc(EngFunc_RemoveEntity, g_Alien);
remove_entity(g_Alien)
}
}
while((HPspr = engfunc(EngFunc_FindEntityByString, HPspr, "classname", "HP")))
{
if(pev_valid(HPspr))
{
engfunc(EngFunc_RemoveEntity, HPspr);
remove_entity(HPspr)
}
}
}
#endif
// This function returns the no. of alive players
public RandomAbility(taskid) {
if (Ability != WALK)
return
switch(random(2)) {
case 0: Ability = MS
case 1: Ability = SW
}
}
public client_connect(id){
g_fUserDamage[id] = 0.0
}
public Think_Boss(Ent)
{
if (pev(Ent, pev_deadflag) == DEAD_DYING)
return
static bool:one
switch ( Ability ) {
case IDLE: {
Ability = WALK
set_task(10.0, "RandomAbility", 1337, _, _, "b")
set_pev(Ent, pev_nextthink, get_gametime() + 0.1)
return
}
case WALK: {
static Float:Origin[3], Float:Origin2[3], Float:Vector[3], Float:Angle[3]
if (!is_user_alive(g_BossTarget)) {
g_BossTarget = GetRandomAlive(random_num(1, GetAliveCount()))
set_pev(Ent, pev_nextthink, get_gametime() + 0.1)
return
}
if (one) {
set_pev(Ent, pev_movetype, MOVETYPE_PUSHSTEP)
Anim(Ent, 3)
one = false
}
pev(Ent, pev_origin, Origin)
pev(g_BossTarget, pev_origin, Origin2)
xs_vec_sub(Origin2, Origin, Vector)
vector_to_angle(Vector, Angle)
new Float:num = floatsqroot(float(boss_speed)*float(boss_speed) / (Vector[0]*Vector[0] + Vector[1]*Vector[1] + Vector[2]*Vector[2]))
Vector[0] *= num
Vector[1] *= num
Vector[2] ? (Vector[2] = 0.0) : (Vector[2] *= num)
set_pev(Ent, pev_velocity, Vector)
Angle[0] = 0.0
Angle[2] = 0.0
set_pev(Ent, pev_angles, Angle)
set_pev(Ent, pev_nextthink, get_gametime() + 0.1)
return
}
case ATTACK: {
static num
switch (num) {
case 0: {
Anim(Ent, 6)
num++
set_pev(Ent, pev_nextthink, get_gametime() + 1.0)
return
}
case 1: {
static Float:OriginA[3], Float:OriginA2[3], Float:LenA, Float:Vector[3], Float:Velocity[3]
pev(g_Alien, pev_origin, OriginA)
pev(VictimID, pev_origin, OriginA2)
xs_vec_sub(OriginA2, OriginA, Velocity)
xs_vec_sub(OriginA, OriginA2, Vector)
LenA = xs_vec_len(Vector)
if (LenA <= 170) {
xs_vec_normalize(Velocity, Velocity)
Velocity[2] = 0.5
xs_vec_mul_scalar(Velocity, 1000.0, Velocity)
ExecuteHamB(Ham_TakeDamage, VictimID, 0, VictimID, float(dmg_attack), DMG_BULLET)
ScreenFade(VictimID, 3, {255, 0, 0}, 120)
ScreenShake(VictimID)
set_pev(VictimID, pev_velocity, Velocity)
}
}
}
num = 0
one = true
Ability = WALK
set_pev(Ent, pev_nextthink, get_gametime() + 0.2)
}
case MS: {
static num, Float:Origin[3], Float:Origin2[3], Float:Vector[3], Float:Angle[3]
switch ( num ) {
case 0: {
new MS_Attack = GetRandomAlive(random_num(1, GetAliveCount()))
pev(MS_Attack, pev_origin, Origin)
pev(Ent, pev_origin, Origin2)
xs_vec_sub(Origin, Origin2, Vector)
vector_to_angle(Vector, Angle)
xs_vec_normalize(Vector, Vector)
xs_vec_mul_scalar(Vector, 2000.0, Vector)
Angle[0] = 0.0
Angle[2] = 0.0
Vector[2] = 0.0
set_pev(Ent, pev_angles, Angle)
set_pev(Ent, pev_movetype, MOVETYPE_NONE)
Anim(Ent, 7)
set_pev(Ent, pev_nextthink, get_gametime() + 1.0)
num++
return
}
case 1: {
set_pev(Ent, pev_movetype, MOVETYPE_FLY)
set_pev(Ent, pev_velocity, Vector)
set_pev(Ent, pev_nextthink, get_gametime() + 1.0)
num++
return
}
}
set_pev(Ent, pev_nextthink, get_gametime() + 0.1)
num = 0
Ability = WALK
one = true
return
}
case SW: {
static num, FluxSpr, Float:Origin[3], sw_random
switch ( num ) {
case 0: {
sw_random = random(3)
Anim(Ent, 2)
FluxSpr = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "env_sprite"))
pev(Ent, pev_origin, Origin)
Origin[2] += 70
engfunc(EngFunc_SetOrigin, FluxSpr, Origin)
engfunc(EngFunc_SetModel, FluxSpr, Resource[5])
set_pev(FluxSpr, pev_solid, SOLID_NOT)
set_pev(FluxSpr, pev_movetype, MOVETYPE_NOCLIP)
switch(sw_random) {
case 0: {
set_rendering(FluxSpr, kRenderFxFadeSlow, 255, 0, 0, kRenderTransAdd, 255)
set_rendering(Ent, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 30)
}
case 1: {
set_rendering(FluxSpr, kRenderFxFadeSlow, 255, 255, 0, kRenderTransAdd, 255)
set_rendering(Ent, kRenderFxGlowShell, 255, 255, 0, kRenderNormal, 30)
}
case 2: {
set_rendering(FluxSpr, kRenderFxFadeSlow, 0, 0, 255, kRenderTransAdd, 255)
set_rendering(Ent, kRenderFxGlowShell, 0, 0, 255, kRenderNormal, 30)
}
}
set_pev(FluxSpr, pev_framerate, 5.0)
dllfunc(DLLFunc_Spawn, FluxSpr)
set_pev(Ent, pev_nextthink, get_gametime() + 0.1)
num++
return
}
case 1..10: {
for(new id = 1; id <= get_maxplayers(); id++) {
if (!is_user_alive(id))
continue
static Float:OriginSW[3], Float:OriginSW2[3], Float:Vector[3]
pev(Ent, pev_origin, OriginSW)
pev(id, pev_origin, OriginSW2)
xs_vec_sub(OriginSW, OriginSW2, Vector)
xs_vec_normalize(Vector, Vector)
xs_vec_mul_scalar(Vector, 800.0, Vector)
set_pev(id, pev_velocity, Vector)
set_pev(Ent, pev_nextthink, get_gametime() + 0.2)
num++
return
}
}
case 11: {
engfunc(EngFunc_RemoveEntity, FluxSpr)
Anim(Ent, 5)
set_pev(Ent, pev_nextthink, get_gametime() + 2.2)
num++
return
}
case 12: {
static Float:Orig[3]
pev(Ent, pev_origin, Orig)
set_rendering(Ent)
switch (sw_random) {
case 0: ShockWave(Orig, 5, 35, 1000.0, {255, 0, 0}) // 450
case 1: ShockWave(Orig, 5, 35, 1000.0, {255, 255, 0})
case 2: ShockWave(Orig, 5, 35, 1000.0, {0, 0, 255})
}
for(new id = 1; id <= get_maxplayers(); id++) {
if (!is_user_alive(id))
continue
if (pev(id, pev_flags) & FL_ONGROUND) {
static Float:gOrigin[3], Float:Vec[3], Float:Len
pev(id, pev_origin, gOrigin)
xs_vec_sub(Orig, gOrigin, Vec)
Len = xs_vec_len(Vec)
if (Len <= 450.0) {
switch (sw_random) {
case 0: user_kill(id)
case 1: {
ScreenFade(id, 5, {255, 0, 0}, 120)
ExecuteHamB(Ham_TakeDamage, id, 0, id, float(dmg_sw), DMG_SONIC)
ScreenShake(id)
}
case 2: {
client_cmd(id, "drop")
ScreenShake(id)
}
}
}
}
}
Ability = WALK
one = true
num = 0
set_pev(Ent, pev_nextthink, get_gametime() + 0.2)
return
}
}
}
}
}
public Think_HP(Ent) {
static Float:Origin[3], num
pev(g_Alien, pev_origin, Origin)
Origin[2] += 200.0
set_pev(Ent, pev_origin, Origin)
switch ( num ) {
case 0: {
Anim(g_Alien, 3)
set_pev(g_Alien, pev_takedamage, DAMAGE_YES)
num++
}
case 1: {
static Float:frame
frame = g_Health * 100.0 / float(alien_hp)
if (frame)
set_pev(Ent, pev_frame, frame)
if (pev(g_Alien, pev_deadflag) == DEAD_DYING) {
engfunc(EngFunc_RemoveEntity, Ent)
return
}
}
}
set_pev(Ent, pev_nextthink, get_gametime() + 0.1)
}
public TraceAttack(victim, attacker, Float:damage, Float:direction[3], th, dt) {
static Float:End[3], ClassName[32]
pev(victim, pev_classname, ClassName, charsmax(ClassName))
if (equal(ClassName, "AlienBossik")) {
get_tr2(th, TR_vecEndPos, End)
Blood(End)
}
}
public TakeDamage(victim, weapon, attacker, Float:damage, damagetype) {
static ClassName[32]
pev(victim, pev_classname, ClassName, charsmax(ClassName))
if (equal(ClassName, "AlienBossik")) {
pev(victim, pev_health, g_Health)
g_fUserDamage[attacker] += damage;
if(g_fUserDamage[attacker] >= 600)
{
g_fUserDamage[attacker] -= 600;
zp_set_user_ammo_packs(attacker, zp_get_user_ammo_packs(attacker)+2);
}
if (g_Health <= damage) {
Anim(victim, 1)
set_pev(victim, pev_movetype, MOVETYPE_FLY)
set_pev(victim, pev_solid, SOLID_NOT)
set_pev(victim, pev_velocity, {0.0, 0.0, 0.0})
set_pev(victim, pev_deadflag, DEAD_DYING)
//set_task(4.5, "npc_remove", victim)
//remove_entity(victim)
remove_task(1337)
for(new j = 0; j < get_maxplayers(); j++)
{
if(is_user_alive(j) && is_user_connected(j))
user_kill(j)
}
return HAM_SUPERCEDE
}
}
return HAM_HANDLED
}
/*
public npc_remove(victim)
{
remove_entity(victim)
}
*/
public Touch_Boss(Ent, WorldEnt) {
if (Ability == MS) {
static victim = -1, Float:Origin[3]
pev(Ent, pev_origin, Origin)
while((victim = engfunc(EngFunc_FindEntityInSphere, victim, Origin, 400.0)) != 0) {
if (!is_user_alive(victim))
continue
ExecuteHamB(Ham_TakeDamage, victim, 0, victim, float(dmg_ms), DMG_BULLET)
}
}
if (Ability == WALK) {
Ability = ATTACK
VictimID = WorldEnt
}
}
stock Blood(Float:Orig[3]) {
message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
write_byte(TE_BLOODSPRITE);
engfunc(EngFunc_WriteCoord, Orig[0])
engfunc(EngFunc_WriteCoord, Orig[1])
engfunc(EngFunc_WriteCoord, Orig[2])
write_short(g_Resource[1])
write_short(g_Resource[2])
write_byte(218)
write_byte(random_num(1, 2))
message_end();
}
stock Anim(ent, sequence) {
set_pev(ent, pev_sequence, sequence)
set_pev(ent, pev_animtime, halflife_time())
set_pev(ent, pev_framerate, 1.0)
}
stock ShockWave(Float:Orig[3], Life, Width, Float:Radius, Color[3]) {
engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, Orig, 0)
write_byte(TE_BEAMCYLINDER) // TE id
engfunc(EngFunc_WriteCoord, Orig[0]) // x
engfunc(EngFunc_WriteCoord, Orig[1]) // y
engfunc(EngFunc_WriteCoord, Orig[2]-40.0) // z
engfunc(EngFunc_WriteCoord, Orig[0]) // x axis
engfunc(EngFunc_WriteCoord, Orig[1]) // y axis
engfunc(EngFunc_WriteCoord, Orig[2]+Radius) // z axis
write_short(g_Resource[4]) // sprite
write_byte(0) // startframe
write_byte(0) // framerate
write_byte(Life) // life (4)
write_byte(Width) // width (20)
write_byte(0) // noise
write_byte(Color[0]) // red
write_byte(Color[1]) // green
write_byte(Color[2]) // blue
write_byte(255) // brightness
write_byte(0) // speed
message_end()
}
stock ScreenFade(id, Timer, Colors[3], Alpha) {
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenFade"), _, id);
write_short((1<<12) * Timer)
write_short(1<<12)
write_short(0)
write_byte(Colors[0])
write_byte(Colors[1])
write_byte(Colors[2])
write_byte(Alpha)
message_end()
}
stock ScreenShake(id) {
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenShake"), _, id);
write_short(1<<14)
write_short(1<<12)
write_short(2<<12)
message_end();
}
GetRandomAlive(target_index) { // :3
new iAlive
for (new id = 1; id <= get_maxplayers(); id++) {
if (is_user_alive(id)) iAlive++
if (iAlive == target_index) return id
}
return -1
}
GetAliveCount() { // ^^
new iAlive
for (new id = 1; id <= get_maxplayers(); id++) if (is_user_alive(id)) iAlive++
return iAlive
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
+
Spoiler:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta>
#include <fun>
#include <zombie_plague_advance>
/****************[ Customizations Section ]***************/
// This is the chance value according to which this game mode will be called
// The higher the value the lesser the chance of calling this game mode
new const g_chance = 99
// This is the access flag required to start the game mode
// through the admin menu. Look in users.ini for more details
new const g_access_flag[] = "u"
// This is the sound which is played when the game mode is triggered
// Add as many as you want [Randomly chosen if more than one]
new const g_play_sounds[][] =
{
"zombie_plague/nemesis1.wav" ,
"zombie_plague/survivor1.wav"
}
// Comment the following line to disable ambience sounds
// Just add two slashes ( // )
#define AMBIENCE_SOUNDS
#if defined AMBIENCE_SOUNDS
// Ambience Sounds (only .wav and .mp3 formats supported)
// Add as many as you want [Randomly chosen if more than one]
new const g_sound_ambience[][] =
{
"zombie_plague/ambience.wav"
}
// Duration in seconds of each sound
new const Float:g_sound_ambience_duration[] = { 58.0 , 56.0 }
#endif
/****************[ Customizations End....!!! ]***************/
// Variables
new g_gameid, g_maxplayers, cvar_minplayers, g_msg_sync
// Ambience sounds task
#define TASK_AMB 3256
#define ANIM_DUMMY 0
#define ANIM_DEATH 1
#define ANIM_IDLE 2
#define ANIM_WALK 3
#define ANIM_RUN 4
#define ANIM_SHOCKWAVE 5
#define ANIM_JUSTICESWING 6
#define ANIM_MAHADASH 7
#define ALIEN_HEALTH 100000.0 // Жизнь Босса
//#define ALIEN_BONUS_KILL 5000 // Бонус для убийства Босса
#define ALIEN_ATTACK_DELAY 1.0 // Промежуток между атаками Босса
#define ALIEN_ATTACK_DISTANCE 160.0 // Дистанция для атаки Босса
#define ALIEN_DASH_DISTANCE 200.0 // Дистанция на каторую Босс прыгает
#define ALIEN_JUMP_AFTER_SWING_COUNT 4 // Отсчет между скиллами
#define ALIEN_TASK 231211
#define ALIEN_TASK1 113713
#define ALIEN_TASK2 123714
#define ALIEN_TASK3 133715
#define ALIEN_TASK4 143716
// Agression one - 1-ый уровенить агресси
#define ALIEN_SPEED_AG1 220 // Скорость Босса при 1 агрессии
#define ALIEN_DAMAGE_ATTACK_AG1 100.0 // Урон Босса при 1 агрессии
#define ALIEN_DASH_DAMAGE_AG1 100 // Урон Босса при использование скилла в 1 агрессии
#define ALIEN_SHOCK_SCREEN_RADIUS_AGRES1 800 // Радиус тряски и урона при волне в 1 агрессии
#define ALIEN_SHOCK_SCREEN_DAMAGE_AGRES1 50 // Урон от волны в 1 агрессии
// Agression two - 2-ой уровень агресси когда мень 50 % жизни у алиена
#define ALIEN_SPEED_AG2 260 // Скорость Босса при 2 агрессии
#define ALIEN_DAMAGE_ATTACK_AG2 100.0 // Урон Босса при 2 агрессии
#define ALIEN_DASH_DAMAGE_AG2 150 // Урон Босса при использование скилла в 2 агрессии
#define ALIEN_SHOCK_SCREEN_RADIUS_AGRES2 500 // Радиус тряски и урона при волне в 1 агрессии
#define ALIEN_SHOCK_SCREEN_DAMAGE_AGRES2 200 // Урон от волны в 2 агрессии
#define npc_classname "zs_alien"
#define npc_model "models/npc/alien/alien.mdl" // Модель Босса
#define npc_sprite "sprites/npc/hp.spr" // Спрайт жизни Босса
#define SPRITE_Z 250 // Высота спрайта жизни
enum
{
FM_CS_TEAM_UNASSIGNED = 0,
FM_CS_TEAM_T,
FM_CS_TEAM_CT,
FM_CS_TEAM_SPECTATOR
}
new Float:g_dmg[512]
new Float:g_distance[512]
new Float:g_lastat[512]
new Float:g_atdelay[512]
new g_speed[512]
new g_moves[512]
new g_alive[512]
new g_target[512]
//new g_reward[512]
new g_animrun[512]
new g_exprew[512]
new g_animattack[512]
new g_ability
new g_timer
new g_game_start
new g_can_jump
new g_pBeam
new g_pSprite
new g_jump_count[512]
new bool:start_swing[512]
new bool:start_knock[512]
new bool:g_bAlienLevel
new spr_blood_drop, spr_blood_spray
new g_screenshake
new const UNIT_SECOND = (1<<12)
// HoLLyWooD
#define TASK_CREATE_NPC 123124
#define ALIEN_CREATE_TASK 21341
new Float:g_fUserDamage[33]
new g_iRandomSkills = ALIEN_JUMP_AFTER_SWING_COUNT;
new bool:g_bChangeLevel = false;
// Command for changelevel
new const g_sVoteCommand[] = "amx_map de_cityrush";
new msgID_deathMsg, msgID_sayText;
new g_szName[33][32]
public plugin_init( )
{
// Plugin registeration.
register_plugin( "[ZP] Boss Mode","1.0", "EDY" )
// Register some cvars
// Edit these according to your liking
// Get maxplayers
// Hud stuff
g_msg_sync = CreateHudSyncObj()
RegisterHam(Ham_Killed, "info_target", "npc_killed");
RegisterHam(Ham_Killed, "player", "player_killed");
RegisterHam(Ham_Think, "info_target", "npc_think");
RegisterHam(Ham_TraceAttack, "info_target", "npc_traceattack");
RegisterHam(Ham_TakeDamage, "info_target", "npc_takedamage")
register_forward(FM_PlayerPreThink, "fw_PlayerPreThink");
register_forward(FM_UpdateClientData, "fwd_UpdateClientData", 1);
register_logevent("round_end", 2, "1=Round_End")
register_event("DeathMsg", "event_death", "ae")
g_screenshake = get_user_msgid("ScreenShake")
g_maxplayers = get_maxplayers()
g_pSprite = create_entity("info_target");
entity_set_model(g_pSprite, npc_sprite);
entity_set_int(g_pSprite, EV_INT_rendermode, kRenderTransTexture);
entity_set_float(g_pSprite, EV_FL_renderamt, 0.0);
msgID_deathMsg = get_user_msgid("DeathMsg");
msgID_sayText = get_user_msgid("SayText");
register_message(msgID_deathMsg, "msg_deathMsg")
}
// Game modes MUST be registered in plugin precache ONLY
public plugin_precache( )
{
precache_model("models/npc/alien/alien.mdl")
precache_model("sprites/npc/hp.spr")
new i;
spr_blood_drop = precache_model("sprites/blood.spr")
spr_blood_spray = precache_model("sprites/bloodspray.spr")
g_pBeam = precache_model( "sprites/shockwave.spr" )
// Read the access flag
new access_flag = read_flags( g_access_flag )
// Precache the play sounds
for (i = 0; i < sizeof g_play_sounds; i++)
precache_sound( g_play_sounds[i] )
// Precache the ambience sounds
#if defined AMBIENCE_SOUNDS
new sound[100]
for (i = 0; i < sizeof g_sound_ambience; i++)
{
if (equal(g_sound_ambience[i][strlen(g_sound_ambience[i])-4], ".mp3"))
{
formatex(sound, sizeof sound - 1, "sound/%s", g_sound_ambience[i])
precache_generic( sound )
}
else
{
precache_sound( g_sound_ambience[i] )
}
}
#endif
// Register our game mode
g_gameid = zp_register_game_mode( "Boss Mode", access_flag, g_chance, 0, ZP_DM_BALANCE )
}
// Player spawn post
public zp_player_spawn_post( id, should_be_zombie )
{
// Check for current mode
if( zp_get_current_mode() == g_gameid )
{
}
}
public zp_round_started_pre( game )
{
// Check if it is our game mode
if( game == g_gameid )
{
// Check for min players
if( fn_get_alive_players() < get_pcvar_num(cvar_minplayers) )
{
/**
* Note:
* This very necessary, you should return ZP_PLUGIN_HANDLED if
* some conditions required by your game mode are not met
* This will inform the main plugin that you have rejected
* the offer and so the main plugin will allow other game modes
* to be given a chance
*/
return ZP_PLUGIN_HANDLED
}
// Start our new mode
}
// Make the compiler happy =)
return PLUGIN_CONTINUE
}
public zp_round_started( game, id )
{
// Check if it is our game mode
if( game == g_gameid )
{
// Show HUD notice
set_hudmessage(221, 156, 21, -1.0, 0.17, 1, 0.0, 5.0, 1.0, 1.0, -1)
ShowSyncHudMsg(0, g_msg_sync, "Boss Mode !!!")
// Play the starting sound
client_cmd(0, "spk ^"%s^"", g_play_sounds[ random_num(0, sizeof g_play_sounds -1) ] )
// Remove ambience task affects
remove_task( TASK_AMB )
// Set task to start ambience sounds
#if defined AMBIENCE_SOUNDS
set_task( 2.0, "start_ambience_sounds", TASK_AMB )
#endif
}
}
public zp_game_mode_selected( gameid, id )
{
// Check if our game mode was called
if( gameid == g_gameid )
set_task(1.0, "begin_create_npc", TASK_CREATE_NPC);
// Make the compiler happy again =)
return PLUGIN_CONTINUE
}
#if defined AMBIENCE_SOUNDS
public start_ambience_sounds( )
{
// Variables
static amb_sound[64], sound, Float:duration
// Select our ambience sound
sound = random_num( 0, sizeof g_sound_ambience - 1 )
copy( amb_sound, sizeof amb_sound - 1 , g_sound_ambience[ sound ] )
duration = g_sound_ambience_duration[ sound ]
// Check whether it's a wav or mp3, then play it on clients
if ( equal( amb_sound[ strlen( amb_sound ) - 4 ], ".mp3" ) )
client_cmd( 0, "mp3 play ^"sound/%s^"", amb_sound )
else
client_cmd( 0, "spk ^"%s^"", sound )
// Start the ambience sounds
set_task( duration, "start_ambience_sounds", TASK_AMB )
}
public zp_round_ended( winteam )
{
// Stop ambience sounds on round end
remove_task( TASK_AMB )
}
#endif
// This function returns the no. of alive players
fn_get_alive_players( )
{
static i_alive, id
i_alive = 0
for ( id = 1; id <= g_maxplayers; id++ )
{
if( is_user_alive( id ) )
i_alive++
}
return i_alive;
}
public begin_create_npc(){
spawn_alien();
}
public client_connect(id){
g_fUserDamage[id] = 0.0
}
public spawn_alien()
{
set_task(1.0, "count_start", ALIEN_TASK)
g_timer = 15 //26
set_task(16.0, "create_alien", ALIEN_CREATE_TASK);
}
public create_alien()
{
new Float:origin[3];
// Origins for center map
origin[0] = -27.0
origin[0] = 24.0
origin[2] = 460.0
origin[1] += 50.0
new ent = npc_alien_spawn(1, 1);
set_pev(ent, pev_origin, origin);
start_swing[ent] = false
start_knock[ent] = false
g_ability = false
g_game_start = false
g_jump_count[ent] = 0
origin[2] += SPRITE_Z;
entity_set_origin(g_pSprite, origin);
entity_set_int(g_pSprite, EV_INT_rendermode, kRenderNormal);
entity_set_float(g_pSprite, EV_FL_renderamt, 16.0);
entity_set_float(g_pSprite, EV_FL_frame, 100.0);
g_game_start = true;
}
public npc_alien_spawn(anim_run, exprew)
{
new ent = create_entity("info_target");
if(!ent) return 0;
entity_set_string(ent, EV_SZ_classname, npc_classname);
entity_set_model(ent, npc_model);
entity_set_int(ent, EV_INT_iuser4, 0);
entity_set_int(ent, EV_INT_solid, SOLID_BBOX);
entity_set_int(ent, EV_INT_movetype, MOVETYPE_PUSHSTEP);
entity_set_float(ent, EV_FL_takedamage, 1.0);
entity_set_float(ent, EV_FL_gravity, 1.0);
entity_set_float(ent, EV_FL_health, ALIEN_HEALTH);
entity_set_float(ent, EV_FL_animtime, get_gametime());
entity_set_float(ent, EV_FL_nextthink, get_gametime() + 1.0)
Util_PlayAnimation(ent, ANIM_SHOCKWAVE);
new Float: maxs[3] = { 16.0, 16.0, 60.0 }
new Float: mins[3] = {-16.0, -16.0, -36.0}
entity_set_size(ent, mins, maxs)
g_alive[ent] = 1
g_dmg[ent] = ALIEN_DAMAGE_ATTACK_AG1
g_animrun[ent] = ANIM_RUN
//g_reward[ent] = ALIEN_BONUS_KILL
g_speed[ent] = ALIEN_SPEED_AG1
g_distance[ent] = ALIEN_ATTACK_DISTANCE
g_atdelay[ent] = ALIEN_ATTACK_DELAY
g_lastat[ent] = 0.0
g_exprew[ent] = exprew
g_target[ent] = find_closes_enemy(ent)
set_task(5.0, "update_target", ent)
return ent;
}
public npc_think(ent)
{
if(!is_valid_ent(ent))
return;
static className[32], animation;
animation = 0;
entity_get_string(ent, EV_SZ_classname, className, charsmax(className))
if(!equali(className, npc_classname))
return;
if (!g_bAlienLevel)
if (entity_get_float(ent, EV_FL_health) <= (ALIEN_HEALTH / 2.0))
{
g_bAlienLevel = true;
g_speed[ent] = ALIEN_SPEED_AG2;
g_dmg[ent] = ALIEN_DAMAGE_ATTACK_AG2;
}
if(g_alive[ent])
{
new Float:vecOrigin[3];
entity_get_vector(ent, EV_VEC_origin, vecOrigin);
vecOrigin[2] += SPRITE_Z;
entity_set_origin(g_pSprite, vecOrigin);
if(g_game_start)
{
new Float:velocity[3]
pev(ent,pev_velocity,velocity)
velocity[0] += velocity[1] + velocity[2]
if(!is_user_alive(g_target[ent]))
g_target[ent] = find_closes_enemy(ent)
new Float:angle[3], Float:zmaim[3]
pev(g_target[ent], pev_origin, zmaim)
aim_at_origin(ent, zmaim, angle)
angle[0] = 0.0
entity_set_vector(ent, EV_VEC_angles, angle)
if(g_target[ent])
{
new Float:origins[3]
pev(ent, pev_origin, origins)
new Float:flDistance = get_distance_f(origins, zmaim)
if(flDistance> 170.0)
{
if(g_moves[ent])
{
zmaim[0] += random_num(1, -1) * 80.0
zmaim[1] += random_num(1, -1) * 80.0
g_moves[ent] -= 1
}
else if(!g_moves[ent] && random_num(1, 5) == 1)
g_moves[ent] = 20
}
if(flDistance <= ALIEN_ATTACK_DISTANCE) g_moves[ent] = 0
if(flDistance <= g_distance[ent] && get_gametime() - g_lastat[ent] > g_atdelay[ent])
{
if(!start_swing[ent] && !start_knock[ent])
{
g_lastat[ent] = get_gametime()
new anim = ANIM_JUSTICESWING
Util_PlayAnimation(ent, ANIM_IDLE)
Util_PlayAnimation(ent, anim)
ExecuteHamB(Ham_TakeDamage, g_target[ent] , 0, 0, g_dmg[ent], DMG_BULLET);
set_task(2.0, "reset_swing", ent + ALIEN_TASK3)
start_swing[ent] = true
g_animattack[ent] = anim
if(g_jump_count[ent] < g_iRandomSkills)
g_jump_count[ent]++
}
}
else
{
new Float:frames
if(g_animattack[ent] == ANIM_JUSTICESWING) frames = 1.5
if(get_gametime() - g_lastat[ent] > frames)
{
if(flDistance <= g_distance[ent])
Util_PlayAnimation(ent, ANIM_IDLE)
else
{
if(g_jump_count[ent] == g_iRandomSkills && flDistance <= 400.0)
{
// change skill delay
g_iRandomSkills = random_num(2,4);
if(!task_exists(ent + ALIEN_TASK2) && !task_exists(ent + ALIEN_TASK1))
{
new task_args[4]
task_args[0] = ent
task_args[1] = floatround(zmaim[0]*100000, floatround_floor)
task_args[2] = floatround(zmaim[1]*100000, floatround_floor)
task_args[3] = floatround(zmaim[2]*100000, floatround_floor)
if(!g_ability)
{
g_ability = true
Util_PlayAnimation(ent, ANIM_MAHADASH)
set_task(0.8, "go_jump", ent + ALIEN_TASK1, task_args, 4)
animation = 1;
}
else
{
if (entity_get_float(ent, EV_FL_health) > (ALIEN_HEALTH / 2))
{
server_print("--------- 1");
Util_PlayAnimation(ent, ANIM_SHOCKWAVE)
start_knock[ent] = true
set_task(2.1, "go_knock_agres1", ent + ALIEN_TASK1, task_args, 4)
}
else if (entity_get_float(ent, EV_FL_health) <= (ALIEN_HEALTH / 2))
{
server_print("--------- 2");
Util_PlayAnimation(ent, ANIM_SHOCKWAVE)
start_knock[ent] = true
set_task(2.1, "go_knock_agres2", ent + ALIEN_TASK1, task_args, 4)
}
animation = 2;
}
}
}
else
{
ent_move_to(ent, zmaim, g_speed[ent])
Util_PlayAnimation(ent, g_animrun[ent])
}
}
}
}
}
if(!g_target[ent]) Util_PlayAnimation(ent, ANIM_IDLE)
}
else if(g_can_jump)
Util_PlayAnimation(ent, ANIM_IDLE)
else
Util_PlayAnimation(ent, ANIM_IDLE)
if(animation == 1)
entity_set_float(ent, EV_FL_nextthink, get_gametime() + 0.8);
else if(animation == 2)
entity_set_float(ent, EV_FL_nextthink, get_gametime() + 2.1);
else
entity_set_float(ent, EV_FL_nextthink, get_gametime() + 0.01);
}
}
public check_dash_damage(ent, id)
{
ent = ent - ALIEN_TASK4
for(new i = 0; i < g_maxplayers; i++)
{
if(is_user_alive(i))
{
new Float:range_distance = entity_range(ent, i)
new health = get_user_health(i)
if(ALIEN_DASH_DISTANCE < floatround(range_distance) < ALIEN_ATTACK_DISTANCE)
{
if (g_bAlienLevel)
{
if(health - ALIEN_DASH_DAMAGE_AG2 > 0)
set_user_health(i, health - ALIEN_DASH_DAMAGE_AG2)
else
{
user_silentkill(i)
message_begin(MSG_ALL, get_user_msgid("DeathMsg"))
write_byte(ent)
write_byte(i)
write_byte(0)
write_string("Boss Alien")
message_end()
}
}
else
{
if(health - ALIEN_DASH_DAMAGE_AG1 > 0)
set_user_health(i, health - ALIEN_DASH_DAMAGE_AG1)
else
{
user_silentkill(i)
message_begin(MSG_ALL, get_user_msgid("DeathMsg"))
write_byte(ent)
write_byte(i)
write_byte(0)
write_string("Boss Alien")
message_end()
}
}
}
}
}
}
public go_knock_agres1(args[], id)
{
new ent = args[0]
new Float:origin[3]
pev(ent,pev_origin,origin)
message_begin(MSG_BROADCAST, SVC_TEMPENTITY );
write_byte(TE_BEAMCYLINDER)
write_coord(floatround(origin[0]))
write_coord(floatround(origin[1]))
write_coord(floatround(origin[2])-16)
write_coord(floatround(origin[0]))
write_coord(floatround(origin[1]))
write_coord(floatround(0.0))
write_short(g_pBeam) // sprite
write_byte(0) // startframe
write_byte(0) // framerate
write_byte(25) // life
write_byte(60) // width
write_byte(0) // noise
write_byte(255) // red
write_byte(255) // green
write_byte(0) // blue
write_byte(200) // brightness
write_byte(0) // speed
message_end()
set_task(1.0, "reset_knock", ent + ALIEN_TASK2)
static Float:flOrigin[3] , Float:flDistance , Float:flSpeed
for(new iVictim=1;iVictim <= 32;iVictim++)
{
new health = get_user_health(iVictim)
if(is_user_connected(iVictim) && is_user_alive(iVictim))
{
pev(iVictim, pev_origin, flOrigin)
flDistance = get_distance_f ( origin, flOrigin )
if(flDistance <= ALIEN_SHOCK_SCREEN_RADIUS_AGRES1)
{
ScreenShake(iVictim)
flSpeed = 1400.0
static Float:flNewSpeed
flNewSpeed = flSpeed * ( 1.0 - ( flDistance / 1000.0 ) )
set_user_health(iVictim, health - ALIEN_SHOCK_SCREEN_DAMAGE_AGRES1)
static Float:flVelocity [ 3 ]
get_speed_vector ( origin, flOrigin, flNewSpeed, flVelocity )
set_pev ( iVictim, pev_velocity,flVelocity )
}
}
}
}
public go_knock_agres2(args[], id)
{
new ent = args[0]
new Float:origin[3]
pev(ent,pev_origin,origin)
message_begin(MSG_BROADCAST, SVC_TEMPENTITY );
write_byte(TE_BEAMCYLINDER)
write_coord(floatround(origin[0]))
write_coord(floatround(origin[1]))
write_coord(floatround(origin[2])-16)
write_coord(floatround(origin[0]))
write_coord(floatround(origin[1]))
write_coord(floatround(0.0))
write_short(g_pBeam) // sprite
write_byte(0) // startframe
write_byte(0) // framerate
write_byte(10) // life
write_byte(60) // width
write_byte(0) // noise
write_byte(250) // red
write_byte(0) // green
write_byte(0) // blue
write_byte(200) // brightness
write_byte(0) // speed
message_end()
set_task(1.0, "reset_knock", ent + ALIEN_TASK2)
static Float:flOrigin[3] , Float:flDistance , Float:flSpeed
for(new iVictim=1;iVictim <= 32;iVictim++)
{
new health = get_user_health(iVictim)
if(is_user_connected(iVictim) && is_user_alive(iVictim))
{
pev(iVictim, pev_origin, flOrigin)
flDistance = get_distance_f ( origin, flOrigin )
if(flDistance <= ALIEN_SHOCK_SCREEN_RADIUS_AGRES2)
{
ScreenShake(iVictim)
flSpeed = 1400.0
static Float:flNewSpeed
flNewSpeed = flSpeed * ( 1.0 - ( flDistance / 1000.0 ) )
set_user_health(iVictim, health - ALIEN_SHOCK_SCREEN_DAMAGE_AGRES2)
static Float:flVelocity [ 3 ]
get_speed_vector ( origin, flOrigin, flNewSpeed, flVelocity )
set_pev ( iVictim, pev_velocity,flVelocity )
}
}
}
}
public ScreenShake(id)
{
if(!is_user_alive(id))
return;
message_begin(MSG_ONE_UNRELIABLE, g_screenshake, _, id)
write_short(UNIT_SECOND*7) // amplitude
write_short(UNIT_SECOND*5) // duration
write_short(UNIT_SECOND*15) // frequency
message_end()
}
public reset_knock(ent)
{
ent = ent - ALIEN_TASK2
start_knock[ent] = false
g_ability = false
g_jump_count[ent] = 0
}
public go_jump(args[])
{
new ent = args[0]
new Float:zmaim[3]
zmaim[0]=float(args[1]/100000)
zmaim[1]=float(args[2]/100000)
zmaim[2]=float(args[3]/100000)
ent_jump_to(ent, zmaim, 1700)
g_can_jump = true
set_task(0.6, "check_dash_damage", ent + ALIEN_TASK4)
set_task(1.4, "reset_jump", ent + ALIEN_TASK2)
}
public reset_swing(ent)
{
ent = ent - ALIEN_TASK3
start_swing[ent] = false
}
public reset_jump(ent)
{
ent = ent - ALIEN_TASK2
g_jump_count[ent] = 0
set_task(0.5, "reset_time", ent + 55555)
}
public reset_time()
g_can_jump = false
public zp_user_infected_pre(id, inflector, nemesis){
zp_disinfect_user(id, 1);
return ZP_PLUGIN_HANDLED;
}
public zp_user_infect_attempt(id, inflector, nemesis){
zp_disinfect_user(id, 1);
return ZP_PLUGIN_HANDLED;
}
public npc_takedamage(ent, inflictor, attacker, Float:damage, damage_type)
{
if(!is_user_alive(attacker) || !is_valid_ent(ent))
return;
new className[32];
entity_get_string(ent, EV_SZ_classname, className, charsmax(className))
if(!equali(className, npc_classname) || !g_alive[ent])
return;
g_fUserDamage[attacker] += damage;
//client_print(attacker, print_center, "%f" , g_fUserDamage[attacker]);
if(g_fUserDamage[attacker] >= 2000){
g_fUserDamage[attacker] -= 2000;
zp_set_user_ammo_packs(attacker, zp_get_user_ammo_packs(attacker)+1);
}
entity_set_float(g_pSprite, EV_FL_frame, entity_get_float(ent, EV_FL_health) / (ALIEN_HEALTH / 100.0));
}
public fw_PlayerPreThink(id)
{
if(cs_get_user_team(id) == CS_TEAM_T)
cs_set_user_team(id, CS_TEAM_CT)
}
public force_team(id)
{
engclient_cmd(id, "jointeam", "2", "3")
}
public npc_traceattack(ent, attacker, Float: damage, Float: direction[3], trace, damageBits)
{
if(!is_valid_ent(ent) || !g_alive[ent])
return;
new className[32];
entity_get_string(ent, EV_SZ_classname, className, charsmax(className))
if(!equali(className, npc_classname) || !g_alive[ent])
return;
new Float: end[3]
get_tr2(trace, TR_vecEndPos, end);
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_BLOODSPRITE)
engfunc(EngFunc_WriteCoord, end[0])
engfunc(EngFunc_WriteCoord, end[1])
engfunc(EngFunc_WriteCoord, end[2])
write_short(spr_blood_spray)
write_short(spr_blood_drop)
write_byte(247)
write_byte(random_num(5, 10))
message_end()
}
public player_killed(ent, attacker)
{
for(new id=1;id<g_maxplayers;id++)
{
if(is_user_alive(id))
return;
}
begin_changelevel();
client_print(0, print_chat, "Все люди умерли! Смена карты началась!");
}
public npc_killed(ent, attacker)
{
new className[32];
entity_get_string(ent, EV_SZ_classname, className, charsmax(className))
if(!equali(className, npc_classname) || !g_alive[ent])
return HAM_IGNORED;
g_alive[ent] = 0
Util_PlayAnimation(ent, ANIM_DEATH);
remove_task(ent)
set_pev(ent, pev_solid, SOLID_NOT)
set_task(4.5, "npc_remove", ent)
entity_set_int(ent, EV_INT_iuser4, 1);
//cs_set_user_money(attacker, cs_get_user_money(attacker) + g_reward[ent])
zp_set_user_ammo_packs(attacker, zp_get_user_ammo_packs(attacker) + random_num(40,60));
entity_set_int(g_pSprite, EV_INT_rendermode, kRenderTransTexture);
entity_set_float(g_pSprite, EV_FL_renderamt, 0.0);
begin_changelevel();
client_print(0, print_chat, "Босс умер! Смена карты началась!");
return HAM_SUPERCEDE;
}
public round_end()
{
remove_task(ALIEN_TASK)
remove_task(ALIEN_TASK1)
remove_task(ALIEN_TASK2)
remove_task(ALIEN_TASK3)
remove_task(ALIEN_TASK4)
g_game_start = false
begin_changelevel();
}
public event_death(id)
{
static ent = -1;
while ((ent = engfunc(EngFunc_FindEntityByString, ent, "classname", npc_classname)) != 0)
{
if(g_target[ent] == id)
g_target[ent] = find_closes_enemy(ent)
}
client_cmd(id, "stopsound")
new iVictim = read_data(2)
new iKiller = read_data(1)
new iHS = read_data(3)
new szWeapon[24]
read_data(4, szWeapon, 23)
if(!is_user_connected(iVictim))
{
do_deathmsg(iKiller, iVictim, iHS, szWeapon)
return PLUGIN_CONTINUE
}
if(!is_user_connected(iKiller) && iKiller != ent)
{
do_deathmsg(iKiller, iVictim, iHS, szWeapon)
return PLUGIN_CONTINUE
}
if(iKiller != iVictim && iKiller == ent)
{
new iNewKiller
for(new i = 1; i < g_maxplayers; i++){
if(is_user_connected(i) && i != iVictim && !is_user_admin(id))
{
iNewKiller = i;
break;
}
}
if(!iNewKiller || iNewKiller == iKiller)
{
do_deathmsg(iVictim, iVictim, iHS, szWeapon)
return PLUGIN_HANDLED;
}
new szName[32];
get_user_name(iNewKiller, szName, 31)
g_szName[iNewKiller] = szName
set_msg_block(msgID_sayText, BLOCK_ONCE);
set_user_info(iNewKiller, "name", "ALIEN BOSS");
new args[4]
args[0] = iVictim
args[1] = iNewKiller
args[2] = iHS
set_task(0.01, "player_diePost", 0, args, 3)
}
else
{
do_deathmsg(iVictim, iVictim, iHS, szWeapon)
}
return PLUGIN_CONTINUE;
}
public player_diePost(arg[])
{
new szWeapon[24] = "allien_boss_attack";
new iKiller = arg[1]
new CsTeams:tempteam = cs_get_user_team(iKiller);
cs_set_user_team(iKiller, CS_TEAM_T);
do_deathmsg(iKiller, arg[0], arg[2], szWeapon)
cs_set_user_team(iKiller, tempteam);
set_msg_block(msgID_sayText, BLOCK_ONCE)
set_user_info(iKiller, "name", g_szName[iKiller])
return PLUGIN_CONTINUE
}
public npc_remove(ent)
{
remove_task(ALIEN_TASK)
remove_task(ALIEN_TASK1)
remove_task(ALIEN_TASK2)
remove_task(ALIEN_TASK3)
remove_task(ALIEN_TASK4)
remove_entity(ent)
remove_task(ent)
g_jump_count[ent] = 0
g_game_start = false
}
public count_start(ent)
{
g_timer = g_timer - 1
if(g_timer > 0)
client_print(0, print_center, "Игра начнётся через %d секунд.", g_timer)
if(g_timer < 11)
client_cmd(0, "spk zombie_plague/vox/%d", g_timer)
if(g_timer >= 0)
set_task(1.0, "count_start", ALIEN_TASK)
if(g_timer == 0)
{
client_print(0, print_center, "Alien Boss появился убейте его!")
g_game_start = true
}
}
public update_target(ent)
{
if(!is_valid_ent(ent))
return;
g_target[ent] = find_closes_enemy(ent)
set_task(5.0, "update_target", ent)
}
public msg_deathMsg()
return PLUGIN_HANDLED;
public begin_changelevel(){
g_bChangeLevel = true;
new ent;
if((ent = engfunc(EngFunc_FindEntityByString, ent, "classname", npc_classname)) != 0)
npc_remove(ent);
}
public fwd_UpdateClientData(id, weapons, cd)
{
if(id < 0 || id > g_maxplayers)
return FMRES_IGNORED
if(g_bChangeLevel)
{
set_cd(cd, CD_flNextAttack, 0.5)
set_cd(cd, CD_MaxSpeed, 1.0)
return FMRES_HANDLED
}
return FMRES_IGNORED
}
stock do_deathmsg(iKiller, iVictim, iHS, const szWeapon[])
{
message_begin(MSG_ALL, msgID_deathMsg)
write_byte(iKiller)
write_byte(iVictim)
write_byte(iHS)
write_string(szWeapon)
message_end()
}
stock find_closes_enemy(ent)
{
new enemy, Float:dist, Float:distmin, Float:origin[3], Float:originT[3]
pev(ent, pev_origin, origin)
origin[2] += 120.0
for(new id=1; id<=32; id++)
{
if (!is_user_alive(id)) continue;
dist = entity_range(ent, id)
pev(id, pev_origin, originT)
if ((!distmin || dist <= distmin))
{
distmin = dist
enemy = id
}
}
return enemy
}
stock ent_move_to(ent, Float:target[3], speed)
{
static Float:vec[3]
aim_at_origin(ent, target, vec)
engfunc(EngFunc_MakeVectors, vec)
global_get(glb_v_forward, vec)
vec[0] *= speed
vec[1] *= speed
vec[2] *= speed * 0.1
set_pev(ent, pev_velocity, vec)
new Float:angle[3]
aim_at_origin(ent, target, angle)
angle[0] = 0.0
entity_set_vector(ent, EV_VEC_angles, angle)
}
stock ent_jump_to(ent, Float:target[3], speed)
{
static Float:vec[3]
aim_at_origin(ent, target, vec)
engfunc(EngFunc_MakeVectors, vec)
global_get(glb_v_forward, vec)
vec[0] *= speed
vec[1] *= speed
vec[2] *= speed * 0.1
set_pev(ent, pev_velocity, vec)
new Float:angle[3]
aim_at_origin(ent, target, angle)
angle[0] = 0.0
entity_set_vector(ent, EV_VEC_angles, angle)
}
stock aim_at_origin(id, Float:target[3], Float:angles[3])
{
static Float:vec[3]
pev(id, pev_origin, vec)
vec[0] = target[0] - vec[0]
vec[1] = target[1] - vec[1]
vec[2] = target[2] - vec[2]
engfunc(EngFunc_VecToAngles, vec, angles)
angles[0] *= -1.0, angles[2] = 0.0
}
stock get_speed_vector(const Float:origin1[3], const Float:origin2[3], Float:speed, Float:new_velocity[3])
{
new_velocity[0] = origin2[0] - origin1[0]
new_velocity[1] = origin2[1] - origin1[1]
new_velocity[2] = origin2[2] - origin1[2]
new Float:num = floatsqroot(speed*speed / (new_velocity[0]*new_velocity[0] + new_velocity[1]*new_velocity[1] + new_velocity[2]*new_velocity[2]))
new_velocity[0] *= num
new_velocity[1] *= num
new_velocity[2] *= num
return 1;
}
stock Util_PlayAnimation(index, sequence, Float: framerate = 1.0)
{
if(entity_get_int(index, EV_INT_sequence) == sequence) return;
entity_set_float(index, EV_FL_animtime, get_gametime());
entity_set_float(index, EV_FL_framerate, framerate);
entity_set_float(index, EV_FL_frame, 0.0);
entity_set_int(index, EV_INT_sequence, sequence);
}
stock bool:is_hull_vacant(const Float:origin[3], hull,id)
{
static tr
engfunc(EngFunc_TraceHull, origin, origin, 0, hull, id, tr)
if (!get_tr2(tr, TR_StartSolid) || !get_tr2(tr, TR_AllSolid))
return true
return false
}
stock fm_set_user_health(id, health)
{
(health > 0) ? set_pev(id, pev_health, float(health)) : dllfunc(DLLFunc_ClientKill, id);
}
// Босс скачан с сайта Zombie-Mod.ru
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
0
0
Back to top
EDUTz
[HardcoreAmxxScripter]
Status: Offline
(since 15-08-2021 16:34)
Joined: 27 Dec 2010
Posts: 4306
,
Topics: 244
Location:
Jud. Miserupia, sat Bagadanc
Reputation:
4085
Votes
: 179
Posted: 21-04-2015, 15:59:59
| Translate post to:
... (
Click for more languages
)
destroi112 wrote:
Daca ai fii dat click pe download ai fii vazut ca fisierele sunt .sma.
PS:EDUTz ,din cate stiu diaz facuse un astfel de npc dar era bugat (npc -ul omora human din 1 atac si cand murea 1 om mureau toti.).Sunt curios daca are vreun bug sau ai reusit sa le rezolvi pe toate >?
Tu ai impresia ca eu pun panarame de pluginuri aici ? Singurul neajuns este cand moare npc-ul ca nu se termina runda, dar si asta se poate face (si am uitat sa o fac eu cand am facut uploadul) sa le dea kill la TOTI .. for i = 1 i<=get_maxplayers(), i++ killlllllllllll!!!!!!!!!!!!!! si gata runda .... ma rog ... dar pluginul nu are probleme in ce zici tu ... are alte probleme ceva mai diferite .. spre exemplu daca apare de 2 ori pe harta a doua oara nu dispare cand moare ... e o problema ... de aia eu am sugerat sa fie bagat doar o data pe harta, o sansa mai mica sa intre, ca sa fie evitate erorile. Nu am stat sa intru sa-l refac complet ca e deja f mare si nu avea sens. Asa cum l-am uploadat aici, asa l-am tinut si eu pe serverul meu cu succes, fara prea mari probleme.
Pentru pluginuri complicate le fac cu $$ pe paypal/psc. PM
0
0
Back to top
destroi112
[DEV]
Status: Offline
(since 12-03-2020 22:13)
Joined: 24 May 2014
Posts: 4042
,
Topics: 119
Location:
---------
Reputation:
515.9
Votes
: 118
Posted: 21-04-2015, 16:05:13
| Translate post to:
... (
Click for more languages
)
Sau poti folosi round_terminator.inc iar atunci cand moare monstrul reincepe harta oricum sunt multe solutii in fixarea acelui bug
.
Retired from Amxmodx
0
0
Back to top
EDUTz
[HardcoreAmxxScripter]
Status: Offline
(since 15-08-2021 16:34)
Joined: 27 Dec 2010
Posts: 4306
,
Topics: 244
Location:
Jud. Miserupia, sat Bagadanc
Reputation:
4085
Votes
: 179
Posted: 21-04-2015, 16:24:15
| Translate post to:
... (
Click for more languages
)
destroi112 wrote:
Sau poti folosi round_terminator.inc iar atunci cand moare monstrul reincepe harta oricum sunt multe solutii in fixarea acelui bug
.
Dar nu e indicat ... mai poti folosi round terminator de la orpheu dar de asemenea e problema cu versiunile ... plus ca nu se merita un modul in plus sa execute doar o functie, kill e cea mai viabila rezolvare.
Pentru pluginuri complicate le fac cu $$ pe paypal/psc. PM
0
0
Back to top
Freakz Forum Index
->
Trash Bin
->
CS 2006-2019 (Archived)
->
Resources
The time now is 28-02-2025, 01:17:38
Copyright info
Based on phpBB
ro
/
com
B
Login
I forgot my password
World of Warcraft
Login for more...
Download WoW 7.3.5
Misc
eSports
Achievements
Buy reputation with votes
Reputation trades
Forum rules
Ban list
Members list
User guide (FAQ)
World of Warcraft
View details