Raised This Month: $ Target: $400
 0% 

Chameleon scrips, please help!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Rockinz
Member
Join Date: Jan 2013
Old 01-15-2013 , 12:36   Chameleon scrips, please help!
Reply With Quote #1

I want to activate the hero, chameleon. And I want to teach this hero these abilities:
0 | Vampiric Aura
6 | Bash
23 | Serpent Ward

11 | Chain Lightning

20 | Resistant Skin




And here is the script:

if ( get_pcvar_num( CVAR_wc3_races ) == 9 && get_pcvar_num( CVAR_wc3_cham_random ) )
{
new i, iNewSkill, iType;

// Lets loop through and find some skills!
for ( i = 0; i < 5; i++ )
{
iNewSkill = random_num( 0, MAX_SKILLS - 1 );

// Trainable Skills
if ( i < 3 )
{
iType = SKILL_TYPE_TRAINABLE;
}

// Ultimate
else if ( i == 3 )
{
iType = SKILL_TYPE_ULTIMATE;
}

// Passive Ability
else if ( i == 4 )
{
iType = SKILL_TYPE_PASSIVE;
}

// Loop until we find the right type of skill and while the skill exists ( we don't want a duplicate skill!! )
while ( g_SkillType[iNewSkill] != iType || CHAM_SkillExists( iNewSkill ) )
{
iNewSkill = random_num( 0, MAX_SKILLS - 1 );
}

g_ChamSkills[i] = iNewSkill;
}

// Do we need to set-up the skills for certain players?
new iPlayers[32], iNumPlayers, id;
get_players( iPlayers, iNumPlayers );

for ( i = 0; i < iNumPlayers; i++ )
{
id = iPlayers[i];

if ( p_data[id][P_RACE] == RACE_CHAMELEON )
{

// Reset everything
SM_ResetSkillLevels( id );
SM_ResetSkills( id );

// Set up the player's race again
SM_SetPlayerRace( id, RACE_CHAMELEON );

// Set up the player's skill levels
CHAM_ConfigureSkills( id );

// After skills set up - we need to configure the race!
WC3_SetRaceUp( id );
}
}
}
}

CHAM_SkillExists( skill_id )
{
new i;

for ( i = 0; i < 5; i++ )
{
if ( g_ChamSkills[i] == skill_id )
{
return true;
}
}

return false;
}

CHAM_Configure()
{

// Configure the Chameleon Race
if ( !get_pcvar_num( CVAR_wc3_cham_random ) )
{
g_ChamSkills[0] = get_pcvar_num( CVAR_wc3_cham_skill1 );
g_ChamSkills[1] = get_pcvar_num( CVAR_wc3_cham_skill2 );
g_ChamSkills[2] = get_pcvar_num( CVAR_wc3_cham_skill3 );
g_ChamSkills[3] = get_pcvar_num( CVAR_wc3_cham_ultimate );
g_ChamSkills[4] = get_pcvar_num( CVAR_wc3_cham_passive );

// Lets do some error checking b/c I know some people will fuck this up...

new i, bool:bError = false;
for ( i = 0; i < 3; i++ )
{
if ( !CHAM_ValidSkill( g_ChamSkills[i], SKILL_TYPE_TRAINABLE ) )
{
WC3_Log( true, "Invalid trainable skill for cvar wc3_cham_skill%d: %d", i+1, g_ChamSkills[i] );
bError = true;
}
}

// Check Ultimate
if ( !CHAM_ValidSkill( g_ChamSkills[3], SKILL_TYPE_ULTIMATE ) )
{
WC3_Log( true, "Invalid ultimate skill for cvar wc3_cham_ultimate: %d", g_ChamSkills[3] );
bError = true;
}

// Check Passive
if ( !CHAM_ValidSkill( g_ChamSkills[4], SKILL_TYPE_PASSIVE ) )
{
WC3_Log( true, "Invalid passive skill for cvar wc3_cham_passive: %d", g_ChamSkills[4] );
bError = true;
}

if ( bError )
{
set_pcvar_num( CVAR_wc3_cham_random, 1 )
}
}
}

// This will randomly assign skills to a player w/chameleon
CHAM_ConfigureSkills( id )
{
// Keep giving the a random skill until we have no more to give!
while ( SM_GiveRandomSkillPoint( id ) ) {}

// Display /level info...
WC3_ShowRaceInfo( id );
}

CHAM_ValidSkill( skill_id, iType )
{
if ( skill_id < 0 || skill_id >= MAX_SKILLS )
{
return false;
}

if ( g_SkillType[skill_id] != iType )
{
return false;
}



Where do i write the abilities? I've tried once, but it fucked up.
Rockinz is offline
h3llzOr
Member
Join Date: Nov 2011
Old 01-15-2013 , 17:37   Re: Chameleon scrips, please help!
Reply With Quote #2

wow, i must not edit the .inl file, to set up chameleon with an fix skills just edit war3ft.cfg from addons/amxmodx/configs/war3ft from cvars, i hope understand
h3llzOr is offline
Rockinz
Member
Join Date: Jan 2013
Old 01-16-2013 , 10:46   Re: Chameleon scrips, please help!
Reply With Quote #3

wc3_cham_random 1 // Should the 9th race have random skills each round?, if so the next 4 option are irrelevant (default is 1)
wc3_cham_skill1 4 // What skill ID for skill 1?
wc3_cham_skill2 0 // What skill ID for skill 2?
wc3_cham_skill3 32 // What skill ID for skill 3?
wc3_cham_ultimate 15 // What skill ID for the user's ultimate?
wc3_cham_passive 25 // What skill ID for the user's passive skill?


Like this? It couldnt be this, i've tried it many times and still wouldnt work.
Rockinz is offline
Rockinz
Member
Join Date: Jan 2013
Old 01-16-2013 , 10:48   Re: Chameleon scrips, please help!
Reply With Quote #4

The hero is working now , but i dont want random skills everytime, where do I write the skills?

Last edited by Rockinz; 01-16-2013 at 11:15.
Rockinz is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 01-16-2013 , 12:13   Re: Chameleon scrips, please help!
Reply With Quote #5

Stop double posting, use the edit button. Post your question where you got plugin from.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
h3llzOr
Member
Join Date: Nov 2011
Old 01-16-2013 , 15:02   Re: Chameleon scrips, please help!
Reply With Quote #6

what did you understand from this
wc3_cham_random 1 // Should the 9th race have random skills each round?, if so the next 4 option are irrelevant (default is 1)
i understand this, if this cvar has 1 the chameleon skills will be random, if will be 0 will use
wc3_cham_skill1 4 // What skill ID for skill 1?
wc3_cham_skill2 0 // What skill ID for skill 2?
wc3_cham_skill3 32 // What skill ID for skill 3?
wc3_cham_ultimate 15 // What skill ID for the user's ultimate?
wc3_cham_passive 25 // What skill ID for the user's passive skill?
this cvars...
h3llzOr is offline
AngeIII
Senior Member
Join Date: Sep 2007
Location: Latvia
Old 01-16-2013 , 15:56   Re: Chameleon scrips, please help!
Reply With Quote #7

RTFM { read the fucking manual } firstly. all cvars are described. Also all question about plugin work should be posted in that plugin section. Scripting question should be carefully described the problem.

In your case you firstly said that you need FIXED skills. but after some time you said that you need Random.. You first problem is solved by cvars, and second by cvars too.
But btw you should think about what you are doing, read the rules, and be more patient.
__________________
skype: pavle_ivanof
-=ThQ=-
PRIVATE SUPPORT = PAID SUPPORT
AngeIII is offline
Send a message via Skype™ to AngeIII
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 13:26.


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