Advertisement
Guest User

Untitled

a guest
Jul 26th, 2020
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. void main()
  2. {
  3. object oOrigin = GetFirstObjectInArea(OBJECT_SELF);
  4. object oArea = GetArea(OBJECT_SELF);
  5. object oPC = GetFirstPC();
  6. int iCount = 0;
  7. int iCheck = 0;
  8.  
  9. //Check for players and DM avatars.
  10. while(oPC != OBJECT_INVALID)
  11. {
  12. if(GetArea(oPC) == oArea)
  13. {
  14. iCheck = 1;
  15. break;
  16. }
  17. oPC = GetNextPC();
  18. }
  19.  
  20. //Check if any creatures are possessed by a DM.
  21. object oCreature = GetNearestCreature(4, 1, oOrigin, iCount);
  22. while(oCreature != OBJECT_INVALID)
  23. {
  24. if(GetIsDMPossessed(oCreature))
  25. {
  26. iCheck = 1;
  27. break;
  28. }
  29. oCreature = GetNearestCreature(4, 1, oOrigin, ++iCount);
  30. }
  31.  
  32. //If iCheck isn't set due to empty area, destroy all creatures.
  33. if(iCheck != 1)
  34. {
  35. iCount = 0;
  36. oCreature = GetNearestCreature(4, 1, oOrigin, ++iCount);
  37. while(oCreature != OBJECT_INVALID)
  38. {
  39. DestroyObject(oCreature);
  40. oCreature = GetNearestCreature(-1, -1, oOrigin, ++iCount);
  41. /*
  42. eDam = EffectDamage(iDamage, DAMAGE_TYPE_ACID);
  43. SetLootable(oTarget, FALSE);
  44. ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
  45. */
  46. }
  47. }
  48. }
  49.  
  50.  
  51.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement