Hello everybody
Tak więc zaczynamy, na początku w pliku Story_Globals deklarujemy 2 zmienne:
nazwazmiennej1_Equipped;
nazwazmiennej2_Equipped;
teraz robimy skrypt np pancerza
// ******************************************************
INSTANCE instance pancerza (C_Item)
{
name = "Pancerz paladyna";
mainflag = ITEM_KAT_ARMOR;
flags = 0;
protection [PROT_EDGE] = 150;
protection [PROT_BLUNT] = 150;
protection [PROT_POINT] = 150;
protection [PROT_FIRE] = 100;
protection [PROT_MAGIC] = 50;
value = VALUE_ITAR_PAL_H;
wear = WEAR_TORSO;
visual = "ItAr_Pal_H.3ds";
visual_change = "Armor_Pal_H.asc";
visual_skin = 0;
material = MAT_METAL;
on_equip = Equip_instance pancerza;
on_unequip = UnEquip_instance pancerza;
description = name;
TEXT[1] = NAME_Prot_Edge;
COUNT[1] = protection [PROT_EDGE];
TEXT[2] = NAME_Prot_Point;
COUNT[2] = protection [PROT_POINT];
TEXT[3] = NAME_Prot_Fire;
COUNT[3] = protection [PROT_FIRE];
TEXT[4] = NAME_Prot_Magic;
COUNT[4] = protection [PROT_MAGIC];
TEXT[5] = NAME_Value;
COUNT[5] = value;
};
FUNC VOID Equip_instance pancerza()
{
if Npc_IsPlayer (self)
{
nazwazmiennej1_Equipped = TRUE;
if (nazwazmiennej2_Equipped == TRUE)//Gürtel
{
self.protection[PROT_EDGE] += wartosc obrony1;
self.protection[PROT_BLUNT] += wartosc obrony2;
self.protection[PROT_POINT] += wartosc obrony3;
self.protection[PROT_MAGIC] += wartosc obrony4;
self.protection[PROT_FIRE] += wartosc obrony5;
};
};
};
FUNC VOID UnEquip_instance pancerza()
{
if Npc_IsPlayer (self)
{
nazwazmiennej1_Equipped = FALSE;
if (nazwazmiennej2_Equipped == TRUE)
{
self.protection[PROT_EDGE] -= wartosc obrony1;
self.protection[PROT_BLUNT] -= wartosc obrony2;
self.protection[PROT_POINT] -= wartosc obrony3;
self.protection[PROT_MAGIC] -= wartosc obrony4;
self.protection[PROT_FIRE] -= wartosc obrony5;
};
};
};
a teraz np pasu
//------------------------------------------------------------------------------------------
INSTANCE instance przedmiotu(C_Item)
{
name = NAME_Addon_Belt;
mainflag = ITEM_KAT_MAGIC;
flags = ITEM_BELT|ITEM_MULTI;
value = Value_ItBE_Addon_MIL_01;
visual = "ItMi_Belt_03.3ds";
visual_skin = 0;
material = MAT_METAL;
on_equip = Equip_instance przedmiotu;
on_unequip = UnEquip_instance przedmiotu;
description = "Pas straży";
TEXT[1] = NAME_Prot_Edge;
COUNT[1] = Belt_Prot_01;
TEXT[2] = NAME_Prot_Point;
COUNT[2] = Belt_Prot_01;
TEXT[3] = NAME_Addon_BeArMIL;
COUNT[3] = BA_Bonus01;
TEXT[5] = NAME_Value;
COUNT[5] = value;
INV_ZBIAS = INVCAM_ENTF_AMULETTE_STANDARD;
inv_rotx = INVCAM_ENTF_MISC2_STANDARD;
};
FUNC VOID Equip_instance przedmiotu()
{
nazwazmiennej2_Equipped = TRUE;
self.protection[PROT_EDGE] += 10;
self.protection[PROT_BLUNT] += 10;
self.protection[PROT_POINT] += 10; ////ustalamy ile ma standardowo dodawać obrony siły itp
if (nazwazmiennej1_Equipped == TRUE)
{
self.protection[PROT_EDGE] += wartosc obrony1;
self.protection[PROT_BLUNT] += wartosc obrony2;
self.protection[PROT_POINT] += wartosc obrony3;
self.protection[PROT_MAGIC] += wartosc obrony4;
self.protection[PROT_FIRE] += wartosc obrony5;
};
};
FUNC VOID UnEquip_instance przedmiotu()
{
nazwazmiennej2_Equipped = FALSE;
self.protection[PROT_EDGE] -= 10;
self.protection[PROT_BLUNT] -= 10;
self.protection[PROT_POINT] -= 10;
if (nazwazmiennej1_Equipped == TRUE)
{
self.protection[PROT_EDGE] -= wartosc obrony1;
self.protection[PROT_BLUNT] -= wartosc obrony2;
self.protection[PROT_POINT] -= wartosc obrony3;
self.protection[PROT_MAGIC] -= wartosc obrony4;
self.protection[PROT_FIRE] -= wartosc obrony5;
};
};