//////////////////////////////////////////////////////////////////////////////// // it_pot_undead - Undead Lair Upgrade - Cauldron - Potions - Activation Script // By Deva B. Winblood. March 15th, 2009. //////////////////////////////////////////////////////////////////////////////// #include "prc_inc_racial" void main() { object oItem=GetItemActivated(); object oPC=GetItemActivator(); object oTarget=GetItemActivatedTarget(); int nAbs; string sTag=GetTag(oItem); // it_pot_soul = soul leesh // it_pot_zomb = zombie plague // it_pot_und = undead control if (sTag=="it_pot_und") { // undead control SendMessageToPC(oPC,"You drink the Potion of Undead Control. You now have 4 game hours to control undead creatures you encounter within that time."); SetLocalInt(oPC,"bControlUndead",TRUE); nAbs=GetTimeHour()+GetCalendarDay()*24+GetCalendarMonth()*24*30+GetCalendarYear()*24*30*12; SetLocalInt(oPC,"nControlUndeadEndTime",nAbs+4); effect eVFX=EffectVisualEffect(VFX_DUR_IOUNSTONE_RED); ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eVFX,oPC,8.0); } // undead control else { // other int nRace=MyPRCGetRacialType(oTarget); if (nRace!=RACIAL_TYPE_HUMAN||!GetIsObjectValid(oTarget)||GetObjectType(oTarget)!=OBJECT_TYPE_CREATURE) { // invalid target SendMessageToPC(oPC,"You throw the potion on the target you specified and it has no effect."); } // invalid target else if (GetStringLength(GetLocalString(oTarget,"sDeathScript"))>0) { // already something in place SendMessageToPC(oPC,"There is already some pending doom or potion on that target therefore, this potion has no effect and sizzles."); } // already something in place else { // valid target SendMessageToPC(oPC,"You throw the potion onto the target and the sickly looking liquid quickly seeps through their clothing, into their skin, and vanishes."); AdjustAlignment(oPC,ALIGNMENT_EVIL,20,FALSE); // duration 1 game hour if (sTag=="it_pot_soul") { // soul leesh /* This potion is to be targeted and thrown upon a human female or male. If they die within an hour of the time that the potion is thrown on them then their skull will remain and at night time their ghost will appear at the location of the skull and follow it. Beware, the ghost is hostile. */ SetLocalString(oTarget,"sDeathScript","hos1_ex_soul"); DelayCommand(HoursToSeconds(1),DeleteLocalString(oTarget,"sDeathScript")); ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_DUR_AURA_PULSE_PURPLE_BLACK),oTarget,HoursToSeconds(1)); } // soul leesh else if (sTag=="it_pot_zomb") { // zombie plague /* This potion when thrown upon a human male or female will put a zombie plague on the person for up to an hour. If that human should die during that time then they will rise as a contagious zombie that can create other zombies by killing humans. This is a hostile zombie. */ SetLocalString(oTarget,"sDeathScript","hos1_ex_zomb"); DelayCommand(HoursToSeconds(1),DeleteLocalString(oTarget,"sDeathScript")); ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_DUR_AURA_PULSE_YELLOW_BLACK),oTarget,HoursToSeconds(1)); } // sombie plague } // valid target } // other }