//:://///////////////////////////////////////////// //:: User Defined Henchmen Script //:: NW_CH_ACD //:: Copyright (c) 2001 Bioware Corp. //::////////////////////////////////////////////// /* The most complicated script in the game. */ //::////////////////////////////////////////////// //:: Created By: Preston Watamaniuk //:: Created On: March 18, 2002 //::////////////////////////////////////////////// #include "MERC_CONSTANTS" void main() { switch ( GetUserDefinedEventNumber() ) { case 1001: object master = GetMaster(); if ( GetIsObjectValid( master ) ) { int day = GetLocalInt( OBJECT_SELF, "LAST_PAY_DAY" ); if ( day == 0 ) { SetLocalInt(OBJECT_SELF, "LAST_PAY_DAY", GetCalendarDay() ); SetLocalInt(OBJECT_SELF, "LAST_PAY_MONTH", GetCalendarMonth() ); } else { int month = GetLocalInt( OBJECT_SELF, "LAST_PAY_MONTH" ); if ( day != GetCalendarDay() || month != GetCalendarMonth() ) { int gold = GetGold( master ); int wage = GetLocalInt( OBJECT_SELF, "WAGE" ); if ( gold >= wage ) { TakeGoldFromCreature( wage, master ); SendMessageToPC( master, "You pay your henchmans " + IntToString( wage ) + " gold wage" ); SetLocalInt( OBJECT_SELF, "LAST_PAY_DAY", GetCalendarDay() ); SetLocalInt( OBJECT_SELF, "LAST_PAY_MONTH", GetCalendarMonth() ); } else { // Quit! SetLocalInt( OBJECT_SELF, "QUIT", 1 ); BeginConversation( "", master ); } } } } break; } }