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

Pages: [1]   Go Down
  Print  
Author Topic: Buffs  (Read 3865 times)
0 Members and 1 Guest are viewing this topic.
bapenguin
Guest
« on: March 29, 2004, 11:49:35 AM »

I have a question regarding buffs, I'm creating a mod that is called "The Sword in the Stone."  Basically when you pull the sword I want it to give the user a 1 turn buff for an insane amount of attack.  I can't for the life of me figure out how buffs work in the database.  I tried playing with the text of the arrays, but can't seem to get it to play nice with PHP.  Can anyone help?
Logged
robert
Old Dog
Mod God
*****
Offline Offline

Posts: 1047


LoGD Buff!


View Profile WWW
« Reply #1 on: March 29, 2004, 11:58:13 AM »

this may be what your looking for:

$session[bufflist][101] = array("name"=>"`4Sword Master Maddness","rounds"=>1,"wearoff"=>"`4Your swordmaster skills fade.","atkmod"=>3.25,"roundmsg"=>"`4You've got a swordmasters maddness going, your sword skills are amazing!.","activate"=>"offense");

the "rounds"=>1  is set for 1 round of battle
the "atkmod"=>3.25  is set for increasing attack 3.25 times
Logged

bapenguin
Guest
« Reply #2 on: April 16, 2004, 10:15:21 AM »

does anyone know how to make a buff last from day to day?
Logged
markneill
Guest
« Reply #3 on: April 16, 2004, 11:06:40 AM »

You'll have to modify newday.php to let the buff cross over - the buffs array is blanked out when newday() is called, so you have to capture the buff before that happens, then restore it afterward.
Logged
markneill
Guest
« Reply #4 on: April 16, 2004, 11:08:55 AM »

Also, in the buff array code, the "101" is just a label.  You shouldn't use 101, as it's in use by something else, probably.

Suggestion, make it look something like:

$session[bufflist]['swordinstone'] = array(
    "name"=>"`4Sword Master Maddness",
    "rounds"=>1,
    "wearoff"=>"`4Your swordmaster skills fade.",
    "atkmod"=>3.25,
    "roundmsg"=>"`4You've got a swordmasters maddness going, your sword skills are amazing!.",
    "activate"=>"offense");
Logged
bapenguin
Guest
« Reply #5 on: April 17, 2004, 05:51:55 AM »

I see this code in newday:
Code:
$tempbuf = unserialize($session['user']['bufflist']);
      $session['user']['bufflist']="";
      $session['bufflist']=array();
      while(list($key,$val)=@each($tempbuff)){
         if ($val['survivenewday']==1){
            $session['bufflist'][$key]=$val;
            output("{$val['newdaymessage']}`n");
         }
      }

is there an ption to make it stay using that? I tried adding a field called survivenewday to the buff but it still doesn't hold it.  Any ideas?
Logged
Voratus
Guest
« Reply #6 on: April 17, 2004, 09:34:18 AM »

WIthout analyzing it too much, here's my input. Do you have one specific buff that you want to maintain from day to day? If so, throw a field in the accounts table tinyint(3), and set it when the buff is activated.

Right after the unsetting of buffs, check that value. If it's set, add the buff back.
This won't work if you want the buff to expire on its own for good, as each new day the buff will return in full. You'd have to manually unset that value to make the buff disappear.
Logged
markneill
Guest
« Reply #7 on: April 17, 2004, 02:03:25 PM »

is there an ption to make it stay using that? I tried adding a field called survivenewday to the buff but it still doesn't hold it.  Any ideas?

In the list of buff parameters (name, wearoff, etc...), add...

'survivenewday' => "1"

With the appropriate commas and such.
Logged
bapenguin
Guest
« Reply #8 on: April 18, 2004, 06:12:23 PM »

I tried that, and it doesn't seem to work, adding the survive new day option

I like the idea of a tag...on the account, that's easy enough.  
« Last Edit: April 18, 2004, 06:13:06 PM by bapenguin » Logged
Dubheasa
Guest
« Reply #9 on: April 27, 2004, 10:28:21 PM »

there's a slight typo in the newday program which prevents buffs from surviving the newday...

look for:
$tempbuf = unserialize($session['user']['bufflist']);

and replace it with:
$tempbuff = unserialize($session['user']['bufflist']);
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Version 1.1.2 is the current supported version and is available for download.

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