Author Topic: The Code....  (Read 25737 times)

0 Members and 2 Guests are viewing this topic.

eViL

  • Uber Menace
  • *******
  • Posts: 1,022
  • Reputation: +0/-0
The Code....
« on: March 22, 2003 03:09 am CST »
yes, its the code....

//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// This Makes Declared Items UnDroppable
// $DropProo
f[%item] = true;

function Item::onDrop(%player,%item)
{
   dbecho($dbechoMode, "Item::onDrop(" @ %player @ ", " @ %item @ ")");

   if($matchStarted)
   {
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
      if($DropProof[%item])
         return;
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

      if(%item.className != Armor)
      {
         if(%item.className == Projectile)
            %delta = 20;
         else
            %delta = 1;

         if(Player::getItemCount(%player, %item) < %delta)
            %delta = Player::getItemCount(%player, %item);

         if(%delta > 0)
         {
            %obj = newObject("","Item",%item,1,false);
            %obj.delta = %delta;
                schedule("Item::Pop(" @ %obj @ ");", $ItemPopTime, %obj);
               addToSet("MissionCleanup", %obj);

            if(IsDead(%player))
               GameBase::throw(%obj, %player, 10, true);
            else
            {
               GameBase::throw(%obj, %player, 15, false);
               Item::playPickupSound(%obj);
            }

            Player::decItemCount(%player,%item,%delta);
            RefreshAll(Player::getClient(%player));
            return %obj;
         }
      }
   }
}

function Ammo::onDrop(%player, %item)
{
   dbecho($dbechoMode, "Ammo::onDrop(" @ %player @ ", " @ %item @ ")");

   if($matchStarted)
   {

//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
      if($DropProof[%item])
         return;
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

      if(%item.className == Ammo)
         %delta = 20;
      else
         %delta = 1;

      if(Player::getItemCount(%player, %item) < %delta)
         %delta = Player::getItemCount(%player, %item);

      if(%delta > 0)
      {
         %obj = newObject("","Item",%item,%delta,false);
         %obj.delta = %delta;
         schedule("Item::Pop(" @ %obj @ ");", $ItemPopTime, %obj);
         addToSet("MissionCleanup", %obj);
         GameBase::throw(%obj,%player,20,false);
         Item::playPickupSound(%obj);
         Player::decItemCount(%player,%item,%delta);
         RefreshAll(Player::getClient(%player));
      }
   }
}

//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// This Puts Items Declared Into Storage Upon Death
// $DeathStorage[%item] = true;

