Este guia foi concebido para scripters nachinayuschih.
Considere a versão básica do plugin no AlienBoss NPC de Alexander 3
Por que é isso? Sim, porque é a melhor de todas as outras alternativas.
Sem contar o número de curso.
Video:
Sma:
::Download::: Resources
Creditos: Zombie Mod RU
Considere a versão básica do plugin no AlienBoss NPC de Alexander 3
Por que é isso? Sim, porque é a melhor de todas as outras alternativas.
Sem contar o número de curso.
Video:
Sma:
- Código:
# Include
# Include
# Include
# Include
# Include
# Define nome de "AlienBoss Especial Para Zombie-Mod.Ru"
# Define VERSÃO "Público"
# Define AUTOR "Alexander.3"
const alien_hp = 25000
const boss_speed = 200
Float const: prepare_time = 15,0
const dmg_attack = 50
const dmg_ms = 50
const dmg_sw = 50
Float estática: Origin [3]
g_Alien estática
g_BossTarget estática
VictimID estática
Float estática: g_Health
Capacidade estática
nova const Resource [] [] = {
"Modelos / NPC / alienígena / alien.mdl",
"Sprites / blood.spr",
"Sprites / bloodspray.spr",
"Sprites / NPC / hp.spr",
"Sprites / shockwave.spr", / / 4
"Sprites / NPC / alienígenas / fluxing.spr" / / 5
}
g_Resource estática [sizeof Resource]
enum {
IDLE,
Andar,
MS,
Ataque,
SW
}
plugin_init pública () {
register_plugin (nome, versão, autor)
register_clcmd ("dizer / criar", "criar")
register_clcmd ("dizer / desovar", "Spawn")
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")
}
RandomAbility público (taskid) {
if (Ability! = pé)
voltar
switch (random (2)) {
case 0: Capacidade = MS
case 1: Capacidade = SW
}
}
público create (id)
pev (id, pev_origin, Origin)
desovar pública () {
g_Alien = engfunc (EngFunc_CreateNamedEntity, engfunc (EngFunc_AllocString, "info_target"))
novo HPspr = engfunc (EngFunc_CreateNamedEntity, engfunc (EngFunc_AllocString ", info_target"))
engfunc (EngFunc_SetModel, g_Alien, Recurso [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_NO)
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)
Capacidade = IDLE
Anim (g_Alien, 2)
Float estática: Origin [3]
pev (g_Alien, pev_origin, Origin)
Origem [2] + = 200,0
engfunc (EngFunc_SetOrigin, HPspr, Origin)
engfunc (EngFunc_SetModel, HPspr, Recurso [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)
}
Think_Boss públicos (Ent) {
if (PEV (Ent, pev_deadflag) == DEAD_DYING)
voltar
static bool: um
switch (Ability) {
caso IDLE: {
Capacidade = CAMINHADA
set_task (10.0, "RandomAbility", 1337, _, _, "b")
set_pev (Ent, pev_nextthink, get_gametime () + 0,1)
voltar
}
caso CAMINHADA: {
Float estática: Origin [3], Float: Origem2 [3], Float: Vector [3], Float: Ângulo [3]
if (! is_user_alive (g_BossTarget)) {
g_BossTarget = GetRandomAlive (random_num (1, GetAliveCount ()))
set_pev (Ent, pev_nextthink, get_gametime () + 0,1)
voltar
}
if (um) {
set_pev (Ent, pev_movetype, MOVETYPE_PUSHSTEP)
Anim (Ent, 3)
um = false
}
pev (Ent, pev_origin, Origin)
pev (g_BossTarget, pev_origin, Origem2)
xs_vec_sub (Origem2, Origin, Vector)
vector_to_angle (Vector, Ângulo)
new Float: num = floatsqroot (float (boss_speed) * float (boss_speed) / (vetor [0] * vetor [0] + vetor [1] * vetor [1] + vetor [2] * vetor [2]))
Vetor [0] * = num
Vetor [1] * = num
Vetor [2]? (Vetor [2] = 0.0): (vetor [2] * = num)
set_pev (Ent, pev_velocity, Vector)
Ângulo [0] = 0,0
Ângulo [2] = 0,0
set_pev (Ent, pev_angles, Ângulo)
set_pev (Ent, pev_nextthink, get_gametime () + 0,1)
voltar
}
caso ATTACK: {
Num estática
switch (num) {
case 0: {
Anim (Ent, 6)
Num + +
set_pev (Ent, pev_nextthink, get_gametime () + 1.0)
voltar
}
case 1: {
Float estática: 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 (vetor)
if (Lena <= 170) {
xs_vec_normalize (Velocity, Velocity)
Velocidade [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
um = true
Capacidade = CAMINHADA
set_pev (Ent, pev_nextthink, get_gametime () + 0,2)
}
caso MS: {
Num estática, Float: Origin [3], Float: Origem2 [3], Float: Vector [3], Float: Ângulo [3]
switch (num) {
case 0: {
novo MS_Attack = GetRandomAlive (random_num (1, GetAliveCount ()))
pev (MS_Attack, pev_origin, Origin)
pev (Ent, pev_origin, Origem2)
xs_vec_sub (Origin, Origem2, Vector)
vector_to_angle (Vector, Ângulo)
xs_vec_normalize (Vector, Vector)
xs_vec_mul_scalar (Vector, 2000.0, Vector)
Ângulo [0] = 0,0
Ângulo [2] = 0,0
Vetor [2] = 0,0
set_pev (Ent, pev_angles, Ângulo)
set_pev (Ent, pev_movetype, MOVETYPE_NONE)
Anim (Ent, 7)
set_pev (Ent, pev_nextthink, get_gametime () + 1.0)
Num + +
voltar
}
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 + +
voltar
}
}
set_pev (Ent, pev_nextthink, get_gametime () + 0,1)
num = 0
Capacidade = CAMINHADA
um = true
voltar
}
caso SW: {
Num estática, 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)
Origem [2] = 70 +
engfunc (EngFunc_SetOrigin, FluxSpr, Origin)
engfunc (EngFunc_SetModel, FluxSpr, Recurso [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 + +
voltar
}
caso 1 .. 10 {
for (new id = 1; id <= get_maxplayers (); ID + +) {
if (! is_user_alive (id))
continuar
Float estática: 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 + +
voltar
}
}
caso 11: {
engfunc (EngFunc_RemoveEntity, FluxSpr)
Anim (Ent, 5)
set_pev (Ent, pev_nextthink, get_gametime () + 2.2)
Num + +
voltar
}
caso 12: {
Float estática: 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))
continuar
if (PEV (id, pev_flags) e FL_ONGROUND) {
Float estática: 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)
}
}
}
}
}
Capacidade = CAMINHADA
um = true
num = 0
set_pev (Ent, pev_nextthink, get_gametime () + 0,2)
voltar
}
}
}
}
}
público Think_HP (Ent) {
Float estática: Origin [3], num
pev (g_Alien, pev_origin, Origin)
Origem [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: {
Float estática: quadro
frame = g_Health * 100,0 / float (alien_hp)
if (quadro)
set_pev (Ent, pev_frame, quadro)
if (PEV (g_Alien, pev_deadflag) == DEAD_DYING) {
engfunc (EngFunc_RemoveEntity, Ent)
voltar
}
}
}
set_pev (Ent, pev_nextthink, get_gametime () + 0,1)
}
TraceAttack pública (vítima, agressor, Float: dano, Float: direção [3], th, dt) {
Float estática: End [3], ClassName [32]
pev (vítima, pev_classname, ClassName, charsmax (ClassName))
if (equal (ClassName ", AlienBossik")) {
get_tr2 (th, TR_vecEndPos, End)
Sangue (Fim)
}
}
TakeDamage pública (vítima, arma, atacante, Float: dano, damagetype) {
ClassName estática [32]
pev (vítima, pev_classname, ClassName, charsmax (ClassName))
if (equal (ClassName ", AlienBossik")) {
pev (vítima, pev_health, g_Health)
if (g_Health <= dano) {
Anim (vítima, 1)
set_pev (vítima, pev_movetype, MOVETYPE_FLY)
set_pev (vítima, pev_solid, SOLID_NOT)
set_pev (vítima, pev_velocity, {0.0, 0.0, 0.0})
set_pev (vítima, pev_deadflag, DEAD_DYING)
remove_task (1337)
voltar HAM_SUPERCEDE
}
}
voltar HAM_HANDLED
}
Touch_Boss públicos (Ent, WorldEnt) {
if (Capacidade == MS) {
vítima estática = -1, Float: Origin [3]
pev (Ent, pev_origin, Origin)
while ((vítima = engfunc (EngFunc_FindEntityInSphere, vítima, Origin, 400,0))! = 0) {
if (! is_user_alive (vítima))
continuar
ExecuteHamB (Ham_TakeDamage, vítima, 0, vítima, float (dmg_ms), DMG_BULLET)
}
}
if (Ability == WALK) {
Capacidade = ATAQUE
VictimID = WorldEnt
}
}
público plugin_precache () {
for (new i; i <= charsmax (Resource); i + +)
g_Resource [i] = precache_model (Resource [i])
}
estoque de sangue (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 ();
}
estoque Anim (ent, seqüência) {
set_pev (ent, pev_sequence, seqüência)
set_pev (ent, pev_animtime, halflife_time ())
set_pev (ent, pev_framerate, 1.0)
}
estoque ShockWave (Float: Orig [3], Vida, Largura, Float: Radius, cores [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]) / / eixo x
engfunc (EngFunc_WriteCoord, Orig [1]) / / eixo y
engfunc (EngFunc_WriteCoord, Orig [2] + raio) / / eixo z
write_short (g_Resource [4]) / / Sprite
write_byte (0) / / startframe
write_byte (0) / / framerate
write_byte (Life) / / vida (4)
write_byte (largura) / / largura (20)
write_byte (0) / / ruído
write_byte (Color [0]) / / vermelho
write_byte (Color) [1] / / verde
write_byte (Color) [2] / / azul
write_byte (255) / / brilho
write_byte (0) / / velocidade
message_end ()
}
estoque ScreenFade (id, Timer, Cores [3], Alpha) {
message_begin (MSG_ONE_UNRELIABLE, get_user_msgid ("ScreenFade"), _, id);
write_short ((1 << 12) * Temporizador)
write_short (1 << 12)
write_short (0)
write_byte (cores [0])
write_byte (Cores) [1]
write_byte (Cores) [2]
write_byte (Alfa)
message_end ()
}
estoque 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
novo iAlive
for (new id = 1; id <= get_maxplayers (); ID + +) {
if (is_user_alive (id)) + + iAlive
if (iAlive == target_index) ID de retorno
}
retornar -1
}
GetAliveCount () {/ / ^ ^
novo iAlive
for (new id = 1; id <= get_maxplayers (); ID + +) if (is_user_alive (id)) iAlive + +
voltar iAlive
}
/ * AMXX-Studio Notes - Não modifique o ABAIXO AQUI
* {\ \ Rtf1 \ \ ansi \ \ deff0 {\ \ fonttbl {\ \ f0 \ \ fnil Tahoma;}} \ n \ \ viewkind4 \ \ uc1 \ \ pard \ \ lang1049 \ \ f0 \ \ FS16 \ n \ \ par}
* /
::Download::: Resources
Creditos: Zombie Mod RU