Вариант 1:
Код
effect MoraleBonus (effect eEffect)
{
eEffect = SetEffectSpellId (eEffect, 1600);
return eEffect;
}
{
eEffect = SetEffectSpellId (eEffect, 1600);
return eEffect;
}
Вариант 2 - хранение переменных/массивов на объекте-цели или в БД.
Вопрос - как сделать все так, чтобы и диспелл был меньше, чем на 20 страниц кода и длительность нескольких разных спеллов с одноименными эффектами выверялась нормально?
P.S. только что задумался о создании динамического списка на модуле...
Если что, у нас есть еще вот такой список своих функций:
void AppendArrayInt(object obj,string bufName,int value);
int GetArrayInt(object obj,string bufName,int index);
void SetArrayInt(object obj,string bufName,int index,int value);
void AppendArrayLoc(object obj,string bufName,location value);
location GetArrayLoc(object obj,string bufName,int index);
void SetArrayLoc(object obj,string bufName,int index,location value);
void AppendArrayString(object obj,string bufName,string value);
string GetArrayString(object obj,string bufName,int index);
void SetArrayString(object obj,string bufName,int index,string value);
void AppendArrayFloat(object obj,string bufName,float value);
float GetArrayFloat(object obj,string bufName,int index);
void SetArrayFloat(object obj,string bufName,int index,float value);
void AppendArrayObject(object obj,string bufName,object value);
object GetArrayObject(object obj,string bufName,int index);
void SetArrayObject(object obj,string bufName,int index,object value);
void DestroyArray(object obj,string bufName,int type=tINT);
int IsArraySet(object obj,string bufName);
int GetArrayIdxCount(object obj,string bufName);
void DestroyArrayIdx(object obj,string bufName,int index,int type=tINT);
int Split(object obj,string str,string bufName,int type=tSTR,string separator=",");
int SplitCount(string str,string separator=",");
void OutputArray(object obj,string bufName,int type,object oPC=OBJECT_INVALID);
void CreateMatrix(object obj,string bufName,int width,int height);
void DeleteMatrix(object obj,string bufName,int type=tINT);
void ExpandMatrix(object obj,string bufName,int xcount,int ycount);
int GetMatrixInt(object obj,string bufName,int x,int y);
string GetMatrixString(object obj,string bufName,int x,int y);
float GetMatrixFloat(object obj,string bufName,int x,int y);
object GetMatrixObject(object obj,string bufName,int x,int y);
void SetMatrixInt(object obj,string bufName,int x,int y,int value);
void SetMatrixString(object obj,string bufName,int x,int y, string value);
void SetMatrixFloat(object obj,string bufName,int x,int y,float value);
void SetMatrixObject(object obj,string bufName,int x,int y,object value);