function Player::onKilled(%this)
{
   dbecho($dbechoMode, "Player::onKilled(" @ %this @ ")");
   %clientId = Player::getClient(%this);
   %killerId = fetchData(%clientId, "tmpkillerid");
   storeData(%clientId, "tmpkillerid", "");
   Client::setControlObject(%clientId.possessId, %clientId.possessId);
   Client::setControlObject(%clientId, %clientId);
   storeData(%clientId.possessId, "dumbAIflag", "");
   $possessedBy[%clientId.possessId] = "";

   if(IsStillArenaFighting(%clientId))
   {
      %a = GetArenaDuelerIndex(%clientId);
      $ArenaDueler[%a] = GetWord($ArenaDueler[%a], 0) @ " DEAD";

      if(!Player::IsAiControlled(%clientId))
         %clientId.RespawnMeInArena = True;
   }
   else if(IsInRoster(%clientId))
   {
      if(Player::isAiControlled(%clientId))
         RemoveFromRoster(%clientId);
   }
   else if(fetchData(%clientId, "noDropLootbagFlag"))
   { }
   else
   {
      %tmploot = "";

      if(fetchData(%clientId, "COINS") > 0)
         %tmploot = %tmploot @ "COINS " @ floor(fetchData(%clientId, "COINS")) @ " ";

      storeData(%clientId, "COINS", 0);
      %max = getNumItems();

      for (%i = 0; %i < %max; %i++)
      {
         %a = getItemData(%i);
         %itemcount = Player::getItemCount(%clientId, %a);

         if(%itemcount)
         {
            %flag = False;

            if(fetchData(%clientId, "LCK") >= 0)
            {
               if(Player::getMountedItem(%clientId, $WeaponSlot) == %a || %a.className == "Equipped" || $LoreItem[%a] == True)
                  %flag = True;
            }
            else
               %flag = True;

            if(fetchData(%clientId, "LCK") < 0 && Player::isAiControlled(%clientId))
               %flag = True;

            if(%a == CastingBlade)
               %flag = False;

            if($StealProtectedItem[%a])
               %flag = False;

//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
            if($DeathStorage[%item])
            {
               %b = getItemData(%i);

               if(%b.className == "Equipped")
                  %b = String::getSubStr(%b, 0, String::len(%b)-1);

               storeData(%clientId, "BankStorage", SetStuffString(fetchData(%clientId, "BankStorage"), %b, %itemcount));
               Player::setItemCount(%clientId, %a, 0);
            }
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

            if(%flag)
            {
               %b = %a;

               if(%b.className == "Equipped")
                  %b = String::getSubStr(%b, 0, String::len(%b)-1);

               if(Player::getMountedItem(%clientId, $WeaponSlot) == %a)
               {
                  %tmploot = %tmploot @ %b @ " 1 ";
                  Player::decItemCount(%clientId, %a);
               }
               else
               {
                  %tmploot = %tmploot @ %b @ " " @ Player::getItemCount(%clientId, %a) @ " ";
                  Player::setItemCount(%clientId, %a, 0);
               }
            }
         }
      }

      if(%tmploot != "")
      {
         if(Player::isAiControlled(%clientId))
            TossLootbag(%clientId, %tmploot, 1, "*", 300);
         else
         {
            %namelist = Client::getName(%clientId) @ ",";

            if(fetchData(%clientId, "LCK") >= 0)
               TossLootbag(%clientId, %tmploot, 5, %namelist, Cap(fetchData(%clientId, "LVL") * 300, 300, 3600));
            else
               TossLootbag(%clientId, %tmploot, 5, %namelist, Cap(fetchData(%clientId, "LVL") * 0.2, 5, "inf"));
         }
      }

      updateSpawnStuff(%clientId);
      %victimH = fetchData(%clientId, "MyHouse");
      %killerH = fetchData(%killerId, "MyHouse");
      %vhn = GetHouseNumber(%victimH);
      %khn = GetHouseNumber(%killerH);

      if(%vhn != "")
      {
         if(fetchData(%clientId, "LCK") < 0)
         {
            if(fetchData(%clientId, "RankPoints") <= 0)
               BootFromCurrentHouse(%clientId, True);
            else
               Client::sendMessage(%clientId, $MsgRed, "You have lost all your Rank Points because you died with 0 LCK!");

            storeData(%clientId, "RankPoints", 0);
         }

         Client::sendMessage(%clientId, $MsgWhite, "You lost 2 Rank Points.");
         storeData(%clientId, "RankPoints", 2, "dec");

         if(%khn != "")
         {
            if(%khn != %vhn)
            {
               Client::sendMessage(%killerId, $MsgWhite, "You gained 1 Rank Point!");
               storeData(%killerId, "RankPoints", 1, "inc");
            }
            else
            {
               Client::sendMessage(%killerId, $MsgWhite, "You lost 1 Rank Point.");
               storeData(%killerId, "RankPoints", 1, "dec");
            }
         }
      }
      else if(%vhn == "" && %khn != "")
      { }

      if(!IsInArenaDueler(%clientId) && !Player::isAiControlled(%clientId) && fetchData(%clientId, "LCK") < 0)
      {
         if($hardcore)
         {
            if(fetchData(%clientId, "LVL") > 8 && fetchData(%clientId, "RemortStep") > 0)
            {
               if(!Player::isAiControlled(%killerId))
                  ResetPlayer(%clientId);
            }
         }

         storeData(%clientId, "zone", "");
      }
   }

   if(fetchData(%clientId, "deathmsg") != "")
   {
      %kitem = Player::getMountedItem(%killerId, $WeaponSlot);
      %msg = nsprintf(fetchData(%clientId, "deathmsg"), Client::getName(%killerId), Client::getName(%clientId), %kitem.description);
      remoteSay(%clientId, 0, %msg);
   }

   if(Player::isAiControlled(%clientId))
   {
      %i = GetEventCommandIndex(%clientId, "onkill");

      if(%i != -1)
      {
         %name = GetWord($EventCommand[%clientId, %i], 0);
         %type = GetWord($EventCommand[%clientId, %i], 1);
         %cl = NEWgetClientByName(%name);

         if(%cl == -1)
            %cl = 2048;

         %cmd = String::NEWgetSubStr($EventCommand[%clientId, %i], String::findSubStr($EventCommand[%clientId, %i], ">")+1, 99999);
         %pcmd = ParseBlockData(%cmd, %clientId, %killerid);
         $EventCommand[%clientId, %i] = "";
         schedule("remoteSay(" @ %cl @ ", 0, \"" @ %pcmd @ "\", \"" @ %name @ "\");", 2);
      }

      ClearEvents(%clientId);
   }

   storeData(%clientId, "noDropLootbagFlag", "");
   storeData(%clientId, "SpellCastStep", "");
   %clientId.sleepMode = "";
   refreshHPREGEN(%clientId);
   refreshMANAREGEN(%clientId);
   Client::setControlObject(%clientId, %clientId);
   storeData(%clientId, "dumbAIflag", "");
   storeData(%clientId, "lastzone", fetchData(%clientId, "zone"));
   PlaySound(RandomRaceSound(fetchData(%clientId, "RACE"), Death), GameBase::getPosition(%clientId));
   %clientId.dead = 1;

   if($AutoRespawn > 0)
      schedule("Game::autoRespawn(" @ %clientId @ ");",$AutoRespawn,%clientId);

   Player::setDamageFlash(%this,0.75);

   if(%clientId != -1)
   {
      if(%this.vehicle != "")
      {
         if(%this.driver != "")
         {
            %this.driver = "";
            Client::setControlObject(Player::getClient(%this), %this);
            Player::setMountObject(%this, -1, 0);
         }
         else
         {
            %this.vehicle.Seat[%this.vehicleSlot-2] = "";
            %this.vehicleSlot = "";
         }

         %this.vehicle = "";
      }

      schedule("GameBase::startFadeOut(" @ %this @ ");", $CorpseTimeoutValue, %this);
      Client::setOwnedObject(%clientId, -1);
      Client::setControlObject(%clientId, Client::getObserverCamera(%clientId));
      Observer::setOrbitObject(%clientId, %this, 15, 15, 15);
      schedule("deleteObject(" @ %this @ ");", $CorpseTimeoutValue + 2.5, %this);
      %clientId.observerMode = "dead";
      %clientId.dieTime = getSimTime();
   }
}

