09-16-2015, 10:11 AM
A save should not be a requirement for any normal goblets or wine or anything that can be drunk. Below is the code for poisoned drinks. If a drink has been poisoned, you should receive the flavor text message "You realize too late that this drink is poisoned!"
Code:
//Used Drink Item
if ((FindSubString(sItemTag,"Drink") != -1) && (nDualItem != 1)) {
if (nHUNGERSYSTEM = 1) {
//Thayan 6/20/11 - Handle assassin-poisoned drinks
int iIsAssassinPoisoned = GetLocalInt(oItem, "AppliedPoison");
if (iIsAssassinPoisoned) {
AssignCommand(oPC,ActionPlayAnimation(ANIMATION_FIREFORGET_DRINK));
DelayCommand(1.0, SendMessageToPC(oPC,TAKEADRINKOF + sName));
DelayCommand(2.0, FloatingTextStringOnCreature("You realize too late that this drink is poisoned!", oPC, FALSE));
if (iIsAssassinPoisoned == 100) iIsAssassinPoisoned = 0; //Handle Nightshade poison
DelayCommand(3.0, ApplyEffectToObject(DURATION_TYPE_PERMANENT, SupernaturalEffect(EffectPoison(iIsAssassinPoisoned)), oPC)); //Apply the poison effect and VFX impact
return;
}
if (IntToFloat(nTCurrent) >= fTTotal) {
//Thayan - 11/27/05 - added next 7 lines so people can drink as much alcohol as they want
if (FindSubString(sItemTag,"ALCOHOL") != -1) {
AssignCommand (oPC, ActionPlayAnimation (ANIMATION_FIREFORGET_DRINK));
DelayCommand(1.0, SendMessageToPC(oPC,TAKEADRINKOF + sName));
ApplyAlcoholEffectToPC(sItemTag, oPC);
return;
}
DelayCommand(1.0, SendMessageToPC(oPC,NOTTHIRSTY));
//Give a charge back
if (nBottle >= 0) {
SetItemCharges(oItem, nBottle+1);
return;
}
}
else {
DelayCommand(1.0, SendMessageToPC(oPC,TAKEADRINKOF + sName));
UseFoodOrDrinkItem(oPC,oItem);
}
}
}