-- Update --
Achei a classe da cronica Ertheia que tem essa function, o arquivo se chama DamageText.uc e tb leva functions de GfxDialog mas na hora de compilar ele da error, deixo aqui o code da function de Damage clear
//------------------------------------------------------------------------------------------------------------------------
//
// : DamageText - SCALEFORM UI -
//
//------------------------------------------------------------------------------------------------------------------------
class DamageText extends GFxUIScript;
const FLASH_WIDTH = 800;
const FLASH_HEIGHT = 600;
var int currentScreenWidth, currentScreenHeight;
enum EDamageTextType
{
NOMAKE, //
NormalAttack, //
ConsecutiveAttack, //
Critical, //
OverHit, //
RecoverHP, //
RecoverMP, //
GetSP, //
GetExp, //
MagicDefiance, //
ShieldGuard, //
Dodge, //
Immune, //
SkillHit, //
Etc //
};
function OnRegisterEvent()
{
//
RegisterEvent(EV_DamageTextCreate);
RegisterEvent(EV_DamageTextUpdate);
//
// RegisterEvent(EV_SystemMessage);
}
function OnLoad()
{
registerState( "DamageText", "GamingState" );
// class'UIAPI_WINDOW'.static.SetAnchor( "", "DamageText", "TopLeft", "BottomLeft", 0, 0 );
SetAnchor("", EAnchorPointType.ANCHORPOINT_TopLeft, EAnchorPointType.ANCHORPOINT_TopLeft, 0, 0);
}
function OnShow()
{
// Debug("DamageText!!!! onShow");
}
function OnFlashLoaded()
{
RegisterDelegateHandler(EDHandler_DamageText);
SetAlwaysFullAlpha(true);
IgnoreUIEvent(true);
}
function OnHide()
{
}
function OnCallUCLogic( int logicID, string param )
{
}
// 5370
// clipName=111 unitType=1 valueType=1 value=500000 x=400 y=400
// clipName=111 unitType=2 bCritical=1 valueType=1 value=500000 x=400 y=400
// clipName=111 unitType=2 bCritical=0 valueType=1 value=500000 x=400 y=400
// clipName=111 unitType=2 bImmune bCritical=0 value=500000 x=400 y=400
//
function OnEvent(int Event_ID, string param)
{
local string clipName;
local int unitType;
local int xLoc, yLoc;
local int valueType, value, bCritical, bOverHit,
bMagicDefense, bShieldDefense, bMiss, bContinuousAttack, bImmune, bSkillHit;
local array<GFxValue> args;
local GFxValue invokeResult;
//
local int nID;
// debug("ConsecutiveAttack: " @ EDamageTextType.ConsecutiveAttack);
//
GetCurrentResolution (currentScreenWidth, currentScreenHeight);
//
if ( Event_ID == EV_DamageTextCreate)
{
// Debug(" EV DamageText" @ Event_ID);
// Debug(" Param : " @ param);
ShowWindow();
//
// ParseString(param, "clipName" , clipName);
ParseInt(param, "clipName" , nID);
clipName = string(nID);
//1 pc, 2 npc(target), 3 pet //
ParseInt(param, "unitType" , unitType);
ParseInt(param, "valueType" , valueType);
ParseInt(param, "value" , value);
ParseInt(param, "bCritical" , bCritical);
ParseInt(param, "bOverHit" , bOverHit);
ParseInt(param, "bMagicDefense" , bMagicDefense);
ParseInt(param, "bShieldDefense" , bShieldDefense);
ParseInt(param, "bMiss" , bMiss);
ParseInt(param, "bContinuousAttack", bContinuousAttack);
//
ParseInt(param, "bImmune" , bImmune);
//
ParseInt(param, "bSkillHit", bSkillHit);
//
ParseInt(param, "x" , xLoc);
ParseInt(param, "y" , yLoc);
//
conditionalDamageText(clipName, unitType, xLoc, yLoc,
valueType, value, bCritical, bOverHit, bMagicDefense, bShieldDefense, bMiss, bContinuousAttack, bImmune, bSkillHit);
// Debug("Damage Text param: " @ param);
}
else if ( Event_ID == EV_DamageTextUpdate )
{
// Debug(" EV DamageText" @ Event_ID);
// Debug(" Param : " @ param);
// case 2 : updateMotion(data.clipName, data.x, data.y); break;
ShowWindow();
//
//
// ParseString(param, "clipName" , clipName);
ParseInt(param, "clipName" , nID);
clipName = string(nID);
//
ParseInt(param, "x" , xLoc);
ParseInt(param, "y" , yLoc);
//
AllocGFxValues(args, 2);
AllocGFxValue(invokeResult);
//
args[0].SetInt(2);
CreateObject(args[1]);
args[1].SetMemberString("clipName", clipName);
// args[1].SetMemberInt ("x", xLoc - ((currentScreenWidth - FLASH_WIDTH) / 2));
// args[1].SetMemberInt ("y", yLoc - ((currentScreenHeight - FLASH_HEIGHT) / 2));
args[1].SetMemberInt ("x", xLoc);
args[1].SetMemberInt ("y", yLoc);
Invoke("_root.onEvent", args, invokeResult);
DeallocGFxValue(invokeResult);
DeallocGFxValues(args);
}
}
/*
//
//
//
//
//
*/
function makeDamageText(string clipName, int unitType, int textType, int xLoc, int yLoc, string messageStr)
{
local array<GFxValue> args;
local GFxValue invokeResult;
if (textType != -1)
{
//
AllocGFxValues(args, 2);
AllocGFxValue(invokeResult);
//
args[0].SetInt(1);
CreateObject(args[1]);
args[1].SetMemberString("clipName", clipName);
args[1].SetMemberInt ("unitType", unitType);
args[1].SetMemberInt ("textType", textType);
args[1].SetMemberInt ("x", xLoc);
args[1].SetMemberInt ("y", yLoc);
args[1].SetMemberString("messageStr", messageStr);
Invoke("_root.onEvent", args, invokeResult);
DeallocGFxValue(invokeResult);
DeallocGFxValues(args);
}
}
//
//
//
//
//
function conditionalDamageText(string clipName, int unitType, int xLoc, int yLoc,
int valueType, int value, int bCritical, int bOverHit, int bMagicDefense,
int bShieldDefense, int bMiss, int bContinuousAttack, int bImmune, int bSkillHit)
{
local int damageTextType;
damageTextType = -1;
// ValueType
// 0:None, 1:sp, 2:exp, 3:hp, 4:mp
// hp , +
if (valueType == 3)
{
if (value >= 0)
{
//
damageTextType = EDamageTextType.RecoverHP; // 5
}
else
{
//
damageTextType = EDamageTextType.NormalAttack; // 1
}
//
if (value != 0) makeDamageText(clipName, unitType, damageTextType, xLoc, yLoc, string(value));
}
//
else if (valueType == 4)
{
damageTextType = EDamageTextType.RecoverMP; // 6;
}
//
else if (valueType == 1)
{
damageTextType = EDamageTextType.GetSP; // 7
}
//
else if (valueType == 2)
{
damageTextType = EDamageTextType.GetExp; // 8
}
//
if (value > 0 && valueType != 3) makeDamageText(clipName, unitType, damageTextType, xLoc, yLoc, string(value) );
//
//
if (bContinuousAttack == 1)
{
damageTextType = EDamageTextType.ConsecutiveAttack;
makeDamageText(clipName, unitType, damageTextType, xLoc, yLoc, string(value) );
}
//
if (bOverHit == 1)
{
damageTextType = EDamageTextType.OverHit;
makeDamageText(clipName, unitType, damageTextType, xLoc, yLoc, string(value) );
}
//
if (bCritical == 1)
{
damageTextType = EDamageTextType.Critical;
makeDamageText(clipName, unitType, damageTextType, xLoc, yLoc, string(value) );
}
//
if (bMagicDefense == 1)
{
damageTextType = EDamageTextType.MagicDefiance; // 9;
makeDamageText(clipName, unitType, damageTextType, xLoc, yLoc, string(value) );
}
//
if (bShieldDefense == 1)
{
damageTextType = EDamageTextType.ShieldGuard; // 10;
makeDamageText(clipName, unitType, damageTextType, xLoc, yLoc, string(value) );
}
//
if (bMiss == 1)
{
damageTextType = EDamageTextType.Dodge; // 11
makeDamageText(clipName, unitType, damageTextType, xLoc, yLoc, string(value) );
}
//
if (bImmune == 1)
{
damageTextType = EDamageTextType.Immune; // 12
makeDamageText(clipName, unitType, damageTextType, xLoc, yLoc, string(value) );
}
//
if (bSkillHit != 0)
{
damageTextType = EDamageTextType.SkillHit; // 13
makeDamageText(clipName, unitType, damageTextType, xLoc, yLoc, string(value) );
}
}
defaultproperties
{
}