//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// This Sets User Lists For Set Items
// $UserList[%item] = "%name1 %name2 %name3 .... ";

function Item::onUse(%player,%item)
{
   dbecho($dbechoMode, "Item::onUse(" @ %player @ ", " @ %item @ ")");

   %clientId = Player::getClient(%player);

   if(!IsDead(%clientId))
   {

//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
      if($UserList[%item] != "")
      {
         %name = Client::getName(%clientId);
         %found = false;

         for(%i=0; (%word=getWord($UserList[%item], %i)) != ""; %i++)
         {
            if(%word == %name)
               %found = true;
         }

         if(!%found)
            return;
      }
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

      if(%item.className == Accessory)
      {
         %cnt = 0;
         %max = getNumItems();

         for(%i = 0; %i < %max; %i++)
         {
            %checkItem = getItemData(%i);

            if(%checkItem.className == Equipped && GetAccessoryVar(%checkItem, $AccessoryType) == GetAccessoryVar(%item, $AccessoryType))
               %cnt += Player::getItemCount(%player, %checkItem);
         }

         if(SkillCanUse(%clientId, %item))
         {
            if(%cnt < $maxAccessory[GetAccessoryVar(%item, $AccessoryType)])
            {
               Client::sendMessage(%clientId, $MsgBeige, "You equipped " @ %item.description @ ".");
               Player::setItemCount(%player, %item, Player::getItemCount(%player, %item)-1);
               Player::setItemCount(%player, %item @ "0", Player::getItemCount(%player, %item @ "0")+1);
            }
            else
               Client::sendMessage(%clientId, $MsgRed, "You can't equip this item because you have too many already equipped.~wC_BuySell.wav");
         }
         else
            Client::sendMessage(%clientId, $MsgRed, "You can't equip this item because you lack the necessary skills.~wC_BuySell.wav");

         if($OverrideMountPoint[%item] == "")
            Player::mountItem(%player, %item @ "0", 1, 0);
      }
      else if(%item.className == Equipped)
      {
         %o = String::getSubStr(%item, 0, String::len(%item)-1);
         Client::sendMessage(%clientId, $MsgBeige, "You unequipped " @ %item.description @ ".");
         Player::setItemCount(%player, %item, Player::getItemCount(%player, %item)-1);
         Player::setItemCount(%player, %o, Player::getItemCount(%player, %o)+1);

         if($OverrideMountPoint[%item] == "")
            Player::unMountItem(%player, 1);
      }
      else
         RPGmountItem(%player, %item, $DefaultSlot);

      refreshHP(%clientId, 0);
      refreshMANA(%clientId, 0);
      RefreshAll(%clientId);
   }
}

