public void aaDeregisterFromAvatarDeathEvents() { ScriptProtection.CheckThreatLevel(ThreatLevel.None, "AADeregisterFromAvatarDeathEvents", m_host, "AA"); ICombatModule module = World.RequestModuleInterface <ICombatModule>(); module.DeregisterFromAvatarDeathEvents(m_host.UUID); }
public void aaThawAvatar(string ID) { if (!ScriptProtection.CheckThreatLevel(ThreatLevel.Moderate, "AAThawAvatar", m_host, "AA", m_itemID)) { return; } UUID AgentID = UUID.Zero; if (UUID.TryParse(ID, out AgentID)) { IScenePresence SP; if (World.TryGetScenePresence(AgentID, out SP)) { ICombatModule module = World.RequestModuleInterface <ICombatModule>(); if (module.CheckCombatPermission(AgentID) || World.Permissions.IsGod(AgentID)) { //If they have combat permission on, do it whether the threat level is enabled or not SP.AllowMovement = true; return; } if (!ScriptProtection.CheckThreatLevel(ThreatLevel.High, "AAThawAvatar", m_host, "AA", m_itemID)) { return; } SP.AllowMovement = true; } } }
public LSL_List aaGetTeamMembers(LSL_String team) { ScriptProtection.CheckThreatLevel(ThreatLevel.Low, "AAGetTeamMembers", m_host, "AA"); List <UUID> Members = new List <UUID>(); ICombatModule module = World.RequestModuleInterface <ICombatModule>(); if (module != null) { Members = module.GetTeammates(team); } LSL_List members = new LSL_Types.list(Members.ToArray()); return(members); }
public void llSetDamage(double damage) { if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) { return; } m_host.ParentEntity.Damage = (float)damage; ICombatModule combatModule = World.RequestModuleInterface <ICombatModule>(); if (combatModule != null) { combatModule.AddDamageToPrim(m_host.ParentEntity); } }
//This asks the agent whether they would like to participate in the combat public void aaRequestCombatPermission(string ID) { ScriptProtection.CheckThreatLevel(ThreatLevel.None, "AARequestCombatPermission", m_host, "AA"); IScenePresence SP; UUID AgentID = UUID.Zero; if (UUID.TryParse(ID, out AgentID)) { if (World.TryGetScenePresence(AgentID, out SP)) { ICombatModule module = World.RequestModuleInterface <ICombatModule>(); if (!module.CheckCombatPermission(AgentID)) //Don't ask multiple times { RequestPermissions(SP, ScriptBaseClass.PERMISSION_COMBAT); } } } }
public LSL_List aaGetTeamMembers(LSL_String team) { if (!ScriptProtection.CheckThreatLevel(ThreatLevel.Low, "AAGetTeamMembers", m_host, "AA", m_itemID)) { return(new LSL_List()); } List <UUID> Members = new List <UUID>(); ICombatModule module = World.RequestModuleInterface <ICombatModule>(); if (module != null) { Members = module.GetTeammates(team); } LSL_List members = new LSL_List(); foreach (UUID member in Members) { members.Add(new LSL_Key(member.ToString())); } return(members); }
private void handleScriptAnswer(IClientAPI client, UUID taskID, UUID itemID, int answer) { if (taskID != m_host.UUID) { return; } UUID invItemID = InventorySelf(); if (invItemID == UUID.Zero) { return; } if (invItemID == itemID) { return; } client.OnScriptAnswer -= handleScriptAnswer; ICombatModule module = World.RequestModuleInterface <ICombatModule>(); //Tell the combat module about this new permission if ((answer & ScriptBaseClass.PERMISSION_COMBAT) == ScriptBaseClass.PERMISSION_COMBAT) { module.AddCombatPermission(client.AgentId); } //Tell the prim about the new permissions m_ScriptEngine.PostScriptEvent(m_itemID, m_host.UUID, new EventParams( "run_time_permissions", new Object[] { new LSL_Integer( answer) }, new DetectParams[0]), EventPriority.FirstStart); }