Dobra gotowe wszystko działa oto skrypty:
B_AssessDamage:
func void IceWeapon (var C_NPC oth, var C_NPC slf)
{
if (Hlp_GetInstanceID(oth) == Hlp_GetInstanceID(hero)) // jeśli jest się bochaterem (bezio) to:
{
var C_ITEM ready; ready = Npc_GetReadiedWeapon(hero);
var int damage; // wiadomo co to jest
var int randomdmg;
var int per_of_hit;
damage = 10;
randomdmg = Hlp_Random (100); // losuję liczbę od 0 do 100
per_of_hit = 8; // ustala wartość
if (Hlp_IsItem(ready, ItMw_IceWeapon)) // jeśli npc używa broni
&& (randomdmg <= per_of_hit) // i jeśli wylosowana liczba jest mniejsza lub równa 8
{
if (slf.flags != NPC_FLAG_IMMORTAL) // i jeśli npc nie jest niezniszczalnym
{
Wld_PlayEffect("spellFX_Icespell_SENDPERCEPTION", hero, slf, 1, damage, DAM_MAGIC, FALSE ); // to pokarz efekt
AI_StartState (self, ZS_MagicFreeze_Ice_Weapon, 0, ""); // i zamroź
};
};
};
};
i IT_IceWeapon:
FUNC VOID IceW()
{
var c_item weapon; weapon = Npc_GetReadiedWeapon (other);
var int randomdmg;
var int per_of_hit;
randomdmg = Hlp_Random (100);
per_of_hit = 8;
if(Hlp_IsItem(weapon,ItMw_IceWeapon))
&& (randomdmg <= per_of_hit) // wszystko to samo co tam
{
Wld_PlayEffect("spellFX_Icespell_SENDPERCEPTION",self,self,0,0,0,FALSE);
AI_StartState (self, ZS_MagicFreeze_Ice_Weapon, 0, "");
};
};
Nie wiem po co to ma być w 2 skryptach, ale jak dałem w jednym to nie działało. Jakieś uwagi, co tu jest nie potrzebnę???
Jak nie to temat do zamknięcia.