//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// Declare Your Item Special Features

$StealProtectedItem[BadgeOfHonor] = true;
$DeathStorage[BadgeOfHonor] = true;
$DropProof[BadgeOfHonor] = true;

$StealProtectedItem[BadgeOfLoyalty] = true;
$DeathStorage[BadgeOfLoyalty] = true;
$DropProof[BadgeOfLoyalty] = true;

$StealProtectedItem[BadgeOfFriendship] = true;
$DeathStorage[BadgeOfFriendship] = true;
$DropProof[BadgeOfFriendship] = true;

$StealProtectedItem[BadgeOfReverence] = true;
$DeathStorage[BadgeOfReverence] = true;
$DropProof[BadgeOfReverence] = true;

$StealProtectedItem[LightningBlade] = true;
$DeathStorage[LightningBlade] = true;
$DropProof[LightningBlade] = true;
$UserList[LightningBlade] = "Ozzy Particle Pecker Draak Funger eViL Mithrandir";

p.s. - spacing complimentary to our friendly < pre > HTML command =)
« Last Edit: December 31, 1969 06:00 pm CST by eViL »
Quote from: "LastWish || NextWish"
eViL, you were probably the coolest but most misunderstood person in this community.. maybe the rest will find out how cool of a person you are some day, and don't get too mad at the people who dont understand you.. its their loss in the end.

Hollywood

  • Orb Member
  • Elvin Legion
  • ***
  • Posts: 418
  • Reputation: +0/-0
(No subject)
« Reply #1 on: March 22, 2003 05:03 pm CST »
Woohoo.
« Last Edit: December 31, 1969 06:00 pm CST by Hollywood »

funger

  • Orc Thrasher
  • ***
  • Posts: 138
  • Reputation: +1/-1
(No subject)
« Reply #2 on: March 24, 2003 01:20 am CST »
looks good to me, but can i have all my items steal protected lol.
good job evil
« Last Edit: December 31, 1969 06:00 pm CST by funger »

Vorter_X_

  • Centurian Lord
  • ********
  • Posts: 2,693
  • Reputation: +2/-0
(No subject)
« Reply #3 on: March 24, 2003 02:40 am CST »
where is my name in there????
« Last Edit: December 31, 1969 06:00 pm CST by Vorter_X_ »

Hollywood

  • Orb Member
  • Elvin Legion
  • ***
  • Posts: 418
  • Reputation: +0/-0
(No subject)
« Reply #4 on: March 24, 2003 02:04 pm CST »
Oh yeah, instead of Mithrandir, that should be Gnarus.
« Last Edit: December 31, 1969 06:00 pm CST by Hollywood »

Crash

  • Rapist!!!
  • Uber Menace
  • Posts: 1,079
  • Reputation: +0/-0
(No subject)
« Reply #5 on: March 29, 2003 07:48 pm CST »
...
*crie*
« Last Edit: December 31, 1969 06:00 pm CST by Crash »

