

| Code: |
| #include "nw_i0_tool"
void main(int nGold, int nXP, string sObjetTag, int nStackObjet) { object oPC=GetPCSpeaker(); if (HasItem(oPC, sObjetTag) && GetItemStackSize(GetObjectByTag(sObjetTag))) { //Récompenses GiveGoldToCreature(oPC, nGold ); GiveXPToCreature( oPC, nXP); // Enlever des objets de l’inventaire du joueur object oItemToTake; oItemToTake = GetItemPossessedBy(oPC, sObjetTag); DestroyObject(oItemToTake); } } |
| Code: |
| #include "nw_i0_tool"
int StartingConditional(string sObjetTag, int nStackObjet) { object oPC=GetPCSpeaker(); if (HasItem(oPC, sObjetTag) && GetItemStackSize(GetObjectByTag(sObjetTag))) return TRUE; return FALSE; } |



| Code: |
|
SetLocalInt(oPC, "iPouleValid", TRUE); |
| Code: |
| int StartingConditional(string sObjetTag, int nStackObjet)
{ object oPC=GetPCSpeaker(); if (GetLocalInt(oPC, "iPouleValid) == TRUE) return TRUE; return FALSE; } |


| Code: |
|
int StartingConditional() { object oPC=GetPCSpeaker(); if (GetLocalInt(oPC, "iPouletValid") == TRUE) return TRUE; return FALSE; } |
| Code: |
|
int StartingConditional(string sObjetTag, int nStackObjet) { object oPC=GetPCSpeaker(); object oItem=GetFirstItemInInventory(oPC); int iCompteur=0; while (GetIsObjectValid(oItem)) { if (GetTag(oItem) == sObjetTag) iCompteur++; oItem=GetNextItemInInventory(oPC); } if (iCompteur >= nStackObjet) return TRUE; return FALSE; } |
| Code: |
|
#include "nw_i0_tool" void main(int nGold, int nXP, string sObjetTag, int nStackObjet) { object oPC=GetPCSpeaker(); object oItem=GetFirstItemInInventory(oPC); int iCompteur=0; while (GetIsObjectValid(oItem)) { if (GetTag(oItem) == sObjetTag) iCompteur++; oItem=GetNextItemInInventory(oPC); } if (iCompteur >= nStackObjet) { //Récompenses GiveGoldToCreature(oPC, nGold ); GiveXPToCreature( oPC, nXP); SetLocalInt(oPC, "iPouletValid", TRUE); // Enlever des objets de l’inventaire du joueur oItem=GetFirstItemInInventory(oPC); iCompteur=0; while (iCompteur!=nStackObjet) { if (GetTag(oItem) == sObjetTag) { iCompteur++; DestroyObject(oItem); } oItem=GetNextItemInInventory(oPC); } } } |
