nb Core Community
February 10, 2012, 09:13:27 pm *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: 1.2.3 +nb is now final and released

@new registrations. I will not allow any new registrations here as there are more (real person) spambots here than ever.... captcha proved to be ineffective.

After your registration, mail me at ( admin AT shinobilegends.com ) from the mail address you want to register. Provide some text about you and possibly your game.
 
   Home   Help Search Calendar Downloads Login Register  
Pages: [1]
  Print  
Author Topic: Dynamic Mount Duration  (Read 1811 times)
Middleclaw
Guest
« on: July 16, 2008, 06:27:28 pm »

I tried setting a mount duration on a fixed number plus a fraction of their current level. I used this formula 60+Ceil(<level>/10) which at level 15 shows 62 rounds as was intended. Yet after a few forest fights, it still displays 62 rounds, even after a full day of fights (44 in this case).

Buggy code or not anticipated?
Logged
Nightborn
Administrator
Sr. Member
*****

Karma: +20/-0
Posts: 306



View Profile WWW
« Reply #1 on: July 16, 2008, 07:23:51 pm »

if you put a variable into it, then the code will never go down.

the mount rounds evaluate with -1 each round  they are used.

but each round you tell him "set the mount round to 60+ceil(Level/10)" ... that would be my guess.

You should go for companions if you want better flexibility. A companion can give a buff, no big deal.
and  these buffs you can store in scripts, hence making them flexible.

For dynamic mount buffs, I recommend you to do:

1. make the mount with a base mount of rounds
2. make a module, hook into "newday"
3. modify the $session['bufflist']['mount']['rounds'] variable directly ONE time =)

that works to my knowledge.
Logged

It should be fixed, but it won't be easy and it won't be fast. If you want
to help - wonderful. But keep in mind that it will take months of wading
through the ugliest code we have in the tree. If you've got a weak stomach -
stay out. I've been there and it's not a nice place.

   - Al Viro
Middleclaw
Guest
« Reply #2 on: July 16, 2008, 08:48:18 pm »

Thanks. I'll look into it though I think a if $session['user']['hashorse'] parameter would be required else ALL mounts types would be affected instead of a specific mount.
Logged
Nightborn
Administrator
Sr. Member
*****

Karma: +20/-0
Posts: 306



View Profile WWW
« Reply #3 on: July 17, 2008, 10:19:04 am »

 Wink of course.

I did not mention it as I only tried to show the outline.

Which mount, and so forth, is up to you.

Logged

It should be fixed, but it won't be easy and it won't be fast. If you want
to help - wonderful. But keep in mind that it will take months of wading
through the ugliest code we have in the tree. If you've got a weak stomach -
stay out. I've been there and it's not a nice place.

   - Al Viro
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!