Raised This Month: $51 Target: $400
 12% 

Hero: Zeus


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Fr33m@n
Veteran Member
Join Date: May 2008
Location: France Marne
Old 10-29-2011 , 10:25   Hero: Zeus
Reply With Quote #1

Zeus v1.0

Description
Zeus give you a chance to slay your victim with his Lightning Bolt.

This is a bit a Slayer rip at least for the damage + chance method, but with new features and visual effects. I think we can't call this hero a rip anymore.

By default, this hero only work outside (logic for a lightning).
If you want to keep this setting for this hero but still get it work in full walled maps (like de_rats) you can put zeus_workinside 1 in a specific map config for theses maps.

shconfig.cfg CVARS
Code:
//Zeus
zeus_level 0
zeus_chance 0.05   //Slay chance
zeus_burndecals 1  //Show the burn decals on the floor
zeus_workinside 0  //Allow zeus to work inside buidings and so on
**SuperHero Mod 1.2.0 & up ONLY**
Code:
// Comment out to use aztec thunder sound, removing the download of a custom thunder sound
// Note: If you change anything here from default setting you must recompile the plugin
//#define USE_AZTEC_THUNDER_SOUND
Attached Files
File Type: sma Get Plugin or Get Source (sh_zeus.sma - 1318 views - 6.4 KB)
File Type: zip sh_zeus_required_files.zip (46.5 KB, 472 views)

Last edited by Fr33m@n; 10-30-2011 at 08:46.
Fr33m@n is offline
The Art of War
Veteran Member
Join Date: Dec 2009
Location: Sweden Rock Festival
Old 10-29-2011 , 11:12   Re: Hero: Zeus
Reply With Quote #2

New version looks cool as usual ;p
__________________
The Art of War is offline
ShiiTake
Member
Join Date: May 2010
Old 09-04-2012 , 14:25   Re: Hero: Zeus
Reply With Quote #3

Freeman how can i add admin flags in this hero ?

I know about hero_resctricter but this plugin dont' work.

I put the files in the folders correctly. Compiled the superhero.sma again edited by the creator of restricter.sma but it did not work.

I tried to put correctly:

! c (admin flag kick)
Zeus

Still did not work.

Then I would know how to put straight in one source code FLAG to the hero.

My friend did this to hero anubis for me:


PHP Code:
public admincheck(id) { 
    new 
accessLevel[10] = "b" 
    
    
if (!(get_user_flags(id)&read_flags(accessLevel)) ) {
          
client_print(idprint_chat"[SH](%s) **Hero somente para admin**"gHeroName)
          
gHasAnubis[id] = false
          client_cmd
(id"say drop %s"gHeroName)
    }else{
        
gHasAnubis[id] = true;
    }
}
//----------------------------------------------------------------------------------------------

