#include "nw_i0_tool" void main() { object oPC = GetLastUsedBy(); int nGrindWheat = d100(1); int nGrindWrong = d2(1); if(!HasItem(oPC, "Wheat")) FloatingTextStringOnCreature("*You need some wheat to make flour*", oPC); else if (nGrindWheat <= 50){ FloatingTextStringOnCreature("*You grind the wheat into flour*", oPC); CreateItemOnObject("flour", oPC); DestroyObject(GetItemPossessedBy(oPC, "Wheat")); } else{ switch(nGrindWrong){ case 1: FloatingTextStringOnCreature("*Your flour is too dirty to use*", oPC); DestroyObject(GetItemPossessedBy(oPC, "Wheat")); break; case 2 : FloatingTextStringOnCreature("*The grain is too poor a quality*", oPC); DestroyObject(GetItemPossessedBy(oPC, "Wheat")); break; } } }