Begin _Ingredient_ScriptShort OnPCEquipShort PCSkipEquipSet PCSkipEquip to 1 ;makes sure you don't actually eat the ingredient, because otherwise the script will stopIf ( OnPCEquip == 1 ) ;when you try to equip (eat) it, do this Set OnPCEquip to 0 Set PCSkipEquip to 0 ;this is not necessary, so just delete it Set youglobalvariable to 1 StartScript "_Ingredient_Script"EndifEnd
Begin _Ingredient_Global_ScriptShort doOnceif ( doOnce == 0 ) Playsound "swallow" If ( yourglobalvariable == 1 ) player->removeitem "NOM_food_cheese" 1 Elseif ( yourglobalvariable == 2 ) player->removeitem "your next ingredient" 1 Elseif ;keep doing as above for each ingredient Endif set doOnce to 1endif;do all your other timing stuff;once it's all doneStopScript _Ingredient_Global_ScriptEnd
Begin _Ingredient_Global_ScriptShort doOnceif ( doOnce == 0 ) Playsound "swallow" If ( Lactose_Global_Variable == 1 ) player->removeitem "NOM_food_cheese" 1 Elseif ( Lactose_Global_Variable == 2 ) player->removeitem "NOM_food_cheese2" 1 Elseif ( Lactose_Global_Variable == 3 ) player->removeitem "NOM_food_cheese3" 1 Elseif ( Lactose_Global_Variable == 4 ) player->removeitem "NOM_food_cheese_pie" 1 Elseif ( Lactose_Global_Variable == 5 ) player->removeitem "NOM_food_egg2" 1 Elseif ( Lactose_Global_Variable == 6 ) player->removeitem "NOM_food_egg_boil" 1 Elseif ( Lactose_Global_Variable == 7 ) player->removeitem "NOM_food_omelette" 1 Elseif ( Lactose_Global_Variable == 8 ) player->removeitem "NOM_food_omelette_crab" 1 Elseif ( Lactose_Global_Variable == 9 ) player->removeitem "1_milk_cow" 1 Elseif ( Lactose_Global_Variable == 10 ) player->removeitem "1_milk_goat" 1 Elseif ( Lactose_Global_Variable == 11 ) player->removeitem "food_kwama_egg_01" 1 Elseif ( Lactose_Global_Variable == 12 ) player->removeitem "food_kwama_egg_02" 1 Endif set doOnce to 1endif;do all your other timing stuff;once it's all doneStopScript _Ingredient_Global_ScriptEnd
Begin 1_Ingredient_ScriptShort OnPCEquipShort PCSkipEquipSet PCSkipEquip to 1 ;makes sure you don't actually eat the ingredient, because otherwise the script will stopIf ( OnPCEquip == 1 ) ;when you try to equip (eat) it, do this Set OnPCEquip to 0 Set "Lactose_Global_Variable" to 1 StartScript "1_Ingredient_Script"EndifEnd
Begin 12_Ingredient_ScriptShort OnPCEquipShort PCSkipEquipSet PCSkipEquip to 1 ;makes sure you don't actually eat the ingredient, because otherwise the script will stopIf ( OnPCEquip == 1 ) ;when you try to equip (eat) it, do this Set OnPCEquip to 0 Set "Lactose_Global_Variable" to 12 StartScript "12_Ingredient_Script"EndifEnd
Begin _Ingredient_Global_ScriptShort doOnceShort stateShort BaseLuckShort BaseEnduranceFloat StartTimeFloat timerif ( doOnce == 0 ) Playsound "swallow" If ( Lactose_Global_Variable == 1 ) player->removeitem "NOM_food_cheese" 1 Elseif ( Lactose_Global_Variable == 2 ) player->removeitem "NOM_food_cheese2" 1 Elseif ( Lactose_Global_Variable == 3 ) player->removeitem "NOM_food_cheese3" 1 Elseif ( Lactose_Global_Variable == 4 ) player->removeitem "NOM_food_cheese_pie" 1 Elseif ( Lactose_Global_Variable == 5 ) player->removeitem "NOM_food_egg2" 1 Elseif ( Lactose_Global_Variable == 6 ) player->removeitem "NOM_food_egg_boil" 1 Elseif ( Lactose_Global_Variable == 7 ) player->removeitem "NOM_food_omelette" 1 Elseif ( Lactose_Global_Variable == 8 ) player->removeitem "NOM_food_omelette_crab" 1 Elseif ( Lactose_Global_Variable == 9 ) player->removeitem "1_milk_cow" 1 Elseif ( Lactose_Global_Variable == 10 ) player->removeitem "1_milk_goat" 1 Elseif ( Lactose_Global_Variable == 11 ) player->removeitem "food_kwama_egg_01" 1 Elseif ( Lactose_Global_Variable == 12 ) player->removeitem "food_kwama_egg_02" 1 Endif If ( GameHour >= 23 ) Set StartTime to ( GameHour - 23 ) Else Set StartTime to ( GameHour + 1 ) ;this is the time you want to start the effects Endif Set BaseLuck to Player->GetLuck ;record the player's stats before effect and save them for later Set BaseEndurance to Player->GetEndurance set doOnce to 1endifIf ( GameHour >= StartTime ) If ( state == 0 ) MessageBox "Your first message" Set state to 1 Elseif ( state == 1 ) Set state to 2 Elseif ( state == 2 ) Set state to 3 Elseif ( state == 4 ) If ( GameHour >= 23 ) Set StartTime to ( GameHour - 23.8 ) Else Set StartTime to ( GameHour + 0.2 ) ;reset to about ten minutes Endif Set state to 5 Return Endif If ( GameHour >= 23 ) Set StartTime to ( GameHour - 23 ) Else Set StartTime to ( GameHour + 1 ) ;reset to the next hour EndifEndifIf ( state == 1 ) ;after first hour Player->SetLuck ( BaseLuck - 5 ) ;this will make sure the attribute is constantly set below normal by a certain amount Player->SetEndurance ( BaseEndurance - 5 ) Set timer to ( timer + GetSecondsPassed ) If ( timer > 20 ) If ( Player->GetFatigue > 0 ) Player->ModCurrentFatigue -1 Endif Set timer to 0 Return EndifElseif ( state == 2 ) ;after second hour Player->SetLuck ( BaseLuck - 10 ) Player->SetEndurance ( BaseEndurance - 10 ) Set timer to ( timer + GetSecondsPassed ) If ( timer > 10 ) If ( Player->GetFatigue > 0 ) Player->ModCurrentFatigue -1 Endif Set timer to 0 Return EndifElseif ( state == 3 ) ;after third hour Player->SetLuck ( BaseLuck - 15 ) Player->SetEndurance ( BaseEndurance - 15 ) Set timer to ( timer + GetSecondsPassed ) If ( timer > 5 ) If ( Player->GetFatigue > 0 ) Player->ModCurrentFatigue -1 Endif Set timer to 0 Return EndifElseif ( state == 4 ) ;after fourth hour SetLuck ( BaseLuck - 20 ) SetEndurance ( BaseEndurance - 20 ) Set timer to ( timer + GetSecondsPassed ) If ( timer > 1 ) If ( Player->GetFatigue > 0 ) Player->ModCurrentFatigue -1 Endif Set timer to 0 Return EndifElseif ( state == 5 ) MessageBox "Your last message" Player->SetLuck BaseLuck Player->SetEndurance BaseEndurance Set state to -1 ReturnElseif ( state == -1 ) Set state to 0 StopScript _Ingredient_Global_ScriptEndifEnd
Set BaseLuck to Player->GetLuck ; record the player's stats before effect and save them for later Set BaseEndurance to Player->GetEndurance
If ( state == 1 ) ;after first hour
Begin _Ingredient_Global_ScriptShort doOnceShort stateShort BaseLuckShort BaseEnduranceShort CurrentLuckShort CurrentEnduanceFloat StartTimeFloat timerif ( doOnce == 0 ) Playsound "swallow" If ( Lactose_Global_Variable == 1 ) player->removeitem "NOM_food_cheese" 1 Elseif ( Lactose_Global_Variable == 2 ) player->removeitem "NOM_food_cheese2" 1 Elseif ( Lactose_Global_Variable == 3 ) player->removeitem "NOM_food_cheese3" 1 Elseif ( Lactose_Global_Variable == 4 ) player->removeitem "NOM_food_cheese_pie" 1 Elseif ( Lactose_Global_Variable == 5 ) player->removeitem "NOM_food_egg2" 1 Elseif ( Lactose_Global_Variable == 6 ) player->removeitem "NOM_food_egg_boil" 1 Elseif ( Lactose_Global_Variable == 7 ) player->removeitem "NOM_food_omelette" 1 Elseif ( Lactose_Global_Variable == 8 ) player->removeitem "NOM_food_omelette_crab" 1 Elseif ( Lactose_Global_Variable == 9 ) player->removeitem "1_milk_cow" 1 Elseif ( Lactose_Global_Variable == 10 ) player->removeitem "1_milk_goat" 1 Elseif ( Lactose_Global_Variable == 11 ) player->removeitem "food_kwama_egg_01" 1 Elseif ( Lactose_Global_Variable == 12 ) player->removeitem "food_kwama_egg_02" 1 Endif If ( GameHour >= 23 ) Set StartTime to ( GameHour - 23 ) Else Set StartTime to ( GameHour + 1 ) ;this is the time you want to start the effects Endif Set CurrentLuck to ( BaseLuck - 5 ) Player->SetLuck CurrentLuck Set CurrentEndurance to ( BaseEndurance - 5 ) Player->SetEndurance CurrentEndurance set DoOnce to 1endifIf ( GameHour >= StartTime ) If ( state == 0 ) MessageBox "This is a test to see if this works." Set state to 1 Elseif ( state == 1 ) Set state to 2 Elseif ( state == 2 ) Set state to 3 Elseif ( state == 4 ) If ( GameHour >= 23 ) Set StartTime to ( GameHour - 23.8 ) Else Set StartTime to ( GameHour + 0.2 ) ;reset to about ten minutes Endif Set state to 5 Return Endif If ( GameHour >= 23 ) Set StartTime to ( GameHour - 23 ) Else Set StartTime to ( GameHour + 1 ) ;reset to the next hour EndifEndifIf ( state == 1 ) ;after first hour Set CurrentLuck to ( BaseLuck - 5 ) Player->SetLuck CurrentLuck Set CurrentEndurance to ( BaseEndurance - 5 ) Player->SetEndurance CurrentEndurance Set timer to ( timer + GetSecondsPassed ) If ( timer > 20 ) If ( Player->GetFatigue > 0 ) Player->ModCurrentFatigue -1 Endif Set timer to 0 Return EndifElseif ( state == 2 ) ;after second hour Set CurrentLuck to ( BaseLuck - 10 ) Player->SetLuck CurrentLuck Set CurrentEndurance to ( BaseEndurance - 10 ) Player->SetEndurance CurrentEndurance Set timer to ( timer + GetSecondsPassed ) If ( timer > 10 ) If ( Player->GetFatigue > 0 ) Player->ModCurrentFatigue -1 Endif Set timer to 0 Return EndifElseif ( state == 3 ) ;after third hour Set CurrentLuck to ( BaseLuck - 15 ) Player->SetLuck CurrentLuck Set CurrentEndurance to ( BaseEndurance - 15 ) Player->SetEndurance CurrentEndurance Set timer to ( timer + GetSecondsPassed ) If ( timer > 5 ) If ( Player->GetFatigue > 0 ) Player->ModCurrentFatigue -1 Endif Set timer to 0 Return EndifElseif ( state == 4 ) ;after fourth hour Set CurrentLuck to ( BaseLuck - 20 ) Player->SetLuck CurrentLuck Set CurrentEndurance to ( BaseEndurance - 20 ) Player->SetEndurance CurrentEndurance Set timer to ( timer + GetSecondsPassed ) If ( timer > 1 ) If ( Player->GetFatigue > 0 ) Player->ModCurrentFatigue -1 Endif Set timer to 0 Return EndifElseif ( state == 5 ) MessageBox "Your last message" Player->SetLuck CurrentLuck Player->SetEndurance CurrentEndurance Set state to -1 ReturnElseif ( state == -1 ) Set state to 0 StopScript _Ingredient_Global_ScriptEndifEnd
Begin _Ingredient_Global_ScriptShort doOnceShort stateFloat StartTimeFloat timerif ( doOnce == 0 ) Playsound "swallow" If ( Lactose_Global_Variable == 1 ) player->removeitem "NOM_food_cheese" 1 Elseif ( Lactose_Global_Variable == 2 ) player->removeitem "NOM_food_cheese2" 1 Elseif ( Lactose_Global_Variable == 3 ) player->removeitem "NOM_food_cheese3" 1 Elseif ( Lactose_Global_Variable == 4 ) player->removeitem "NOM_food_cheese_pie" 1 Elseif ( Lactose_Global_Variable == 5 ) player->removeitem "NOM_food_egg2" 1 Elseif ( Lactose_Global_Variable == 6 ) player->removeitem "NOM_food_egg_boil" 1 Elseif ( Lactose_Global_Variable == 7 ) player->removeitem "NOM_food_omelette" 1 Elseif ( Lactose_Global_Variable == 8 ) player->removeitem "NOM_food_omelette_crab" 1 Elseif ( Lactose_Global_Variable == 9 ) player->removeitem "1_milk_cow" 1 Elseif ( Lactose_Global_Variable == 10 ) player->removeitem "1_milk_goat" 1 Elseif ( Lactose_Global_Variable == 11 ) player->removeitem "food_kwama_egg_01" 1 Elseif ( Lactose_Global_Variable == 12 ) player->removeitem "food_kwama_egg_02" 1 Endif If ( GameHour >= 23 ) Set StartTime to ( GameHour - 23 ) Else Set StartTime to ( GameHour + 1 ) ;this is the time you want to start the effects Endif set DoOnce to 1endifIf ( GameHour >= StartTime ) If ( state == 0 ) MessageBox "This is a test to see if this works." Set state to 1 Elseif ( state == 1 ) Set state to 2 Elseif ( state == 2 ) Set state to 3 Elseif ( state == 4 ) If ( GameHour >= 23 ) Set StartTime to ( GameHour - 23.8 ) Else Set StartTime to ( GameHour + 0.2 ) ;reset to about ten minutes Endif Set state to 5 Return Endif If ( GameHour >= 23 ) Set StartTime to ( GameHour - 23 ) Else Set StartTime to ( GameHour + 1 ) ;reset to the next hour EndifEndifIf ( state == 1 ) ;after first hour If ( Player->GetSpell "first drain spell" == 0 ) Player->AddSpell "first drain spell" ;make this an ability and set drain endurance and drain luck in the same spell with whatever magnitude you like Endif Set timer to ( timer + GetSecondsPassed ) If ( timer > 20 ) If ( Player->GetFatigue > 0 ) Player->ModCurrentFatigue -1 Endif Set timer to 0 Return EndifElseif ( state == 2 ) ;after second hour If ( Player->GetSpell "first drain spell" == 1 ) Player->RemoveSpell "first drain spell" Endif If ( Player->GetSpell "second drain spell" == 0 ) Player->AddSpell "second drain spell" Endif Set timer to ( timer + GetSecondsPassed ) If ( timer > 10 ) If ( Player->GetFatigue > 0 ) Player->ModCurrentFatigue -1 Endif Set timer to 0 Return EndifElseif ( state == 3 ) ;after third hour If ( Player->GetSpell "second drain spell" == 1 ) Player->RemoveSpell "second drain spell" Endif If ( Player->GetSpell "third drain spell" == 0 ) Player->AddSpell "third drain spell" Endif Set timer to ( timer + GetSecondsPassed ) If ( timer > 5 ) If ( Player->GetFatigue > 0 ) Player->ModCurrentFatigue -1 Endif Set timer to 0 Return EndifElseif ( state == 4 ) ;after fourth hour If ( Player->GetSpell "third drain spell" == 1 ) Player->RemoveSpell "third drain spell" Endif If ( Player->GetSpell "fourth drain spell" == 0 ) Player->AddSpell "fourth drain spell" Endif Set timer to ( timer + GetSecondsPassed ) If ( timer > 1 ) If ( Player->GetFatigue > 0 ) Player->ModCurrentFatigue -1 Endif Set timer to 0 Return EndifElseif ( state == 5 ) MessageBox "Your last message" If ( Player->GetSpell "fourth drain spell" == 1 ) Player->RemoveSpell "fourth drain spell" Endif Set state to -1 ReturnElseif ( state == -1 ) Set state to 0 StopScript _Ingredient_Global_ScriptEndifEnd