2009-04-06 03:20:13 +02:00
|
|
|
/*
|
|
|
|
* ============================================================================
|
|
|
|
*
|
2009-07-05 08:49:23 +02:00
|
|
|
* Zombie:Reloaded
|
2009-04-06 03:20:13 +02:00
|
|
|
*
|
2009-06-12 05:51:26 +02:00
|
|
|
* File: attributes.inc
|
|
|
|
* Type: Core
|
|
|
|
* Description: Retrieving class attributes from certain caches.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2009 Greyscale, Richard Helgeby
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2009-04-06 03:20:13 +02:00
|
|
|
*
|
|
|
|
* ============================================================================
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* ------------------------------------
|
|
|
|
*
|
|
|
|
* GENERAL ATTRIBUTES
|
|
|
|
*
|
|
|
|
* ------------------------------------
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Checks if the specified class is enabled.
|
|
|
|
*
|
|
|
|
* @param index Index of the class in a class cache or a client index,
|
|
|
|
* depending on the cache type specified.
|
|
|
|
* @param cachetype Optional. Specifies what class cache to read from. Options:
|
|
|
|
* ZR_CLASS_CACHE_ORIGINAL - Unchanced class data.
|
|
|
|
* ZR_CLASS_CACHE_MODIFIED (default) - Changed/newest class
|
|
|
|
* data.
|
|
|
|
* ZR_CLASS_CACHE_PLAYER - Player cache. If this one is used,
|
|
|
|
* index will be used as a client index.
|
|
|
|
* @return True if it's enabled, false otherwise.
|
|
|
|
*/
|
2009-05-30 04:17:01 +02:00
|
|
|
stock bool:ClassIsEnabled(index, cachetype = ZR_CLASS_CACHE_MODIFIED)
|
2009-04-06 03:20:13 +02:00
|
|
|
{
|
|
|
|
switch (cachetype)
|
|
|
|
{
|
|
|
|
case ZR_CLASS_CACHE_ORIGINAL:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassData[index][Class_Enabled];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_MODIFIED:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassDataCache[index][Class_Enabled];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_PLAYER:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassPlayerCache[index][Class_Enabled];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the team ID for the specified class.
|
|
|
|
*
|
|
|
|
* @param index Index of the class in a class cache or a client index,
|
|
|
|
* depending on the cache type specified.
|
|
|
|
* @param cachetype Optional. Specifies what class cache to read from. Options:
|
|
|
|
* ZR_CLASS_CACHE_ORIGINAL - Unchanced class data.
|
|
|
|
* ZR_CLASS_CACHE_MODIFIED - Changed/newest class data.
|
|
|
|
* ZR_CLASS_CACHE_PLAYER (default) - Player cache. If this one
|
|
|
|
* is used, index will be used as a client index.
|
|
|
|
* @return The team ID if successful, -1 otherwise.
|
|
|
|
*/
|
2009-05-30 04:17:01 +02:00
|
|
|
stock ClassGetTeamID(index, cachetype = ZR_CLASS_CACHE_PLAYER)
|
2009-04-06 03:20:13 +02:00
|
|
|
{
|
|
|
|
switch (cachetype)
|
|
|
|
{
|
|
|
|
case ZR_CLASS_CACHE_ORIGINAL:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassData[index][Class_Team];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_MODIFIED:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassDataCache[index][Class_Team];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_PLAYER:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassPlayerCache[index][Class_Team];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Checks if the specified class is marked as the default class for its current
|
|
|
|
* team.
|
|
|
|
*
|
|
|
|
* @param index Index of the class in a class cache or a client index,
|
|
|
|
* depending on the cache type specified.
|
|
|
|
* @param cachetype Optional. Specifies what class cache to read from. Options:
|
|
|
|
* ZR_CLASS_CACHE_ORIGINAL - Unchanced class data.
|
|
|
|
* ZR_CLASS_CACHE_MODIFIED (default) - Changed/newest class
|
|
|
|
* data.
|
|
|
|
* ZR_CLASS_CACHE_PLAYER - Player cache. If this one is used,
|
|
|
|
* index will be used as a client index.
|
|
|
|
* @return True if it's default for its current team, false otherwise.
|
|
|
|
*/
|
2009-05-30 04:17:01 +02:00
|
|
|
stock bool:ClassGetTeamDefault(index, cachetype = ZR_CLASS_CACHE_MODIFIED)
|
2009-04-06 03:20:13 +02:00
|
|
|
{
|
|
|
|
switch (cachetype)
|
|
|
|
{
|
|
|
|
case ZR_CLASS_CACHE_ORIGINAL:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassData[index][Class_TeamDefault];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_MODIFIED:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassDataCache[index][Class_TeamDefault];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_PLAYER:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassPlayerCache[index][Class_TeamDefault];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2009-06-19 02:31:05 +02:00
|
|
|
/**
|
2009-06-22 01:09:51 +02:00
|
|
|
* Gets flags for the specified class.
|
2009-06-19 02:31:05 +02:00
|
|
|
*
|
|
|
|
* @param index Index of the class in a class cache or a client index,
|
|
|
|
* depending on the cache type specified.
|
|
|
|
* @param cachetype Optional. Specifies what class cache to read from. Options:
|
|
|
|
* ZR_CLASS_CACHE_ORIGINAL - Unchanced class data.
|
|
|
|
* ZR_CLASS_CACHE_MODIFIED (default) - Changed/newest class
|
|
|
|
* data.
|
|
|
|
* ZR_CLASS_CACHE_PLAYER - Player cache. If this one is used,
|
|
|
|
* index will be used as a client index.
|
2009-06-22 01:09:51 +02:00
|
|
|
* @return Class flags, or -1 if failed.
|
2009-06-19 02:31:05 +02:00
|
|
|
*/
|
2009-06-22 01:09:51 +02:00
|
|
|
stock ClassGetFlags(index, cachetype = ZR_CLASS_CACHE_MODIFIED)
|
2009-06-19 02:31:05 +02:00
|
|
|
{
|
|
|
|
switch (cachetype)
|
|
|
|
{
|
|
|
|
case ZR_CLASS_CACHE_ORIGINAL:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassData[index][Class_Flags];
|
2009-06-19 02:31:05 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_MODIFIED:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassDataCache[index][Class_Flags];
|
2009-06-19 02:31:05 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_PLAYER:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassPlayerCache[index][Class_Flags];
|
2009-06-22 01:09:51 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Do bitwise compare on flags in the specified class.
|
|
|
|
*
|
|
|
|
* @param index Index of the class in a class cache or a client index,
|
|
|
|
* depending on the cache type specified.
|
|
|
|
* @param flags Class flags to check.
|
|
|
|
* @param cachetype Optional. Specifies what class cache to read from. Options:
|
|
|
|
* ZR_CLASS_CACHE_ORIGINAL - Unchanced class data.
|
|
|
|
* ZR_CLASS_CACHE_MODIFIED (default) - Changed/newest class
|
|
|
|
* data.
|
|
|
|
* ZR_CLASS_CACHE_PLAYER - Player cache. If this one is used,
|
|
|
|
* index will be used as a client index.
|
|
|
|
* @return True if the flags are set, false otherwise or if failed.
|
|
|
|
*/
|
|
|
|
stock bool:ClassHasFlags(index, flags, cachetype = ZR_CLASS_CACHE_MODIFIED)
|
|
|
|
{
|
|
|
|
switch (cachetype)
|
|
|
|
{
|
|
|
|
case ZR_CLASS_CACHE_ORIGINAL:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return bool:(ClassData[index][Class_Flags] & flags);
|
2009-06-22 01:09:51 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_MODIFIED:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return bool:(ClassDataCache[index][Class_Flags] & flags);
|
2009-06-22 01:09:51 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_PLAYER:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return bool:(ClassPlayerCache[index][Class_Flags] & flags);
|
2009-06-19 02:31:05 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2009-08-13 18:31:21 +02:00
|
|
|
/**
|
|
|
|
* Gets the class group required to be a member of to use the class.
|
|
|
|
*
|
|
|
|
* @param index Index of the class in a class cache or a client index,
|
|
|
|
* depending on the cache type specified.
|
|
|
|
* @param buffer The destination string buffer.
|
|
|
|
* @param maxlen The length of the destination string buffer.
|
|
|
|
* @param cachetype Optional. Specifies what class cache to read from. Options:
|
|
|
|
* ZR_CLASS_CACHE_ORIGINAL - Unchanced class data.
|
|
|
|
* ZR_CLASS_CACHE_MODIFIED - Changed/newest class data.
|
|
|
|
* ZR_CLASS_CACHE_PLAYER (default) - Player cache. If this one
|
|
|
|
* is used, index will be used as a client index.
|
|
|
|
* @return Number of cells written. -1 on error.
|
|
|
|
*/
|
|
|
|
stock ClassGetGroup(index, String:buffer[], maxlen, cachetype = ZR_CLASS_CACHE_PLAYER)
|
|
|
|
{
|
|
|
|
switch (cachetype)
|
|
|
|
{
|
|
|
|
case ZR_CLASS_CACHE_ORIGINAL:
|
|
|
|
{
|
|
|
|
return strcopy(buffer, maxlen, ClassData[index][Class_Group]);
|
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_MODIFIED:
|
|
|
|
{
|
|
|
|
return strcopy(buffer, maxlen, ClassDataCache[index][Class_Group]);
|
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_PLAYER:
|
|
|
|
{
|
|
|
|
return strcopy(buffer, maxlen, ClassPlayerCache[index][Class_Group]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2009-04-06 03:20:13 +02:00
|
|
|
/**
|
|
|
|
* Gets the class name to be displayed in the class menu.
|
|
|
|
*
|
|
|
|
* @param index Index of the class in a class cache or a client index,
|
|
|
|
* depending on the cache type specified.
|
2009-04-14 23:33:06 +02:00
|
|
|
* @param buffer The destination string buffer.
|
2009-04-06 03:20:13 +02:00
|
|
|
* @param maxlen The length of the destination string buffer.
|
|
|
|
* @param cachetype Optional. Specifies what class cache to read from. Options:
|
|
|
|
* ZR_CLASS_CACHE_ORIGINAL - Unchanced class data.
|
|
|
|
* ZR_CLASS_CACHE_MODIFIED - Changed/newest class data.
|
|
|
|
* ZR_CLASS_CACHE_PLAYER (default) - Player cache. If this one
|
|
|
|
* is used, index will be used as a client index.
|
|
|
|
* @return Number of cells written. -1 on error.
|
|
|
|
*/
|
2009-05-30 04:17:01 +02:00
|
|
|
stock ClassGetName(index, String:buffer[], maxlen, cachetype = ZR_CLASS_CACHE_PLAYER)
|
2009-04-06 03:20:13 +02:00
|
|
|
{
|
|
|
|
switch (cachetype)
|
|
|
|
{
|
|
|
|
case ZR_CLASS_CACHE_ORIGINAL:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return strcopy(buffer, maxlen, ClassData[index][Class_Name]);
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_MODIFIED:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return strcopy(buffer, maxlen, ClassDataCache[index][Class_Name]);
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_PLAYER:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return strcopy(buffer, maxlen, ClassPlayerCache[index][Class_Name]);
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the menu description string for the specified class.
|
|
|
|
*
|
|
|
|
* @param index Index of the class in a class cache or a client index,
|
|
|
|
* depending on the cache type specified.
|
|
|
|
* @param buffer The destination string buffer.
|
|
|
|
* @param maxlen The length of the destination string buffer.
|
|
|
|
* @param cachetype Optional. Specifies what class cache to read from. Options:
|
|
|
|
* ZR_CLASS_CACHE_ORIGINAL - Unchanced class data.
|
|
|
|
* ZR_CLASS_CACHE_MODIFIED - Changed/newest class data.
|
|
|
|
* ZR_CLASS_CACHE_PLAYER (default) - Player cache. If this one
|
|
|
|
* is used, index will be used as a client index.
|
|
|
|
* @return Number of cells written. -1 on error.
|
|
|
|
*/
|
2009-05-30 04:17:01 +02:00
|
|
|
stock ClassGetDescription(index, String:buffer[], maxlen, cachetype = ZR_CLASS_CACHE_PLAYER)
|
2009-04-06 03:20:13 +02:00
|
|
|
{
|
|
|
|
switch (cachetype)
|
|
|
|
{
|
|
|
|
case ZR_CLASS_CACHE_ORIGINAL:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return strcopy(buffer, maxlen, ClassData[index][Class_Description]);
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_MODIFIED:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return strcopy(buffer, maxlen, ClassDataCache[index][Class_Description]);
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_PLAYER:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return strcopy(buffer, maxlen, ClassPlayerCache[index][Class_Description]);
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* ------------------------------------
|
|
|
|
*
|
|
|
|
* MODEL ATTRIBUTES
|
|
|
|
*
|
|
|
|
* ------------------------------------
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the model path string from the specified class.
|
|
|
|
*
|
|
|
|
* @param index Index of the class in a class cache or a client index,
|
|
|
|
* depending on the cache type specified.
|
|
|
|
* @param buffer The destination string buffer.
|
|
|
|
* @param maxlen The length of the destination string buffer.
|
|
|
|
* @param cachetype Optional. Specifies what class cache to read from. Options:
|
|
|
|
* ZR_CLASS_CACHE_ORIGINAL - Unchanced class data.
|
|
|
|
* ZR_CLASS_CACHE_MODIFIED - Changed/newest class data.
|
|
|
|
* ZR_CLASS_CACHE_PLAYER (default) - Player cache. If this one
|
|
|
|
* is used, index will be used as a client index.
|
|
|
|
* @return Number of cells written. -1 on error.
|
|
|
|
*/
|
2009-05-30 04:17:01 +02:00
|
|
|
stock ClassGetModelPath(index, String:buffer[], maxlen, cachetype = ZR_CLASS_CACHE_PLAYER)
|
2009-04-06 03:20:13 +02:00
|
|
|
{
|
|
|
|
switch (cachetype)
|
|
|
|
{
|
|
|
|
case ZR_CLASS_CACHE_ORIGINAL:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return strcopy(buffer, maxlen, ClassData[index][Class_ModelPath]);
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_MODIFIED:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return strcopy(buffer, maxlen, ClassDataCache[index][Class_ModelPath]);
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_PLAYER:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return strcopy(buffer, maxlen, ClassPlayerCache[index][Class_ModelPath]);
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the initial alpha value from the specified class.
|
|
|
|
*
|
|
|
|
* @param index Index of the class in a class cache or a client index,
|
|
|
|
* depending on the cache type specified.
|
|
|
|
* @param cachetype Optional. Specifies what class cache to read from. Options:
|
|
|
|
* ZR_CLASS_CACHE_ORIGINAL - Unchanced class data.
|
|
|
|
* ZR_CLASS_CACHE_MODIFIED - Changed/newest class data.
|
|
|
|
* ZR_CLASS_CACHE_PLAYER (default) - Player cache. If this one
|
|
|
|
* is used, index will be used as a client index.
|
|
|
|
* @return The initial alpha value from the specified class. -1 on error.
|
|
|
|
*/
|
2009-05-30 04:17:01 +02:00
|
|
|
stock ClassGetAlphaInitial(index, cachetype = ZR_CLASS_CACHE_PLAYER)
|
2009-04-06 03:20:13 +02:00
|
|
|
{
|
|
|
|
switch (cachetype)
|
|
|
|
{
|
|
|
|
case ZR_CLASS_CACHE_ORIGINAL:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassData[index][Class_AlphaInitial];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_MODIFIED:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassDataCache[index][Class_AlphaInitial];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_PLAYER:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassPlayerCache[index][Class_AlphaInitial];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the alpha value when damaged, from the specified class.
|
|
|
|
*
|
|
|
|
* @param index Index of the class in a class cache or a client index,
|
|
|
|
* depending on the cache type specified.
|
|
|
|
* @param cachetype Optional. Specifies what class cache to read from. Options:
|
|
|
|
* ZR_CLASS_CACHE_ORIGINAL - Unchanced class data.
|
|
|
|
* ZR_CLASS_CACHE_MODIFIED - Changed/newest class data.
|
|
|
|
* ZR_CLASS_CACHE_PLAYER (default) - Player cache. If this one
|
|
|
|
* is used, index will be used as a client index.
|
|
|
|
* @return The alpha value when damaged, from the specified class. -1 on
|
|
|
|
* error.
|
|
|
|
*/
|
2009-05-30 04:17:01 +02:00
|
|
|
stock ClassGetAlphaDamaged(index, cachetype = ZR_CLASS_CACHE_PLAYER)
|
2009-04-06 03:20:13 +02:00
|
|
|
{
|
|
|
|
switch (cachetype)
|
|
|
|
{
|
|
|
|
case ZR_CLASS_CACHE_ORIGINAL:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassData[index][Class_AlphaDamaged];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_MODIFIED:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassDataCache[index][Class_AlphaDamaged];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_PLAYER:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassPlayerCache[index][Class_AlphaDamaged];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the damage amount needed to change alpha, from the specified class.
|
|
|
|
*
|
|
|
|
* @param index Index of the class in a class cache or a client index,
|
|
|
|
* depending on the cache type specified.
|
|
|
|
* @param cachetype Optional. Specifies what class cache to read from. Options:
|
|
|
|
* ZR_CLASS_CACHE_ORIGINAL - Unchanced class data.
|
|
|
|
* ZR_CLASS_CACHE_MODIFIED - Changed/newest class data.
|
|
|
|
* ZR_CLASS_CACHE_PLAYER (default) - Player cache. If this one
|
|
|
|
* is used, index will be used as a client index.
|
|
|
|
* @return The damage amount needed to change alpha, from the specified class.
|
|
|
|
* -1 on error.
|
|
|
|
*/
|
2009-05-30 04:17:01 +02:00
|
|
|
stock ClassGetAlphaDamage(index, cachetype = ZR_CLASS_CACHE_PLAYER)
|
2009-04-06 03:20:13 +02:00
|
|
|
{
|
|
|
|
switch (cachetype)
|
|
|
|
{
|
|
|
|
case ZR_CLASS_CACHE_ORIGINAL:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassData[index][Class_AlphaDamage];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_MODIFIED:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassDataCache[index][Class_AlphaDamage];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_PLAYER:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassPlayerCache[index][Class_AlphaDamage];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* ------------------------------------
|
|
|
|
*
|
|
|
|
* HUD ATTRIBUTES
|
|
|
|
*
|
|
|
|
* ------------------------------------
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the overlay path from the specified class.
|
|
|
|
*
|
|
|
|
* @param index Index of the class in a class cache or a client index,
|
|
|
|
* depending on the cache type specified.
|
|
|
|
* @param buffer The destination string buffer.
|
|
|
|
* @param maxlen The length of the destination string buffer.
|
|
|
|
* @param cachetype Optional. Specifies what class cache to read from. Options:
|
|
|
|
* ZR_CLASS_CACHE_ORIGINAL - Unchanced class data.
|
|
|
|
* ZR_CLASS_CACHE_MODIFIED - Changed/newest class data.
|
|
|
|
* ZR_CLASS_CACHE_PLAYER (default) - Player cache. If this one
|
|
|
|
* is used, index will be used as a client index.
|
|
|
|
* @return Number of cells written. -1 on error.
|
|
|
|
*/
|
2009-05-30 04:17:01 +02:00
|
|
|
stock ClassGetOverlayPath(index, String:buffer[], maxlen, cachetype = ZR_CLASS_CACHE_PLAYER)
|
2009-04-06 03:20:13 +02:00
|
|
|
{
|
|
|
|
switch (cachetype)
|
|
|
|
{
|
|
|
|
case ZR_CLASS_CACHE_ORIGINAL:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return strcopy(buffer, maxlen, ClassData[index][Class_OverlayPath]);
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_MODIFIED:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return strcopy(buffer, maxlen, ClassDataCache[index][Class_OverlayPath]);
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_PLAYER:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return strcopy(buffer, maxlen, ClassPlayerCache[index][Class_OverlayPath]);
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the night vision setting from the specified class.
|
|
|
|
*
|
|
|
|
* @param index Index of the class in a class cache or a client index,
|
|
|
|
* depending on the cache type specified.
|
|
|
|
* @param cachetype Optional. Specifies what class cache to read from. Options:
|
|
|
|
* ZR_CLASS_CACHE_ORIGINAL - Unchanced class data.
|
|
|
|
* ZR_CLASS_CACHE_MODIFIED - Changed/newest class data.
|
|
|
|
* ZR_CLASS_CACHE_PLAYER (default) - Player cache. If this one
|
|
|
|
* is used, index will be used as a client index.
|
|
|
|
* @return The night vision setting from the specified class. False on error.
|
|
|
|
*/
|
2009-05-30 04:17:01 +02:00
|
|
|
stock bool:ClassGetNvgs(index, cachetype = ZR_CLASS_CACHE_PLAYER)
|
2009-04-06 03:20:13 +02:00
|
|
|
{
|
|
|
|
switch (cachetype)
|
|
|
|
{
|
|
|
|
case ZR_CLASS_CACHE_ORIGINAL:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassData[index][Class_Nvgs];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_MODIFIED:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassDataCache[index][Class_Nvgs];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_PLAYER:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassPlayerCache[index][Class_Nvgs];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the field of view value from the specified class.
|
|
|
|
*
|
|
|
|
* @param index Index of the class in a class cache or a client index,
|
|
|
|
* depending on the cache type specified.
|
|
|
|
* @param cachetype Optional. Specifies what class cache to read from. Options:
|
|
|
|
* ZR_CLASS_CACHE_ORIGINAL - Unchanced class data.
|
|
|
|
* ZR_CLASS_CACHE_MODIFIED - Changed/newest class data.
|
|
|
|
* ZR_CLASS_CACHE_PLAYER (default) - Player cache. If this one
|
|
|
|
* is used, index will be used as a client index.
|
|
|
|
* @return The field of view value from the specified class. -1 on error.
|
|
|
|
*/
|
2009-05-30 04:17:01 +02:00
|
|
|
stock ClassGetFOV(index, cachetype = ZR_CLASS_CACHE_PLAYER)
|
2009-04-06 03:20:13 +02:00
|
|
|
{
|
|
|
|
switch (cachetype)
|
|
|
|
{
|
|
|
|
case ZR_CLASS_CACHE_ORIGINAL:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassData[index][Class_Fov];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_MODIFIED:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassDataCache[index][Class_Fov];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_PLAYER:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassPlayerCache[index][Class_Fov];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* ------------------------------------
|
|
|
|
*
|
|
|
|
* EFFECTS
|
|
|
|
*
|
|
|
|
* ------------------------------------
|
|
|
|
*/
|
|
|
|
|
2009-06-14 19:10:30 +02:00
|
|
|
/**
|
|
|
|
* Gets the napalm setting from the specified class.
|
|
|
|
*
|
|
|
|
* @param index Index of the class in a class cache or a client index,
|
|
|
|
* depending on the cache type specified.
|
|
|
|
* @param cachetype Optional. Specifies what class cache to read from. Options:
|
|
|
|
* ZR_CLASS_CACHE_ORIGINAL - Unchanced class data.
|
|
|
|
* ZR_CLASS_CACHE_MODIFIED - Changed/newest class data.
|
|
|
|
* ZR_CLASS_CACHE_PLAYER (default) - Player cache. If this one
|
|
|
|
* is used, index will be used as a client index.
|
|
|
|
* @return True if the class has napalm grenades, false otherwise.
|
|
|
|
*/
|
|
|
|
stock bool:ClassGetHasNapalm(index, cachetype = ZR_CLASS_CACHE_PLAYER)
|
|
|
|
{
|
|
|
|
switch (cachetype)
|
|
|
|
{
|
|
|
|
case ZR_CLASS_CACHE_ORIGINAL:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassData[index][Class_HasNapalm];
|
2009-06-14 19:10:30 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_MODIFIED:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassDataCache[index][Class_HasNapalm];
|
2009-06-14 19:10:30 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_PLAYER:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassPlayerCache[index][Class_HasNapalm];
|
2009-06-14 19:10:30 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2009-04-06 03:20:13 +02:00
|
|
|
/**
|
|
|
|
* Gets the napalm grenades time from the specified class.
|
|
|
|
*
|
2009-06-18 02:09:55 +02:00
|
|
|
* Note: Multiplier is used if cache type is player cache.
|
|
|
|
*
|
2009-04-06 03:20:13 +02:00
|
|
|
* @param index Index of the class in a class cache or a client index,
|
|
|
|
* depending on the cache type specified.
|
|
|
|
* @param cachetype Optional. Specifies what class cache to read from. Options:
|
|
|
|
* ZR_CLASS_CACHE_ORIGINAL - Unchanced class data.
|
|
|
|
* ZR_CLASS_CACHE_MODIFIED - Changed/newest class data.
|
|
|
|
* ZR_CLASS_CACHE_PLAYER (default) - Player cache. If this one
|
|
|
|
* is used, index will be used as a client index.
|
|
|
|
* @return The napalm grenades time from the specified class. -1.0 on error.
|
|
|
|
*/
|
2009-05-30 04:17:01 +02:00
|
|
|
stock Float:ClassGetNapalmTime(index, cachetype = ZR_CLASS_CACHE_PLAYER)
|
2009-04-06 03:20:13 +02:00
|
|
|
{
|
|
|
|
switch (cachetype)
|
|
|
|
{
|
|
|
|
case ZR_CLASS_CACHE_ORIGINAL:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassData[index][Class_NapalmTime];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_MODIFIED:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassDataCache[index][Class_NapalmTime];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_PLAYER:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassPlayerCache[index][Class_NapalmTime] * ClassGetAttributeMultiplier(index, ClassM_NapalmTime);
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return -1.0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* ------------------------------------
|
|
|
|
*
|
|
|
|
* PLAYER BEHAVIOUR
|
|
|
|
*
|
|
|
|
* ------------------------------------
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the immunity mode to the specified class.
|
|
|
|
*
|
|
|
|
* @param index Index of the class in a class cache or a client index,
|
|
|
|
* depending on the cache type specified.
|
|
|
|
* @param cachetype Optional. Specifies what class cache to read from. Options:
|
|
|
|
* ZR_CLASS_CACHE_ORIGINAL - Unchanced class data.
|
|
|
|
* ZR_CLASS_CACHE_MODIFIED - Changed/newest class data.
|
|
|
|
* ZR_CLASS_CACHE_PLAYER (default) - Player cache. If this one
|
|
|
|
* is used, index will be used as a client index.
|
|
|
|
* @return Current immunity mode to the specified class. -1 on error.
|
|
|
|
*/
|
2009-05-30 04:17:01 +02:00
|
|
|
stock ClassGetImmunityMode(index, cachetype = ZR_CLASS_CACHE_PLAYER)
|
2009-04-06 03:20:13 +02:00
|
|
|
{
|
|
|
|
switch (cachetype)
|
|
|
|
{
|
|
|
|
case ZR_CLASS_CACHE_ORIGINAL:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassData[index][Class_ImmunityMode];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_MODIFIED:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassDataCache[index][Class_ImmunityMode];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_PLAYER:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassPlayerCache[index][Class_ImmunityMode];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the immunity amount to the specified class.
|
|
|
|
*
|
|
|
|
* @param index Index of the class in a class cache or a client index,
|
|
|
|
* depending on the cache type specified.
|
|
|
|
* @param cachetype Optional. Specifies what class cache to read from. Options:
|
|
|
|
* ZR_CLASS_CACHE_ORIGINAL - Unchanced class data.
|
|
|
|
* ZR_CLASS_CACHE_MODIFIED - Changed/newest class data.
|
|
|
|
* ZR_CLASS_CACHE_PLAYER (default) - Player cache. If this one
|
|
|
|
* is used, index will be used as a client index.
|
|
|
|
* @return Current immunity amount to the specified class. -1.0 on error.
|
|
|
|
*/
|
2009-05-30 04:17:01 +02:00
|
|
|
stock Float:ClassGetImmunityAmount(index, cachetype = ZR_CLASS_CACHE_PLAYER)
|
2009-04-06 03:20:13 +02:00
|
|
|
{
|
|
|
|
switch (cachetype)
|
|
|
|
{
|
|
|
|
case ZR_CLASS_CACHE_ORIGINAL:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassData[index][Class_ImmunityAmount];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_MODIFIED:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassDataCache[index][Class_ImmunityAmount];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_PLAYER:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassPlayerCache[index][Class_ImmunityAmount];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return -1.0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the no fall damage setting from the specified class.
|
|
|
|
*
|
|
|
|
* @param index Index of the class in a class cache or a client index,
|
|
|
|
* depending on the cache type specified.
|
|
|
|
* @param cachetype Optional. Specifies what class cache to read from. Options:
|
|
|
|
* ZR_CLASS_CACHE_ORIGINAL - Unchanced class data.
|
|
|
|
* ZR_CLASS_CACHE_MODIFIED - Changed/newest class data.
|
|
|
|
* ZR_CLASS_CACHE_PLAYER (default) - Player cache. If this one
|
|
|
|
* is used, index will be used as a client index.
|
|
|
|
* @return The no fall damage setting from the specified class. False on
|
|
|
|
* error.
|
|
|
|
*/
|
2009-05-30 04:17:01 +02:00
|
|
|
stock bool:ClassGetNoFallDamage(index, cachetype = ZR_CLASS_CACHE_PLAYER)
|
2009-04-06 03:20:13 +02:00
|
|
|
{
|
|
|
|
switch (cachetype)
|
|
|
|
{
|
|
|
|
case ZR_CLASS_CACHE_ORIGINAL:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassData[index][Class_NoFallDamage];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_MODIFIED:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassDataCache[index][Class_NoFallDamage];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_PLAYER:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassPlayerCache[index][Class_NoFallDamage];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the health points from the specified class.
|
|
|
|
*
|
2009-06-18 02:09:55 +02:00
|
|
|
* Note: Multiplier is used if cache type is player cache.
|
|
|
|
*
|
2009-04-06 03:20:13 +02:00
|
|
|
* @param index Index of the class in a class cache or a client index,
|
|
|
|
* depending on the cache type specified.
|
|
|
|
* @param cachetype Optional. Specifies what class cache to read from. Options:
|
|
|
|
* ZR_CLASS_CACHE_ORIGINAL - Unchanced class data.
|
|
|
|
* ZR_CLASS_CACHE_MODIFIED - Changed/newest class data.
|
|
|
|
* ZR_CLASS_CACHE_PLAYER (default) - Player cache. If this one
|
|
|
|
* is used, index will be used as a client index.
|
|
|
|
* @return Health points from the specified class. -1 on error.
|
|
|
|
*/
|
2009-05-30 04:17:01 +02:00
|
|
|
stock ClassGetHealth(index, cachetype = ZR_CLASS_CACHE_PLAYER)
|
2009-04-06 03:20:13 +02:00
|
|
|
{
|
|
|
|
switch (cachetype)
|
|
|
|
{
|
|
|
|
case ZR_CLASS_CACHE_ORIGINAL:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassData[index][Class_Health];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_MODIFIED:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassDataCache[index][Class_Health];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_PLAYER:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return RoundToCeil(ClassPlayerCache[index][Class_Health] * ClassGetAttributeMultiplier(index, ClassM_Health));
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the health regen interval time from the specified class.
|
|
|
|
*
|
2009-06-18 02:09:55 +02:00
|
|
|
* Note: Multiplier is used if cache type is player cache.
|
|
|
|
*
|
2009-04-06 03:20:13 +02:00
|
|
|
* @param index Index of the class in a class cache or a client index,
|
|
|
|
* depending on the cache type specified.
|
|
|
|
* @param cachetype Optional. Specifies what class cache to read from. Options:
|
|
|
|
* ZR_CLASS_CACHE_ORIGINAL - Unchanced class data.
|
|
|
|
* ZR_CLASS_CACHE_MODIFIED - Changed/newest class data.
|
|
|
|
* ZR_CLASS_CACHE_PLAYER (default) - Player cache. If this one
|
|
|
|
* is used, index will be used as a client index.
|
|
|
|
* @return The health regen interval time from the specified class. -1.0 on
|
|
|
|
* error.
|
|
|
|
*/
|
2009-05-30 04:17:01 +02:00
|
|
|
stock Float:ClassGetHealthRegenInterval(index, cachetype = ZR_CLASS_CACHE_PLAYER)
|
2009-04-06 03:20:13 +02:00
|
|
|
{
|
|
|
|
switch (cachetype)
|
|
|
|
{
|
|
|
|
case ZR_CLASS_CACHE_ORIGINAL:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassData[index][Class_HealthRegenInterval];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_MODIFIED:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassDataCache[index][Class_HealthRegenInterval];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_PLAYER:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassPlayerCache[index][Class_HealthRegenInterval] * ClassGetAttributeMultiplier(index, ClassM_HealthRegenInterval);
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return -1.0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the health regen amount value from the specified class.
|
|
|
|
*
|
2009-06-18 02:09:55 +02:00
|
|
|
* Note: Multiplier is used if cache type is player cache.
|
|
|
|
*
|
2009-04-06 03:20:13 +02:00
|
|
|
* @param index Index of the class in a class cache or a client index,
|
|
|
|
* depending on the cache type specified.
|
|
|
|
* @param cachetype Optional. Specifies what class cache to read from. Options:
|
|
|
|
* ZR_CLASS_CACHE_ORIGINAL - Unchanced class data.
|
|
|
|
* ZR_CLASS_CACHE_MODIFIED - Changed/newest class data.
|
|
|
|
* ZR_CLASS_CACHE_PLAYER (default) - Player cache. If this one
|
|
|
|
* is used, index will be used as a client index.
|
|
|
|
* @return The health regen amount value from the specified class. -1 on
|
|
|
|
* error.
|
|
|
|
*/
|
2009-05-30 04:17:01 +02:00
|
|
|
stock ClassGetHealthRegenAmount(index, cachetype = ZR_CLASS_CACHE_PLAYER)
|
2009-04-06 03:20:13 +02:00
|
|
|
{
|
|
|
|
switch (cachetype)
|
|
|
|
{
|
|
|
|
case ZR_CLASS_CACHE_ORIGINAL:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassData[index][Class_HealthRegenAmount];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_MODIFIED:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassDataCache[index][Class_HealthRegenAmount];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_PLAYER:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return RoundToCeil(ClassPlayerCache[index][Class_HealthRegenAmount] * ClassGetAttributeMultiplier(index, ClassM_HealthRegenAmount));
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the health infect gain value from the specified class.
|
|
|
|
*
|
2009-06-18 02:09:55 +02:00
|
|
|
* Note: Multiplier is used if cache type is player cache.
|
|
|
|
*
|
2009-04-06 03:20:13 +02:00
|
|
|
* @param index Index of the class in a class cache or a client index,
|
|
|
|
* depending on the cache type specified.
|
|
|
|
* @param cachetype Optional. Specifies what class cache to read from. Options:
|
|
|
|
* ZR_CLASS_CACHE_ORIGINAL - Unchanced class data.
|
|
|
|
* ZR_CLASS_CACHE_MODIFIED - Changed/newest class data.
|
|
|
|
* ZR_CLASS_CACHE_PLAYER (default) - Player cache. If this one
|
|
|
|
* is used, index will be used as a client index.
|
|
|
|
* @return The health infect gain value from the specified class. -1 on
|
|
|
|
* error.
|
|
|
|
*/
|
2009-05-30 04:17:01 +02:00
|
|
|
stock ClassGetHealthInfectGain(index, cachetype = ZR_CLASS_CACHE_PLAYER)
|
2009-04-06 03:20:13 +02:00
|
|
|
{
|
|
|
|
switch (cachetype)
|
|
|
|
{
|
|
|
|
case ZR_CLASS_CACHE_ORIGINAL:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassData[index][Class_HealthInfectGain];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_MODIFIED:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassDataCache[index][Class_HealthInfectGain];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_PLAYER:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return RoundToCeil(ClassPlayerCache[index][Class_HealthInfectGain] * ClassGetAttributeMultiplier(index, ClassM_HealthInfectGain));
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the kill bonus points from the specified class.
|
|
|
|
*
|
|
|
|
* @param index Index of the class in a class cache or a client index,
|
|
|
|
* depending on the cache type specified.
|
|
|
|
* @param cachetype Optional. Specifies what class cache to read from. Options:
|
|
|
|
* ZR_CLASS_CACHE_ORIGINAL - Unchanced class data.
|
|
|
|
* ZR_CLASS_CACHE_MODIFIED - Changed/newest class data.
|
|
|
|
* ZR_CLASS_CACHE_PLAYER (default) - Player cache. If this one
|
|
|
|
* is used, index will be used as a client index.
|
|
|
|
* @return The kill bonus points from the specified class.
|
|
|
|
*/
|
2009-05-30 04:17:01 +02:00
|
|
|
stock ClassGetKillBonus(index, cachetype = ZR_CLASS_CACHE_PLAYER)
|
2009-04-06 03:20:13 +02:00
|
|
|
{
|
|
|
|
switch (cachetype)
|
|
|
|
{
|
|
|
|
case ZR_CLASS_CACHE_ORIGINAL:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassData[index][Class_KillBonus];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_MODIFIED:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassDataCache[index][Class_KillBonus];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_PLAYER:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassPlayerCache[index][Class_KillBonus];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the running speed value from the specified class.
|
|
|
|
*
|
2009-06-18 02:09:55 +02:00
|
|
|
* Note: Multiplier is used if cache type is player cache.
|
|
|
|
*
|
2009-04-06 03:20:13 +02:00
|
|
|
* @param index Index of the class in a class cache or a client index,
|
|
|
|
* depending on the cache type specified.
|
|
|
|
* @param cachetype Optional. Specifies what class cache to read from. Options:
|
|
|
|
* ZR_CLASS_CACHE_ORIGINAL - Unchanced class data.
|
|
|
|
* ZR_CLASS_CACHE_MODIFIED - Changed/newest class data.
|
|
|
|
* ZR_CLASS_CACHE_PLAYER (default) - Player cache. If this one
|
|
|
|
* is used, index will be used as a client index.
|
|
|
|
* @return The running speed value from the specified class. -1.0 on error.
|
|
|
|
*/
|
2009-05-30 04:17:01 +02:00
|
|
|
stock Float:ClassGetSpeed(index, cachetype = ZR_CLASS_CACHE_PLAYER)
|
2009-04-06 03:20:13 +02:00
|
|
|
{
|
|
|
|
switch (cachetype)
|
|
|
|
{
|
|
|
|
case ZR_CLASS_CACHE_ORIGINAL:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassData[index][Class_Speed];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_MODIFIED:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassDataCache[index][Class_Speed];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_PLAYER:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassPlayerCache[index][Class_Speed] * ClassGetAttributeMultiplier(index, ClassM_Speed);
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return -1.0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the knock back boost from the specified class.
|
|
|
|
*
|
2009-06-18 02:09:55 +02:00
|
|
|
* Note: Multiplier is used if cache type is player cache.
|
|
|
|
*
|
2009-04-06 03:20:13 +02:00
|
|
|
* @param index Index of the class in a class cache or a client index,
|
|
|
|
* depending on the cache type specified.
|
|
|
|
* @param cachetype Optional. Specifies what class cache to read from. Options:
|
|
|
|
* ZR_CLASS_CACHE_ORIGINAL - Unchanced class data.
|
|
|
|
* ZR_CLASS_CACHE_MODIFIED - Changed/newest class data.
|
|
|
|
* ZR_CLASS_CACHE_PLAYER (default) - Player cache. If this one
|
|
|
|
* is used, index will be used as a client index.
|
|
|
|
* @return The knock back boost from the specified class. 0.0 on error.
|
|
|
|
*/
|
2009-05-30 04:17:01 +02:00
|
|
|
stock Float:ClassGetKnockback(index, cachetype = ZR_CLASS_CACHE_PLAYER)
|
2009-04-06 03:20:13 +02:00
|
|
|
{
|
|
|
|
switch (cachetype)
|
|
|
|
{
|
|
|
|
case ZR_CLASS_CACHE_ORIGINAL:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassData[index][Class_KnockBack];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_MODIFIED:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassDataCache[index][Class_KnockBack];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_PLAYER:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassPlayerCache[index][Class_KnockBack] * ClassGetAttributeMultiplier(index, ClassM_Knockback);
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0.0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the jump height boost from the specified class.
|
|
|
|
*
|
2009-06-18 02:09:55 +02:00
|
|
|
* Note: Multiplier is used if cache type is player cache.
|
|
|
|
*
|
2009-04-06 03:20:13 +02:00
|
|
|
* @param index Index of the class in a class cache or a client index,
|
|
|
|
* depending on the cache type specified.
|
|
|
|
* @param cachetype Optional. Specifies what class cache to read from. Options:
|
|
|
|
* ZR_CLASS_CACHE_ORIGINAL - Unchanced class data.
|
|
|
|
* ZR_CLASS_CACHE_MODIFIED - Changed/newest class data.
|
|
|
|
* ZR_CLASS_CACHE_PLAYER (default) - Player cache. If this one
|
|
|
|
* is used, index will be used as a client index.
|
|
|
|
* @return The jump height boost from the specified class. -1.0 on error.
|
|
|
|
*/
|
2009-05-30 04:17:01 +02:00
|
|
|
stock Float:ClassGetJumpHeight(index, cachetype = ZR_CLASS_CACHE_PLAYER)
|
2009-04-06 03:20:13 +02:00
|
|
|
{
|
|
|
|
switch (cachetype)
|
|
|
|
{
|
|
|
|
case ZR_CLASS_CACHE_ORIGINAL:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassData[index][Class_JumpHeight];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_MODIFIED:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassDataCache[index][Class_JumpHeight];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_PLAYER:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassPlayerCache[index][Class_JumpHeight] * ClassGetAttributeMultiplier(index, ClassM_JumpHeight);
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return -1.0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the jump distance boost from the specified class.
|
|
|
|
*
|
2009-06-18 02:09:55 +02:00
|
|
|
* Note: Multiplier is used if cache type is player cache.
|
|
|
|
*
|
2009-04-06 03:20:13 +02:00
|
|
|
* @param index Index of the class in a class cache or a client index,
|
|
|
|
* depending on the cache type specified.
|
|
|
|
* @param cachetype Optional. Specifies what class cache to read from. Options:
|
|
|
|
* ZR_CLASS_CACHE_ORIGINAL - Unchanced class data.
|
|
|
|
* ZR_CLASS_CACHE_MODIFIED - Changed/newest class data.
|
|
|
|
* ZR_CLASS_CACHE_PLAYER (default) - Player cache. If this one
|
|
|
|
* is used, index will be used as a client index.
|
|
|
|
* @return The jump distance boost from the specified class. -1.0 on error.
|
|
|
|
*/
|
2009-05-30 04:17:01 +02:00
|
|
|
stock Float:ClassGetJumpDistance(index, cachetype = ZR_CLASS_CACHE_PLAYER)
|
2009-04-06 03:20:13 +02:00
|
|
|
{
|
|
|
|
switch (cachetype)
|
|
|
|
{
|
|
|
|
case ZR_CLASS_CACHE_ORIGINAL:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassData[index][Class_JumpDistance];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_MODIFIED:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassDataCache[index][Class_JumpDistance];
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
case ZR_CLASS_CACHE_PLAYER:
|
|
|
|
{
|
2009-08-13 18:31:21 +02:00
|
|
|
return ClassPlayerCache[index][Class_JumpDistance] * ClassGetAttributeMultiplier(index, ClassM_JumpDistance);
|
2009-04-06 03:20:13 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return -1.0;
|
|
|
|
}
|
2009-05-10 18:49:47 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the attribute flag that represent the specified attribute.
|
|
|
|
*
|
|
|
|
* @param attributename The attribute name.
|
2009-06-18 02:09:55 +02:00
|
|
|
* @return The flag that represent the specified attribute.
|
2009-05-10 18:49:47 +02:00
|
|
|
* -1 on error.
|
|
|
|
*/
|
2009-05-30 04:17:01 +02:00
|
|
|
stock ClassAttributeNameToFlag(const String:attributename[])
|
2009-05-10 18:49:47 +02:00
|
|
|
{
|
|
|
|
// Check attribute names.
|
|
|
|
if (StrEqual(attributename, "enabled", false))
|
|
|
|
{
|
2009-06-22 01:09:51 +02:00
|
|
|
return ZR_CLASS_ENABLED;
|
2009-05-10 18:49:47 +02:00
|
|
|
}
|
|
|
|
else if (StrEqual(attributename, "team", false))
|
|
|
|
{
|
2009-06-22 01:09:51 +02:00
|
|
|
return ZR_CLASS_TEAM;
|
2009-05-10 18:49:47 +02:00
|
|
|
}
|
|
|
|
else if (StrEqual(attributename, "team_default", false))
|
|
|
|
{
|
2009-06-22 01:09:51 +02:00
|
|
|
return ZR_CLASS_TEAM_DEFAULT;
|
2009-05-10 18:49:47 +02:00
|
|
|
}
|
2009-06-22 01:09:51 +02:00
|
|
|
else if (StrEqual(attributename, "flags", false))
|
2009-06-19 02:31:05 +02:00
|
|
|
{
|
2009-06-22 01:09:51 +02:00
|
|
|
return ZR_CLASS_FLAGS;
|
2009-06-19 02:31:05 +02:00
|
|
|
}
|
2009-08-13 18:31:21 +02:00
|
|
|
else if (StrEqual(attributename, "group", false))
|
|
|
|
{
|
|
|
|
return ZR_CLASS_GROUP;
|
|
|
|
}
|
2009-05-10 18:49:47 +02:00
|
|
|
else if (StrEqual(attributename, "name", false))
|
|
|
|
{
|
2009-06-22 01:09:51 +02:00
|
|
|
return ZR_CLASS_NAME;
|
2009-05-10 18:49:47 +02:00
|
|
|
}
|
|
|
|
else if (StrEqual(attributename, "description", false))
|
|
|
|
{
|
2009-06-22 01:09:51 +02:00
|
|
|
return ZR_CLASS_DESCRIPTION;
|
2009-05-10 18:49:47 +02:00
|
|
|
}
|
|
|
|
else if (StrEqual(attributename, "model_path", false))
|
|
|
|
{
|
2009-06-22 01:09:51 +02:00
|
|
|
return ZR_CLASS_MODEL_PATH;
|
2009-05-10 18:49:47 +02:00
|
|
|
}
|
|
|
|
else if (StrEqual(attributename, "alpha_initial", false))
|
|
|
|
{
|
2009-06-22 01:09:51 +02:00
|
|
|
return ZR_CLASS_ALPHA_INITIAL;
|
2009-05-10 18:49:47 +02:00
|
|
|
}
|
|
|
|
else if (StrEqual(attributename, "alpha_damaged", false))
|
|
|
|
{
|
2009-06-22 01:09:51 +02:00
|
|
|
return ZR_CLASS_ALPHA_DAMAGED;
|
2009-05-10 18:49:47 +02:00
|
|
|
}
|
|
|
|
else if (StrEqual(attributename, "alpha_damage", false))
|
|
|
|
{
|
2009-06-22 01:09:51 +02:00
|
|
|
return ZR_CLASS_ALPHA_DAMAGE;
|
2009-05-10 18:49:47 +02:00
|
|
|
}
|
|
|
|
else if (StrEqual(attributename, "overlay_path", false))
|
|
|
|
{
|
2009-06-22 01:09:51 +02:00
|
|
|
return ZR_CLASS_OVERLAY_PATH;
|
2009-05-10 18:49:47 +02:00
|
|
|
}
|
|
|
|
else if (StrEqual(attributename, "nvgs", false))
|
|
|
|
{
|
2009-06-22 01:09:51 +02:00
|
|
|
return ZR_CLASS_NVGS;
|
2009-05-10 18:49:47 +02:00
|
|
|
}
|
|
|
|
else if (StrEqual(attributename, "fov", false))
|
|
|
|
{
|
2009-06-22 01:09:51 +02:00
|
|
|
return ZR_CLASS_FOV;
|
|
|
|
}
|
|
|
|
else if (StrEqual(attributename, "has_napalm", false))
|
|
|
|
{
|
|
|
|
return ZR_CLASS_HAS_NAPALM;
|
2009-05-10 18:49:47 +02:00
|
|
|
}
|
|
|
|
else if (StrEqual(attributename, "napalm_time", false))
|
|
|
|
{
|
2009-06-22 01:09:51 +02:00
|
|
|
return ZR_CLASS_NAPALM_TIME;
|
2009-05-10 18:49:47 +02:00
|
|
|
}
|
|
|
|
else if (StrEqual(attributename, "immunity_mode", false))
|
|
|
|
{
|
2009-06-22 01:09:51 +02:00
|
|
|
return ZR_CLASS_IMMUNITY_MODE;
|
2009-05-10 18:49:47 +02:00
|
|
|
}
|
|
|
|
else if (StrEqual(attributename, "immunity_amount", false))
|
|
|
|
{
|
2009-06-22 01:09:51 +02:00
|
|
|
return ZR_CLASS_IMMUNITY_AMOUNT;
|
2009-05-10 18:49:47 +02:00
|
|
|
}
|
|
|
|
else if (StrEqual(attributename, "no_fall_damage", false))
|
|
|
|
{
|
2009-06-22 01:09:51 +02:00
|
|
|
return ZR_CLASS_NO_FALL_DAMAGE;
|
2009-05-10 18:49:47 +02:00
|
|
|
}
|
|
|
|
else if (StrEqual(attributename, "health", false))
|
|
|
|
{
|
2009-06-22 01:09:51 +02:00
|
|
|
return ZR_CLASS_HEALTH;
|
2009-05-10 18:49:47 +02:00
|
|
|
}
|
|
|
|
else if (StrEqual(attributename, "health_regen_interval", false))
|
|
|
|
{
|
2009-06-22 01:09:51 +02:00
|
|
|
return ZR_CLASS_HEALTH_REGEN_INTERVAL;
|
2009-05-10 18:49:47 +02:00
|
|
|
}
|
|
|
|
else if (StrEqual(attributename, "health_regen_amount", false))
|
|
|
|
{
|
2009-06-22 01:09:51 +02:00
|
|
|
return ZR_CLASS_HEALTH_REGEN_AMOUNT;
|
2009-05-10 18:49:47 +02:00
|
|
|
}
|
|
|
|
else if (StrEqual(attributename, "health_infect_gain", false))
|
|
|
|
{
|
2009-06-22 01:09:51 +02:00
|
|
|
return ZR_CLASS_HEALTH_INFECT_GAIN;
|
2009-05-10 18:49:47 +02:00
|
|
|
}
|
|
|
|
else if (StrEqual(attributename, "kill_bonus", false))
|
|
|
|
{
|
2009-06-22 01:09:51 +02:00
|
|
|
return ZR_CLASS_KILL_BONUS;
|
2009-05-10 18:49:47 +02:00
|
|
|
}
|
|
|
|
else if (StrEqual(attributename, "speed", false))
|
|
|
|
{
|
2009-06-22 01:09:51 +02:00
|
|
|
return ZR_CLASS_SPEED;
|
2009-05-10 18:49:47 +02:00
|
|
|
}
|
|
|
|
else if (StrEqual(attributename, "knockback", false))
|
|
|
|
{
|
2009-06-22 01:09:51 +02:00
|
|
|
return ZR_CLASS_KNOCKBACK;
|
2009-05-10 18:49:47 +02:00
|
|
|
}
|
|
|
|
else if (StrEqual(attributename, "jump_height", false))
|
|
|
|
{
|
2009-06-22 01:09:51 +02:00
|
|
|
return ZR_CLASS_JUMP_HEIGHT;
|
2009-05-10 18:49:47 +02:00
|
|
|
}
|
|
|
|
else if (StrEqual(attributename, "jump_distance", false))
|
|
|
|
{
|
2009-06-22 01:09:51 +02:00
|
|
|
return ZR_CLASS_JUMP_DISTANCE;
|
2009-05-10 18:49:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Invalid attribute name.
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2009-06-18 02:09:55 +02:00
|
|
|
/**
|
|
|
|
* Converts a attribute name to a multiplier type.
|
|
|
|
*
|
|
|
|
* @param attributename The attribute name.
|
|
|
|
* @return The multiplier that represent the specified attribute.
|
|
|
|
* ClassM_Invalid if failed.
|
|
|
|
*/
|
|
|
|
stock ClassMultipliers:ClassAttributeNameToMultiplier(const String:attributename[])
|
|
|
|
{
|
|
|
|
// Check attribute names.
|
|
|
|
if (StrEqual(attributename, "napalm_time", false))
|
|
|
|
{
|
|
|
|
return ClassM_NapalmTime;
|
|
|
|
}
|
|
|
|
else if (StrEqual(attributename, "health", false))
|
|
|
|
{
|
|
|
|
return ClassM_Health;
|
|
|
|
}
|
|
|
|
else if (StrEqual(attributename, "health_regen_interval", false))
|
|
|
|
{
|
|
|
|
return ClassM_HealthRegenInterval;
|
|
|
|
}
|
2009-07-25 00:36:49 +02:00
|
|
|
else if (StrEqual(attributename, "health_regen_amount", false))
|
2009-06-18 02:09:55 +02:00
|
|
|
{
|
|
|
|
return ClassM_HealthRegenAmount;
|
|
|
|
}
|
|
|
|
else if (StrEqual(attributename, "health_infect_gain", false))
|
|
|
|
{
|
|
|
|
return ClassM_HealthInfectGain;
|
|
|
|
}
|
|
|
|
else if (StrEqual(attributename, "speed", false))
|
|
|
|
{
|
|
|
|
return ClassM_Speed;
|
|
|
|
}
|
|
|
|
else if (StrEqual(attributename, "knockback", false))
|
|
|
|
{
|
|
|
|
return ClassM_Knockback;
|
|
|
|
}
|
|
|
|
else if (StrEqual(attributename, "jump_height", false))
|
|
|
|
{
|
|
|
|
return ClassM_JumpHeight;
|
|
|
|
}
|
|
|
|
else if (StrEqual(attributename, "jump_distance", false))
|
|
|
|
{
|
|
|
|
return ClassM_JumpDistance;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Invalid attribute name or not a multiplier.
|
|
|
|
return ClassM_Invalid;
|
|
|
|
}
|
|
|
|
|
2009-05-10 18:49:47 +02:00
|
|
|
/**
|
|
|
|
* Returns the datatype used in the specified attribute.
|
|
|
|
*
|
|
|
|
* @param attributeflag A flag specifying the attribute to check.
|
|
|
|
* @return The data type used in the specified attribute, or
|
|
|
|
* ClassType_InvalidType if failed.
|
|
|
|
*/
|
2009-05-30 04:17:01 +02:00
|
|
|
stock ClassDataTypes:ClassGetAttributeType(attributeflag)
|
2009-05-10 18:49:47 +02:00
|
|
|
{
|
|
|
|
switch (attributeflag)
|
|
|
|
{
|
|
|
|
// Boolean.
|
2009-06-22 01:09:51 +02:00
|
|
|
case ZR_CLASS_ENABLED,
|
|
|
|
ZR_CLASS_NVGS,
|
|
|
|
ZR_CLASS_HAS_NAPALM,
|
|
|
|
ZR_CLASS_NO_FALL_DAMAGE:
|
2009-05-10 18:49:47 +02:00
|
|
|
{
|
|
|
|
return ClassDataType_Boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Integer.
|
2009-06-22 01:09:51 +02:00
|
|
|
case ZR_CLASS_FLAGS,
|
|
|
|
ZR_CLASS_ALPHA_INITIAL,
|
|
|
|
ZR_CLASS_ALPHA_DAMAGED,
|
|
|
|
ZR_CLASS_ALPHA_DAMAGE,
|
|
|
|
ZR_CLASS_FOV,
|
|
|
|
ZR_CLASS_IMMUNITY_MODE,
|
|
|
|
ZR_CLASS_HEALTH,
|
|
|
|
ZR_CLASS_HEALTH_REGEN_AMOUNT,
|
|
|
|
ZR_CLASS_HEALTH_INFECT_GAIN,
|
|
|
|
ZR_CLASS_KILL_BONUS:
|
2009-05-10 18:49:47 +02:00
|
|
|
{
|
|
|
|
return ClassDataType_Integer;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Float.
|
2009-06-22 01:09:51 +02:00
|
|
|
case ZR_CLASS_NAPALM_TIME,
|
|
|
|
ZR_CLASS_IMMUNITY_AMOUNT,
|
|
|
|
ZR_CLASS_HEALTH_REGEN_INTERVAL,
|
|
|
|
ZR_CLASS_SPEED,
|
|
|
|
ZR_CLASS_KNOCKBACK,
|
|
|
|
ZR_CLASS_JUMP_HEIGHT,
|
|
|
|
ZR_CLASS_JUMP_DISTANCE:
|
2009-05-10 18:49:47 +02:00
|
|
|
{
|
|
|
|
return ClassDataType_Float;
|
|
|
|
}
|
|
|
|
|
|
|
|
// String.
|
2009-08-13 18:31:21 +02:00
|
|
|
case ZR_CLASS_GROUP,
|
|
|
|
ZR_CLASS_NAME,
|
2009-06-22 01:09:51 +02:00
|
|
|
ZR_CLASS_DESCRIPTION,
|
|
|
|
ZR_CLASS_MODEL_PATH,
|
|
|
|
ZR_CLASS_OVERLAY_PATH:
|
2009-05-10 18:49:47 +02:00
|
|
|
{
|
|
|
|
return ClassDataType_String;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Invalid flag or multiple flags combined.
|
|
|
|
return ClassDataType_InvalidType;
|
|
|
|
}
|