// rts_it_twkickp #include "header_sounds" void fnAnnounce(string sMsg="") { // announce message to players object oNext=GetFirstPC(); while(oNext!=OBJECT_INVALID) { // announce SendMessageToPC(oNext,"ANNOUNCEMENT:"+sMsg); AssignCommand(oNext,fnSoundAlert("as_cv_bell2")); oNext=GetNextPC(); } // announce } // fnAnnounce() void fnSetFactionToEnemy(object oPC,string sID) { // Set faction that you control to friendly object oMember=GetObjectByTag(sID+"0"); object oWP; int nCreate=FALSE; if(oMember==OBJECT_INVALID) { // create dummy nCreate=TRUE; oWP=GetWaypointByTag(sID+"_START"); oMember=CreateObject(OBJECT_TYPE_CREATURE,sID+"0",GetLocation(oWP)); } // create dummy if (oMember!=OBJECT_INVALID) { // !OI AdjustReputation(oPC,oMember,0); } // !OI else { SendMessageToPC(oPC,"CRITICAL AREA: A creature placed with tag "+sID+"0 could not be found and is required to set faction you control to friendly!!!"); } if (nCreate==TRUE) DestroyObject(oMember); } // fnSetFactionToEnemy() void fnSendToInProgress(object oTarg) { // send to inprogress room int nKicked=GetLocalInt(oTarg,"nKicked"); object oWP=GetWaypointByTag(""); nKicked++; SetLocalInt(oTarg,"nKicked",nKicked); if (nKicked>3) BootPC(oTarg); else { // move AssignCommand(oTarg,JumpToObject(oWP)); ExecuteScript("rts_save_player",oTarg); DelayCommand(5.0,AssignCommand(oTarg,ActionStartConversation(oTarg,"inprogress_join",TRUE,FALSE))); fnAnnounce(GetName(oTarg)+" was kicked off of the team they were part of."); SendMessageToPC(oTarg,"WARNING!: If you get kicked off a team more than 3 times you will be booted out of the game!"); } // move } // fnSendToInProgress() void main() { object oTarg=GetLocalObject(GetPCSpeaker(),"oTarget"); string sMsg="ATTENTION!: You have been kicked off this team by "+GetName(GetPCSpeaker())+"."; object oItem; string sID=GetLocalString(oTarg,"sTeamID"); SendMessageToPC(oTarg,sMsg); AssignCommand(oTarg,ClearAllActions()); AssignCommand(oTarg,SpeakString(sMsg)); oItem=GetItemPossessedBy(oTarg,"RTSUnit_Creation"); DestroyObject(oItem); oItem=GetItemPossessedBy(oTarg,"RTSCreation_Tool"); DestroyObject(oItem); DeleteLocalString(oTarg,"sTeamID"); DelayCommand(31.0,fnSetFactionToEnemy(oTarg,sID)); DelayCommand(30.0,fnSendToInProgress(oTarg)); }