DragonPrime - LoGD Resource Community
Welcome Guest
  • Good afternoon, Guest.
    Please log in, or register.
  • November 20, 2017, 02:48:54 PM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: Buffs in Forest Specials  (Read 3014 times)
0 Members and 1 Guest are viewing this topic.
Lightbringer
Member
Codemeister
****
Offline Offline

Posts: 267


Life's a lich and then you don't die...damn unlife


View Profile
« on: February 23, 2005, 11:28:26 AM »

Okay...quick question...

I am currently working on a forest special (editing Stonehenge to allow for the multiple effects) regarding weather..

Now I am not worrying about hooking into the weather for the moment...

I am attempting to include buffs (whether positive or negative) in some of the cases...

Everything I have tried so far is not helping...

I will quote in an example of what I am attempting...

Quote
case 6:
            output("You press the button and suddenly - the forest is consumed by an invigorating mist!");
            apply_buff('mist', array(
            "startmsg"=>"An invigorating mist suffuses you with an amazing feeling of power and stamina!",
            "name"=>"Invigorating Mist",
            "rounds"=>4,
            "wearoff"=>"The feeling fades.",
            "atkmod"=>2,
            "defmod"=>1.5,
            "effectmsg"=>"You are stronger and tougher.",
            )
            break;

If I need to upload the entire file to allow for a better understanding..just let me know...

Any help would be great as this is having me nearly pull out my hair lol
Logged

________________________ _____________________

Lightbringer
PHP/SQL/VB.NET/C#/AJAX Developer
Sichae
iMod God
SVN Users
Mod God
*
Offline Offline

Posts: 3458


If ya didn't get it by now... you're hopeless...


View Profile WWW
« Reply #1 on: February 23, 2005, 11:32:10 AM »

Yours doesnt work, because you aren't closing the apply_buff(). You close the array, but not the apply.

Code:
case 6:
            output("You press the button and suddenly - the forest is consumed by an invigorating mist!");
            apply_buff('mist', array(
            "startmsg"=>"An invigorating mist suffuses you with an amazing feeling of power and stamina!",
            "name"=>"Invigorating Mist",
            "rounds"=>4,
            "wearoff"=>"The feeling fades.",
            "atkmod"=>2,
            "defmod"=>1.5,
            "effectmsg"=>"You are stronger and tougher.",
            )
            );
            break;

That is a working buff. Tongue Manipluate that, to do what you want.
« Last Edit: February 23, 2005, 11:36:00 AM by Sichae » Logged

If you didn't understand anything in the above post, don't try to attempt anything suggested.

Lightbringer
Member
Codemeister
****
Offline Offline

Posts: 267


Life's a lich and then you don't die...damn unlife


View Profile
« Reply #2 on: February 23, 2005, 11:56:35 AM »

I will try that now...lol
« Last Edit: February 23, 2005, 11:57:39 AM by Lightbringer » Logged

________________________ _____________________

Lightbringer
PHP/SQL/VB.NET/C#/AJAX Developer
Lightbringer
Member
Codemeister
****
Offline Offline

Posts: 267


Life's a lich and then you don't die...damn unlife


View Profile
« Reply #3 on: February 23, 2005, 12:09:30 PM »

It installs and appears to be working..

However it is repeatedly returning the same case...

Quote
case 2:
            output("All returns to normal and as it was before all of this curious weather business took place.`n");
            output("The staff glows slightly and vanishes before your very eyes. You stand there dumbfounded and wonder what the heck just happened...`n`n");
            output("You stand there long enough to realise you have lost 1 turn worrying about the glorified stick!");
            $session['user']['turns']-=1;
         break;

*** It shows the;
Quote
Something Special!
All returns to normal and as it was before all of this curious weather business took place.
Logged

________________________ _____________________

Lightbringer
PHP/SQL/VB.NET/C#/AJAX Developer
Sichae
iMod God
SVN Users
Mod God
*
Offline Offline

Posts: 3458


If ya didn't get it by now... you're hopeless...


View Profile WWW
« Reply #4 on: February 23, 2005, 12:10:27 PM »

Are you having it choose a random case, with e_rand(1,whatever) ?

If you are, you might want to try setting multiple cases, to do the same thing, and expand the min/max.

Such as:
Code:
switch (e_rand(1,25)){
case 1:
case 2:
case 3:
//code
break;
case 4:
case 5:
case 6:
// code
break;
And so on.
« Last Edit: February 23, 2005, 12:12:02 PM by Sichae » Logged

If you didn't understand anything in the above post, don't try to attempt anything suggested.

Lightbringer
Member
Codemeister
****
Offline Offline

Posts: 267


Life's a lich and then you don't die...damn unlife


View Profile
« Reply #5 on: February 23, 2005, 12:12:06 PM »

Quote
$session['user']['specialinc']="";
      $rand = e_rand(1,22);
      output("`#Knowing that the staff can't `ireally`i hurt you, you decide to take your chances.");
      output("You walk up to the staff and tentatively press the button.");
      output("As the button clicks in, the sky turns to a featureless void..You start to panic.");
      output("You start to feel a tingling which envelops your whole body.");
      output("Suddenly a bright, intense light envelops the staff, and you with it.");
      switch ($rand){
      case 1:
      case 2:
            output("All returns to normal and as it was before all of this curious weather business took place.`n");
            output("The staff glows slightly and vanishes before your very eyes. You stand there dumbfounded and wonder what the heck just happened...`n`n");
            output("You stand there long enough to realise you have lost 1 turn worrying about the glorified stick!");
            $session['user']['turns']-=1;
         break;
Logged

________________________ _____________________

Lightbringer
PHP/SQL/VB.NET/C#/AJAX Developer
Sichae
iMod God
SVN Users
Mod God
*
Offline Offline

Posts: 3458


If ya didn't get it by now... you're hopeless...


View Profile WWW
« Reply #6 on: February 23, 2005, 12:14:16 PM »

There are many files that you can look at, that deal with what you want. I suggest that you look at those, in order to get a better feel for what you are doing.
Logged

If you didn't understand anything in the above post, don't try to attempt anything suggested.

Lightbringer
Member
Codemeister
****
Offline Offline

Posts: 267


Life's a lich and then you don't die...damn unlife


View Profile
« Reply #7 on: February 23, 2005, 12:15:11 PM »

Thanks, Sichae...

I will rip up a couple more and see what makes them tick Wink
Logged

________________________ _____________________

Lightbringer
PHP/SQL/VB.NET/C#/AJAX Developer
Talisman
Administrator
Mod God
*****
Offline Offline

Posts: 5477



View Profile WWW
« Reply #8 on: February 23, 2005, 12:46:12 PM »

$rand probably isn't a good choice of variable name.  Try something else and see if that clears it up for you.

Also, if you want to have certain things appear based on weather, you don't need to hook the weather module - you just need to check current weather status and react to that.

Be aware that weather states are admin configurable, so if you are trying to match specific text, your module may not work on all sites.
Logged

Play the latest beta version here on DragonPrime
Lightbringer
Member
Codemeister
****
Offline Offline

Posts: 267


Life's a lich and then you don't die...damn unlife


View Profile
« Reply #9 on: February 23, 2005, 04:33:32 PM »

Okay...hours of pouring over examples and testing this and that have finally yielding a good result...

I only now need to add a couple more outputs and such and my first forest module, Weather Plus will be out...

Along with my test module, Lightning Rod!

Thanks everyone for your help..I couldn't have done it without the help and support of the community!

Cheesy
Logged

________________________ _____________________

Lightbringer
PHP/SQL/VB.NET/C#/AJAX Developer
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
18 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search