Sabby

  • Gnoll Fighter
  • **
  • Posts: 87
  • Reputation: +0/-0
(No subject)
« Reply #6 on: March 29, 2003 11:15 pm CST »
Gnarus has admin?... Go eViL!
« Last Edit: December 31, 1969 06:00 pm CST by Sabby »
-Sabby

UnderGod

  • Centurian Lord
  • ********
  • Posts: 2,691
  • Reputation: +0/-0
(No subject)
« Reply #7 on: March 30, 2003 01:37 pm CST »
None of those people listed have admin except Part and myself.


And frankly, I would shoot myself if Mith had admin.
« Last Edit: December 31, 1969 06:00 pm CST by UnderGod »
"The right man in the wrong place can make all the difference in the world"

Sabby

  • Gnoll Fighter
  • **
  • Posts: 87
  • Reputation: +0/-0
(No subject)
« Reply #8 on: March 30, 2003 03:42 pm CST »
Quote from: "UnderGod"
None of those people listed have admin except Part and myself.


And frankly, I would shoot myself if Mith had admin.


Rofl...
« Last Edit: December 31, 1969 06:00 pm CST by Sabby »
-Sabby

xkenshinx

  • Centurian Lord
  • ********
  • Posts: 1,816
  • Reputation: +0/-0
(No subject)
« Reply #9 on: April 5, 2003 05:51 pm CST »
Quote from: "UnderGod"
None of those people listed have admin except Part and myself.


And frankly, I would shoot myself if Mith had admin.


not before u shoot particle ... for letting him be admin.. and then shooting mith.. for good measure ....
« Last Edit: December 31, 1969 06:00 pm CST by xkenshinx »

"First comes smiles, then lies. Last is gunfire." �Roland Deschain, of Gilead

Resident_Evil

  • Undead Hero
  • ****
  • Posts: 223
  • Reputation: +0/-0
(No subject)
« Reply #10 on: April 5, 2003 05:53 pm CST »
HS LOL
« Last Edit: December 31, 1969 06:00 pm CST by Resident_Evil »
Semper Fi,
Who dares, Wins

eViL

  • Uber Menace
  • *******
  • Posts: 1,022
  • Reputation: +0/-0
(No subject)
« Reply #11 on: April 5, 2003 10:35 pm CST »
*hears UltraKill from UT* =D
« Last Edit: December 31, 1969 06:00 pm CST by eViL »
Quote from: "LastWish || NextWish"
eViL, you were probably the coolest but most misunderstood person in this community.. maybe the rest will find out how cool of a person you are some day, and don't get too mad at the people who dont understand you.. its their loss in the end.

Kasuto

  • Goblin Pup
  • *
  • Posts: 27
  • Reputation: +0/-0
(No subject)
« Reply #12 on: July 14, 2003 06:32 am CDT »
$DropProof[cursedtent] = 1;
$StorageProof[cursedtent] = 1;

hehehehe. Then you could have bards #cast uncurse....for a fee of course ;)
« Last Edit: December 31, 1969 06:00 pm CST by Kasuto »

Vorter_X_

  • Centurian Lord
  • ********
  • Posts: 2,693
  • Reputation: +2/-0
(No subject)
« Reply #13 on: July 14, 2003 06:36 am CDT »
cused tent?
« Last Edit: December 31, 1969 06:00 pm CST by Vorter_X_ »

Kasuto

  • Goblin Pup
  • *
  • Posts: 27
  • Reputation: +0/-0
(No subject)
« Reply #14 on: July 14, 2003 07:02 am CDT »
cursed...in Dragon Warrior for nintendo there were cursed items (i think usually armor), that once equipped, couldn't be removed without a Shaman guy (the shaman guy also handled saving your game and reviving party members who died in combat if you didn't have someone in your party with revive). So if you had a cursed tent here, you'd be 40lbs over what you wanted and it'd of course not be a working tent, just a cursed item you're stuck with until you get uncursed.

Ya, i'm just that bored.
« Last Edit: December 31, 1969 06:00 pm CST by Kasuto »