Profile  Register  Calendar  Memberlist  FAQ  Search Home  
Tribes RPG Forums : Powered by vBulletin version 2.0.3 Tribes RPG Forums > Misc > Contributors Forum > JI this is for you and ALL server owners....
  Last Thread   Next Thread
Author
Thread    Post New Thread    Post A Reply
Gul'Dar
TravellerThug

Registered: Mar 2001
Location: Washington State
Posts: 676

can we implement this? I got it from Gauntlet RPG...


//==== ANTI-SPAM CHECK, CAUSE FOR SPAM UNKNOWN ==========
%time = getIntegerTime(true) >> 5;
if(%time - %clientId.lastFireTime <= $firetimedelay)
return;
%clientId.lastFireTime = %time;
// ==============================
=========================

$los:bject = "";
if(GameBase::getLOSinfo(%play
er, %length))
{
%target = $los:bject;
%obj = getObjectType(%target);
%type = GameBase::getDataName(%target)
;

if(%type == "Crystal")
{
%brflag = String::findSubStr(fetchData(%
clientId, "RACE"), "Human"); //must be human to mine
if(Vector::getDistance(%cli
entId.lastMinePos, GameBase::getPosition(%clientI
d)) > 1.0 && %brflag != -1)
{
playSound(SoundHitore, GameBase::getPosition(%target)
); //vectrex, modified by JI

%score = DoRandomMining(%clientId, %target);
if(%score != "")
{
Player::incItemCount(%cli
entId, %score, 1);
RefreshAll(%clientId);
if(%score.description == "Ore") %minedname = "a hunk of raw ore";
if(%score.description == "Quartz") %minedname = "a piece of Quartz";
if(%score.description == "Granite") %minedname = "a slab of Granite";
if(%score.description == "Opal") %minedname = "an Opal";
if(%score.description == "Jade") %minedname = "a piece of Jade";
if(%score.description == "Turquoise") %minedname = "a piece of Turquoise";
if(%score.description == "Ruby") %minedname = "a shiny red Ruby";
if(%score.description == "Topaz") %minedname = "a Topaz";
if(%score.description == "Sapphire") %minedname = "a crystal blue Sapphire";
if(%score.description == "Gold") %minedname = "a hunk of Gold";
if(%score.description == "Emerald") %minedname = "a shiny green Emerald";
if(%score.description == "Diamond") %minedname = "a shiny Diamond";
if(%score.description == "Keldrinite") %minedname = "a glowing red Keldrinite crystal";
if(%minedname == "") %minedname = "a crumbled rock which turend to a cloud of dust";
Client::sendMessage(%clie
ntId, $MsgBeige, "You found " @ %minedname @ ".");

//if(floor(getRandom() * 20) == 5)
//%clientId.lastMinePos = GameBase::getPosition(%clientI
d);
}
UseSkill(%clientId, $SkillMining, True, True);
}
else
{
playSound(SoundHitore2, GameBase::getPosition(%target)
);
Client::SendMessage(%clien
tId, $MsgBeige, "You found a crumbled rock which turend to a cloud of dust.");
}
}

if(%obj == "Player")
GameBase::virtual(%target, "onDamage", "", 1.0, "0 0 0", "0 0 0", "0 0 0", "torso", "front_right", %clientId, %weapon);
}

PostAttack(%clientId, %weapon);
}

function PostAttack(%clientId, %weapon)
{
if($postAttackGraphBar)
{
%t = $WeaponDelay[%weapon];
%ticks = 30;
%chunks = 10;

%chunklen = floor(%ticks / %chunks);
%d = %t / %chunks;

for(%i = 0; %i <= %chunks; %i++)
schedule("bottomprint(" @ %clientId @ ", \" \" @ String::create(\"\", " @ %ticks @ " - (" @ %chunklen @ " * " @ %i @ ")) @ \"\", " @ %d @ " + 0.25);", %d * %i);
}
}

function DoRandomMining(%clientId, %crystal)
{
%lastscore = "";
for(%i = 1; $ItemList[Mining, %i] != ""; %i++)
{
%w1 = GetWord($ItemList[Mining, %i], 1) - %crystal.bonus[%i];
%n = Cap( (%w1 * getRandom()) + (%w1 / 2), 0, %w1);
%r = 1 + ($PlayerSkill[%clientId, $SkillMining] * (1/10)) * getRandom();

if(%n > %r)
return %lastscore;

%lastscore = GetWord($ItemList[Mining, %i], 0);
}
return %lastscore;
}


__________________
-----------------------------------------------
Server: Divine Mythical Realms
Name: Gul'Dar
Class: Paladin
Level: 104
Remort: 1
Admin Level: 2 (Guide)
-----------------------------------------------

Report this post to a moderator | IP: Logged

Gul'Dar is offline Old Post 03-30-2001 06:28 AM
Click Here to See the Profile for Gul'Dar Click here to Send Gul'Dar a Private Message Click Here to Email Gul'Dar Visit Gul'Dar's homepage! Find more posts by Gul'Dar Add Gul'Dar to your buddy list Edit/Delete Message Reply w/Quote
All times are GMT. The time now is 03:45 PM.    Post New Thread    Post A Reply
Last Thread   Next Thread
[ Show a Printable Version | Email This Page to Someone! | Receive updates to this thread ]

Forum Jump:
 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
 

< Contact Us - Tribes RPG >

Powered by: vBulletin Version 2.0.3
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Anything posted on these forums or privately messaged to any dev
team member (including email) becomes property of the Tribes RPG team.