aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/Avatar
diff options
context:
space:
mode:
authorTeravus Ovares2008-05-03 15:39:40 +0000
committerTeravus Ovares2008-05-03 15:39:40 +0000
commite8acb49fefc0e567510b4058b6571599a0158b62 (patch)
treed87243f8d596b6df07db190ba30bf2da4d608c18 /OpenSim/Region/Environment/Modules/Avatar
parent* Committing some collision stuffs that I'm working on. (diff)
downloadopensim-SC_OLD-e8acb49fefc0e567510b4058b6571599a0158b62.zip
opensim-SC_OLD-e8acb49fefc0e567510b4058b6571599a0158b62.tar.gz
opensim-SC_OLD-e8acb49fefc0e567510b4058b6571599a0158b62.tar.bz2
opensim-SC_OLD-e8acb49fefc0e567510b4058b6571599a0158b62.tar.xz
* For your fragging desire, damage enabled land works, but watch out!, life does not regenerate until you're dead!
Diffstat (limited to 'OpenSim/Region/Environment/Modules/Avatar')
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs77
1 files changed, 74 insertions, 3 deletions
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs
index 966c5e2..aa7e690 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs
@@ -186,6 +186,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
186 scene.EventManager.OnClientClosed += ClientLoggedOut; 186 scene.EventManager.OnClientClosed += ClientLoggedOut;
187 scene.EventManager.OnValidateLandBuy += ValidateLandBuy; 187 scene.EventManager.OnValidateLandBuy += ValidateLandBuy;
188 scene.EventManager.OnLandBuy += processLandBuy; 188 scene.EventManager.OnLandBuy += processLandBuy;
189 scene.EventManager.OnAvatarKilled += KillAvatar;
189 } 190 }
190 } 191 }
191 192
@@ -1390,7 +1391,11 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
1390 { 1391 {
1391 if (avatar.Scene.RegionInfo.originRegionID != m_rootAgents[avatar.UUID]) 1392 if (avatar.Scene.RegionInfo.originRegionID != m_rootAgents[avatar.UUID])
1392 { 1393 {
1394
1395
1393 m_rootAgents[avatar.UUID] = avatar.Scene.RegionInfo.originRegionID; 1396 m_rootAgents[avatar.UUID] = avatar.Scene.RegionInfo.originRegionID;
1397
1398
1394 //m_log.Info("[MONEY]: Claiming " + avatar.Firstname + " " + avatar.Lastname + " in region:" + avatar.RegionHandle + "."); 1399 //m_log.Info("[MONEY]: Claiming " + avatar.Firstname + " " + avatar.Lastname + " in region:" + avatar.RegionHandle + ".");
1395 // Claim User! my user! Mine mine mine! 1400 // Claim User! my user! Mine mine mine!
1396 if (m_MoneyAddress.Length > 0) 1401 if (m_MoneyAddress.Length > 0)
@@ -1400,12 +1405,12 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
1400 { 1405 {
1401 Hashtable hresult = 1406 Hashtable hresult =
1402 claim_user(avatar.UUID, avatar.ControllingClient.SecureSessionId, regionID, RegionItem.RegionInfo.regionSecret); 1407 claim_user(avatar.UUID, avatar.ControllingClient.SecureSessionId, regionID, RegionItem.RegionInfo.regionSecret);
1403 if ((bool) hresult["success"] == true) 1408 if ((bool)hresult["success"] == true)
1404 { 1409 {
1405 int funds = 0; 1410 int funds = 0;
1406 try 1411 try
1407 { 1412 {
1408 funds = (Int32) hresult["funds"]; 1413 funds = (Int32)hresult["funds"];
1409 } 1414 }
1410 catch (InvalidCastException) 1415 catch (InvalidCastException)
1411 { 1416 {
@@ -1414,11 +1419,23 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
1414 } 1419 }
1415 else 1420 else
1416 { 1421 {
1417 avatar.ControllingClient.SendAgentAlertMessage((string) hresult["errorMessage"], true); 1422 avatar.ControllingClient.SendAgentAlertMessage((string)hresult["errorMessage"], true);
1418 } 1423 }
1419 } 1424 }
1420 } 1425 }
1421 } 1426 }
1427 else
1428 {
1429 ILandObject obj = avatar.Scene.LandChannel.getLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y);
1430 if ((obj.landData.landFlags & (uint)Parcel.ParcelFlags.AllowDamage) != 0)
1431 {
1432 avatar.Invulnerable = false;
1433 }
1434 else
1435 {
1436 avatar.Invulnerable = true;
1437 }
1438 }
1422 } 1439 }
1423 else 1440 else
1424 { 1441 {
@@ -1457,6 +1474,60 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
1457 //m_log.Info("[FRIEND]: " + avatar.Name + " status:" + (!avatar.IsChildAgent).ToString()); 1474 //m_log.Info("[FRIEND]: " + avatar.Name + " status:" + (!avatar.IsChildAgent).ToString());
1458 } 1475 }
1459 1476
1477 private void KillAvatar(uint killerObjectLocalID, ScenePresence DeadAvatar)
1478 {
1479 if (killerObjectLocalID == 0)
1480 DeadAvatar.ControllingClient.SendAgentAlertMessage("You committed suicide!", true);
1481 else
1482 {
1483 bool foundResult = false;
1484 string resultstring = "";
1485 List<ScenePresence> allav = DeadAvatar.Scene.GetScenePresences();
1486 try
1487 {
1488 foreach (ScenePresence av in allav)
1489 {
1490 if (av.LocalId == killerObjectLocalID)
1491 {
1492 av.ControllingClient.SendAlertMessage("You fragged " + DeadAvatar.Firstname + " " + DeadAvatar.Lastname);
1493 resultstring = av.Firstname + " " + av.Lastname;
1494 foundResult = true;
1495 }
1496 }
1497 } catch (System.InvalidOperationException)
1498 {
1499
1500 }
1501
1502 if (!foundResult)
1503 {
1504 SceneObjectPart part = DeadAvatar.Scene.GetSceneObjectPart(killerObjectLocalID);
1505 if (part != null)
1506 {
1507 ScenePresence av = DeadAvatar.Scene.GetScenePresence(part.OwnerID);
1508 if (av != null)
1509 {
1510 av.ControllingClient.SendAlertMessage("You fragged " + DeadAvatar.Firstname + " " + DeadAvatar.Lastname);
1511 resultstring = av.Firstname + " " + av.Lastname;
1512 DeadAvatar.ControllingClient.SendAgentAlertMessage("You got killed by " + resultstring + "!", true);
1513 }
1514 else
1515 {
1516 string killer = DeadAvatar.Scene.CommsManager.UUIDNameRequestString(part.OwnerID);
1517 DeadAvatar.ControllingClient.SendAgentAlertMessage("You impailed yourself on " + part.Name + " owned by " + killer +"!", true);
1518 }
1519 //DeadAvatar.Scene. part.ObjectOwner
1520 }
1521 else
1522 {
1523 DeadAvatar.ControllingClient.SendAgentAlertMessage("You died!", true);
1524 }
1525 }
1526 }
1527 DeadAvatar.Health = 100;
1528 DeadAvatar.Scene.TeleportClientHome(DeadAvatar.UUID, DeadAvatar.ControllingClient);
1529 }
1530
1460 #endregion 1531 #endregion
1461 } 1532 }
1462 1533