#include "x4_inc_functions" #include "x3_inc_horse" void main() { object oPC = GetPCSpeaker(); string sDB = CharacterDB(oPC); int nRound = GetCampaignInt(sDB, "TOUR_ROUND"); string sTemplate = GetCampaignString(sDB, "TOUR_RESREF"+IntToString(nRound)); string sName = GetCampaignString(sDB, "TOUR_NAME"+IntToString(nRound)); int nSkill = GetCampaignInt(sDB, "TOUR_SKILL"+IntToString(nRound)); //Make sure the joust dosent start without logical items equpped if (HorseGetIsMounted(oPC)!= TRUE) {FloatingTextStringOnCreature("You must be mounted to joust!", oPC); return;} if (GetBaseItemType(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oPC)) != 92) {FloatingTextStringOnCreature("You must have a lance equipped to joust!", oPC); return;} if (GetItemAppearance(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oPC), ITEM_APPR_TYPE_WEAPON_MODEL, ITEM_APPR_WEAPON_MODEL_TOP) == 2) {FloatingTextStringOnCreature("You cannot joust with a broken lance!", oPC); return;} object oNPC = CreateObject(OBJECT_TYPE_CREATURE, sTemplate, GetLocation(GetWaypointByTag("Tournament_Spawn")), FALSE); SetName(oNPC, sName); ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectSkillIncrease(SKILL_RIDE, nSkill), oNPC); SetLocalObject(oNPC, "oPC", oPC); //DelayCommand(5.0, ExecuteScript("tourn_joust", oNPC)); ExecuteScript("tourn_joust", oNPC); }