DragonPrime - LoGD Resource Community
Welcome Guest
  • Good morning, Guest.
    Please log in, or register.
  • July 19, 2019, 02:59:06 AM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: [A.I. Script] - 'experience drainer'  (Read 3585 times)
0 Members and 1 Guest are viewing this topic.
ThricebornPhoenix
Codemeister
****
Offline Offline

Posts: 370


Dying is the easy part.


View Profile
« on: July 19, 2007, 05:39:08 PM »

Code:
global $badguy, $session;

if (!isset($badguy['spellpoints'])) {
$badguy['spellpoints'] = 15;
}

if ($badguy['spellpoints'] > 0) {
$badguy['spellpoints']--;
$round = 15 - $badguy['spellpoints'];

$exploss = round(pow(2, $round) / ($round * $round), 2);
$badguy['drain'] += $exploss;

$drain = round($badguy['drain'] * $session['user']['level'] / 15);
$session['user']['experience'] -= $drain;
output("`n`!%s experience was drained out of you!`0`n", $drain);
debug("round: $round, exploss: $exploss");
}

Experience drain is negligible for several rounds, but starts to pick up in the last few. Smiley Give it to a ghoul, vampire, Eythgim Villager, something like that >_> Should scale to the player's level, but I have only tested it on level 14.
Logged

"I was talking aloud to myself. A habit of the old: they choose the wisest person present to speak to; the long explanations needed by the young are wearying."
XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« Reply #1 on: July 19, 2007, 09:23:44 PM »

just an FYI: You don't have to name the counters "spellpoints". You cann call it "counter", "thricesslices" or something totally different - as long as it is not used in a standard badguy array Smiley

(BTW: Nice one... I think I'll use this. Grin )
Logged

Running for more than three years now:
ThricebornPhoenix
Codemeister
****
Offline Offline

Posts: 370


Dying is the easy part.


View Profile
« Reply #2 on: July 20, 2007, 10:24:53 AM »

Funny you should say that... I wrote a couple of more complex scripts in which I use "counter" Smiley One already has "spellpoints", the other... I guess it seemed more appropriate.

I guess "spellpoints" sounds like a good, generic term... I like the sound of "thricesslices", though. Grin
Logged

"I was talking aloud to myself. A habit of the old: they choose the wisest person present to speak to; the long explanations needed by the young are wearying."
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Welcome to DragonPrime - The LoGD Resource Community!

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
95 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search