魔兽3.0第9族问题,有修改魔兽经验的来看看
我修改了一个20级的魔兽,其他种族都可以升到20级,但是9族一超过10级,服务器就挂了,到底什么问题呢?希望有经验的玩家来看看。/** Race: Chameleon Functions
*/
public CHAM_Randomize()
{
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 != iType || CHAM_SkillExists( iNewSkill ) )
{
iNewSkill = random_num( 0, MAX_SKILLS - 1 );
}
g_ChamSkills = iNewSkill;
}
// Do we need to set-up the skills for certain players?
new iPlayers, iNumPlayers, id;
get_players( iPlayers, iNumPlayers );
for ( i = 0; i < iNumPlayers; i++ )
{
id = iPlayers;
if ( p_data == 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 == skill_id )
{
return true;
}
}
return false;
}
CHAM_Configure()
{
// Configure the Chameleon Race
if ( !get_pcvar_num( CVAR_wc3_cham_random ) )
{
g_ChamSkills = get_pcvar_num( CVAR_wc3_cham_skill1 );
g_ChamSkills = get_pcvar_num( CVAR_wc3_cham_skill2 );
g_ChamSkills = get_pcvar_num( CVAR_wc3_cham_skill3 );
g_ChamSkills = get_pcvar_num( CVAR_wc3_cham_ultimate );
g_ChamSkills = 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, SKILL_TYPE_TRAINABLE ) )
{
WC3_Log( true, "Invalid trainable skill for cvar wc3_cham_skill%d: %d", i+1, g_ChamSkills );
bError = true;
}
}
// Check Ultimate
if ( !CHAM_ValidSkill( g_ChamSkills, SKILL_TYPE_ULTIMATE ) )
{
WC3_Log( true, "Invalid ultimate skill for cvar wc3_cham_ultimate: %d", g_ChamSkills );
bError = true;
}
// Check Passive
if ( !CHAM_ValidSkill( g_ChamSkills, SKILL_TYPE_PASSIVE ) )
{
WC3_Log( true, "Invalid passive skill for cvar wc3_cham_passive: %d", g_ChamSkills );
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 != iType )
{
return false;
}
return true;
} 没有能解决这个问题 不好意思,我也不懂 具体忘记了,当年就改了20级的东东 没钱了!哇哇!刷了!22222222 我很久以前改过,http://www.dt-club.net/forum.php?mod=viewthread&tid=57035&page=2#pid576005
保存的cs 进去看了下没有你说的9族错误。
页:
[1]