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
|