//----------------------------------------------------------------------------------------------
public admincheck2(id) { 
    new 
accessLevel[10] = "b" 
    
if (!(get_user_flags(id)&read_flags(accessLevel)) ) {
         
//
    
}else{
        
gHasAnubis[id] = true;
    }

I tried to edit to see if it worked, changing the name to Zeus, but it did not work:

PHP Code:
public admincheck(id) { 
    new 
accessLevel[10] = "b" 
    
    
if (!(get_user_flags(id)&read_flags(accessLevel)) ) {
          
client_print(idprint_chat"[SH](%s) **Heroi apenas para os ComboKing's e Maniac's**"gHeroName)
          
gHasZeus[id] = false
          client_cmd
(id"say drop %s"gHeroName)
    }else{
        
gHasZeus[id] = true;
    }
}
//----------------------------------------------------------------------------------------------

//----------------------------------------------------------------------------------------------
public admincheck2(id) { 
    new 
accessLevel[10] = "b" 
    
if (!(get_user_flags(id)&read_flags(accessLevel)) ) {
         
//
    
}else{
        
gHasZeus[id] = true;
    }

Added the source code which he edited for download.
Attached Files
File Type: sma Get Plugin or Get Source (sh_anubis.sma - 851 views - 5.5 KB)
__________________

Last edited by ShiiTake; 09-04-2012 at 14:28.
ShiiTake is offline
cstrike37
Member
Join Date: Jan 2012
Old 09-04-2012 , 22:05   Re: Hero: Zeus
Reply With Quote #4

@ShiiTake

Try this
PHP Code:
// ZEUS!

/* CVARS - copy and paste to shconfig.cfg

//Zeus
zeus_level 0
zeus_chance 0.05        //Slay chance
zeus_burndecals 1        //Show the burn decals on the floor
zeus_workinside 0        //Allow zeus to work inside buidings and so on

*/

//---------- User Changeable Defines --------//

// Comment out to use aztec thunder sound, removing the download of a custom thunder sound
// Note: If you change anything here from default setting you must recompile the plugin
//#define USE_AZTEC_THUNDER_SOUND

//------- Do not edit below this point ------//

#include <superheromod>

// GLOBAL VARIABLES
new gHeroID
new const gHeroName[] = "Zeus"
new bool:gHasZeus[SH_MAXSLOTS+1]
new 
bool:gIsInvisible[SH_MAXSLOTS+1]
new 
gBurnDecal
new gSpriteLightninggSpriteSmoke

#if defined USE_AZTEC_THUNDER_SOUND
new const gSoundThunder[] = "ambience/thunder_clap.wav"
#else
new const gSoundThunder[] = "shmod/zeus_lightningbolt.wav"
#endif

new gPcvarChancegPcvarWorkInsidegPcvarBurnDecals
//----------------------------------------------------------------------------------------------
public plugin_init()
{
    
// Plugin Info
    
register_plugin("SUPERHERO Zeus""1.0""Fr33m@n")

    
// DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
    
new pcvarLevel register_cvar("zeus_level""0")
    
gPcvarChance register_cvar("zeus_chance""0.05")
    
gPcvarWorkInside register_cvar("zeus_workinside""0")
    
gPcvarBurnDecals register_cvar("zeus_burndecals""1")

    
// FIRE THE EVENT TO CREATE THIS SUPERHERO!
    
gHeroID sh_create_hero(gHeroNamepcvarLevel)
    
sh_set_hero_info(gHeroID"Divine Lightning Bolt""Zeus give you a chance to slay your victim with his Lightning Bolt")

    
// Set to correct burn decals if mod is CZ or CS
    
gBurnDecal engfunc(EngFunc_DecalIndex"{scorch3")
}
//----------------------------------------------------------------------------------------------
public plugin_precache()
{
    
gSpriteLightning precache_model("sprites/lgtning.spr")
    
gSpriteSmoke precache_model("sprites/steam1.spr")
    
precache_sound(gSoundThunder)
}
//----------------------------------------------------------------------------------------------
public sh_hero_init(idheroIDmode)
{
    if ( 
gHeroID != heroID ) return
    
admincheck(id);
    
gHasZeus[id] = mode true false

    sh_debug_message
(id1"%s %s"gHeroNamemode "ADDED" "DROPPED")
}
//----------------------------------------------------------------------------------------------
public sh_client_spawn(id)
{
    
admincheck2(id)
    
// if user is invisible, reset invisibility
    
if ( gIsInvisible[id] ) {
        
sh_set_rendering(id)
    }
    
gIsInvisible[id] = false
}
//----------------------------------------------------------------------------------------------
public client_damage(attackervictimdamagewpnindex)
{
    if ( !
sh_is_active() ) return
    if ( !
is_user_connected(victim) || !is_user_alive(attacker) ) return

    if ( 
gHasZeus[attacker] && wpnindex != (CSW_KNIFE CSW_HEGRENADE) && random_float(0.01.0) <= get_pcvar_float(gPcvarChance) ) {
        
// Get the origin of the victim's feet
        
new Float:fl_Origin[3]
        
pev(victimpev_originfl_Origin)
        
fl_Origin[2] -= (pev(victimpev_flags) & FL_DUCKING) ? 18.0 36.0

        
if ( !get_pcvar_num(gPcvarWorkInside) ) {
            new 
Float:fl_TraceEnd[3], Float:fl_EndPos[3]
            
fl_TraceEnd[0] = fl_Origin[0] + 1500.0
            fl_TraceEnd
[1] = fl_Origin[1] + 1500.0
            fl_TraceEnd
[2] = fl_Origin[2] + 8000.0

            
new ptr create_tr2()
            
engfunc(EngFunc_TraceLinefl_Originfl_TraceEndIGNORE_MONSTERSvictimptr)
            
get_tr2(ptrTR_vecEndPosfl_EndPos)
            
free_tr2(ptr)

            
// Check if the victim is under the sky or not
            
if ( engfunc(EngFunc_PointContentsfl_EndPos) != CONTENTS_SKY ) return
        }

        
thunder_effects(fl_Origin)

        
sh_extra_damage(victimattackerdamage"Lightning Bolt"0SH_DMG_KILL)

        
// Make the corpse invisible
        
sh_set_rendering(victim0000kRenderFxGlowShellkRenderTransAlpha)
        
gIsInvisible[victim] = true
    
}
}
//----------------------------------------------------------------------------------------------
thunder_effects(Float:fl_Origin[3])
{
    new 
Float:fX fl_Origin[0], Float:fY fl_Origin[1], Float:fZ fl_Origin[2]

    
// Thunder sound
    
emit_sound(0CHAN_ITEMgSoundThunderVOL_NORMATTN_NORM0PITCH_NORM)

    
// Beam effect between two points
    
engfunc(EngFunc_MessageBeginMSG_BROADCASTSVC_TEMPENTITYfl_Origin0)
    
write_byte(TE_BEAMPOINTS)        // 0
    
engfunc(EngFunc_WriteCoordfX 150.0)    // start position
    
engfunc(EngFunc_WriteCoordfY 150.0)
    
engfunc(EngFunc_WriteCoordfZ 800.0)
    
engfunc(EngFunc_WriteCoordfX)    // end position
    
engfunc(EngFunc_WriteCoordfY)
    
engfunc(EngFunc_WriteCoordfZ)
    
write_short(gSpriteLightning)    // sprite index
    
write_byte(1)                    // starting frame
    
write_byte(15)                    // frame rate in 0.1's
    
write_byte(10)                    // life in 0.1's
    
write_byte(80)                    // line width in 0.1's
    
write_byte(30)                    // noise amplitude in 0.01's
    
write_byte(255)                    // red
    
write_byte(255)                    // green
    
write_byte(255)                    // blue
    
write_byte(255)                    // brightness
    
write_byte(200)                    // scroll speed in 0.1's
    
message_end()

    
// Sparks
    
message_begin(MSG_PVSSVC_TEMPENTITY)
    
write_byte(TE_SPARKS)            // 9
    
engfunc(EngFunc_WriteCoordfX)    // position
    
engfunc(EngFunc_WriteCoordfY)
    
engfunc(EngFunc_WriteCoordfZ 10.0)
    
message_end()

    
// Smoke
    
engfunc(EngFunc_MessageBeginMSG_BROADCASTSVC_TEMPENTITYfl_Origin0)
    
write_byte(TE_SMOKE)            // 5
    
engfunc(EngFunc_WriteCoordfX)    // position
    
engfunc(EngFunc_WriteCoordfY)
    
engfunc(EngFunc_WriteCoordfZ 10.0)
    
write_short(gSpriteSmoke)        // sprite index
    
write_byte(10)                    // scale in 0.1's
    
write_byte(10)                    // framerate
    
message_end()
    
    
// Blood
    
engfunc(EngFunc_MessageBeginMSG_BROADCASTSVC_TEMPENTITYfl_Origin0)
    
write_byte(TE_LAVASPLASH)        // 10
    
engfunc(EngFunc_WriteCoordfX)    // position
    
engfunc(EngFunc_WriteCoordfY)
    
engfunc(EngFunc_WriteCoordfZ 12.0)
    
message_end()

    if ( 
get_pcvar_num(gPcvarBurnDecals) ) {
        
// Burn decal
        
engfunc(EngFunc_MessageBeginMSG_BROADCASTSVC_TEMPENTITYfl_Origin0)
        
write_byte(TE_GUNSHOTDECAL)        // 109
        
engfunc(EngFunc_WriteCoordfX)    // position
        
engfunc(EngFunc_WriteCoordfY)
        
engfunc(EngFunc_WriteCoordfZ)
        
write_short(0)
        
write_byte(gBurnDecal random(3))    // decal
        
message_end()
    }
}
//----------------------------------------------------------------------------------------------
public admincheck(id) { 
    new 
accessLevel[10] = "b" 
    
    
if (!(get_user_flags(id)&read_flags(accessLevel)) ) {
          
client_print(idprint_chat"[SH](%s) **Hero somente para admin**"gHeroName)
          
gHasZeus[id] = false
          client_cmd
(id"say drop %s"gHeroName)
    }else{
        
gHasZeus[id] = true;
    }
}
//----------------------------------------------------------------------------------------------

public admincheck2(id) { 
    new 
accessLevel[10] = "b" 
    
if (!(get_user_flags(id)&read_flags(accessLevel)) ) {
         
//
    
}else{
        
gHasZeus[id] = true;
    }
}
//----------------------------------------------------------------------------------------------
public client_connect(id)
{
    
admincheck2(id)
}
//---------------------------------------------------------------------------------------------- 
Attached Files
File Type: sma Get Plugin or Get Source (sh_zeus.sma - 814 views - 7.4 KB)

Last edited by cstrike37; 09-04-2012 at 22:13.
cstrike37 is offline
ShiiTake
Member
Join Date: May 2010
Old 09-05-2012 , 11:32   Re: Hero: Zeus
Reply With Quote #5

i'll try, back soon.

ty cstrike.
__________________
ShiiTake is offline
ShiiTake
Member
Join Date: May 2010
Old 09-17-2012 , 14:12   Re: Hero: Zeus
Reply With Quote #6

Up & Reply:

It worked perfectly, thank you. But if I put in some lighter players without the flag "b" can handle it.

The players with the flag "b" already has the hero just as I wanted.

But if I wanted to change the flag "b" for the flag "o" or for the "s". How can I do? Just change the value of the flag in code or access number should also change?

( new accessLevel[10] = "b" )
__________________

Last edited by ShiiTake; 09-17-2012 at 14:13.
ShiiTake is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 09-17-2012 , 14:54   Re: Hero: Zeus
Reply With Quote #7

Change only the letter.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
ShiiTake
Member
Join Date: May 2010
Old 09-17-2012 , 17:23   Re: Hero: Zeus
Reply With Quote #8

Thanks Jelle, i'll try it.

Back soon.

edit: If i want put flags on more heroes ?

Is there some code that can be generalized to all the heroes?

I tried using this code done by "cstrike" in Mad Assassin and it did not work = /
__________________

Last edited by ShiiTake; 09-17-2012 at 19:53.
ShiiTake is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:03.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode