Castle Paradox Forum Index Castle Paradox

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Gamelist   Review List   Song List   All Journals   Site Stats   Search Gamelist   IRC Chat Room

Level Up Boosts

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
RedMaverickZero
Three pointed, red disaster!
Halloween 2006 Creativity Winner
Halloween 2006 Creativity Winner



Joined: 12 Jul 2003
Posts: 1459

PostPosted: Sun Sep 17, 2006 3:59 pm    Post subject: Level Up Boosts Reply with quote

I'm working on this script for my game, where upon every level up, if the hero has a certain item equipped they gain a boost in a specific stat. Well, the script I have was working good, but then I realized it did it's effects after every single battle. I was wondering if somebody could help me alter my script so it accomodates this idea.

Code:
if(check equipment(findhero(hero:Mark),5)==30)
then(Add to Stat (hero:Mark,stat:Strength,random(1,3)))
Back to top
View user's profile Send private message Send e-mail AIM Address
TwinHamster
♫ Furious souls, burn eternally! ♫




Joined: 07 Mar 2004
Posts: 1352

PostPosted: Sun Sep 17, 2006 4:18 pm    Post subject: Reply with quote

I'm not sure if you've tried this yet, but it would probably help if you added:


Before Battle:

Code:

set variable (Old level, getherolevel(hero:Mark))


*FYTE

After Battle:

Code:

if(
Old Level<<get hero level (hero:Mark)
)
then(

if(check equipment(findhero(hero:Mark),5)==30)
then(Add to Stat (hero:Mark,stat:Strength,random(1,3)))

)


So basically, if the hero's level after a battle is higher than it is before the battle, he'll get the armour's stat bonus.
Back to top
View user's profile Send private message Send e-mail AIM Address
Moogle1
Scourge of the Seas
Halloween 2006 Creativity Winner
Halloween 2006 Creativity Winner



Joined: 15 Jul 2004
Posts: 3377
Location: Seattle, WA

PostPosted: Sun Sep 17, 2006 5:08 pm    Post subject: Reply with quote

That may work, but I'm also pretty sure there's a new command that asks if a hero has gained a level during the last battle, which would be even easier.
_________________
Back to top
View user's profile Send private message Visit poster's website AIM Address
TwinHamster
♫ Furious souls, burn eternally! ♫




Joined: 07 Mar 2004
Posts: 1352

PostPosted: Sun Sep 17, 2006 5:46 pm    Post subject: Reply with quote

Oh yeah! I believe you're talking about 'heroleveled'

So the after battle script would be:

Code:


if(heroleveled(hero:Mark)>>0)
then(
if(check equipment(findhero(hero:Mark),5)==30)
then(Add to Stat (hero:Mark,stat:Strength,random(1,3)))
)
Back to top
View user's profile Send private message Send e-mail AIM Address
RedMaverickZero
Three pointed, red disaster!
Halloween 2006 Creativity Winner
Halloween 2006 Creativity Winner



Joined: 12 Jul 2003
Posts: 1459

PostPosted: Sun Sep 17, 2006 5:54 pm    Post subject: Reply with quote

OH! Will that automatically update each time the hero levels up? (Thanks by the way)
Back to top
View user's profile Send private message Send e-mail AIM Address
Camdog




Joined: 08 Aug 2003
Posts: 606

PostPosted: Sun Sep 17, 2006 5:55 pm    Post subject: Reply with quote

Bear in mind that herolevelled returns the number of levels a hero gained after an encounter (or a give experience command). Therefore, you must take into account the possibility of a hero gaining more than one level in an encounter, so you'd probably want something more like this:

Code:
variable(loop)
levelCount := herolevelled(hero:Mark)

for(loop, 1, levelCount) do(
  add to stat (hero:Mark,stat:Strength,random(1,3))
)
Back to top
View user's profile Send private message
RedMaverickZero
Three pointed, red disaster!
Halloween 2006 Creativity Winner
Halloween 2006 Creativity Winner



Joined: 12 Jul 2003
Posts: 1459

PostPosted: Sun Sep 17, 2006 6:36 pm    Post subject: Reply with quote

That one line of code saved my tail. Thanks you guys for helping.
Back to top
View user's profile Send private message Send e-mail AIM Address
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP! All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group