Jump to content
Sign in to follow this  
SkullKid

Does someone...

Recommended Posts

SkullKid

...understand action script? I need help for a new feature for the forum that I'd start by myself, but I got stuck and I don't have much free time. Action Script 2.0 or 3.0, w/e, it helps. That's what I got so far (ps, check the comments):

 

/********************* Priston Tale Stat Calculator 0.4 ********************/

//display text

this.createTextField("my_txt",1,10,10,200,22);
my_txt.variable = "hp";
this.createTextField("my_txt2",2,10,30,200,22);
my_txt2.variable = "mp";
this.createTextField("my_txt3",3,10,50,200,22);
my_txt3.variable = "stm";
this.createTextField("my_txt4",4,10,70,200,22);
my_txt4.variable = "minDamage";
this.createTextField("my_txt9",9,10,90,200,22);
my_txt9.variable = "maxDamage";
this.createTextField("my_txt5",5,10,110,200,22);
my_txt5.variable = "atr";
this.createTextField("my_txt6",6,10,130,200,22);
my_txt6.variable = "def";
this.createTextField("my_txt7",7,10,150,200,22);
my_txt7.variable = "abs";
this.createTextField("my_txt8",8,10,170,200,22);
my_txt8.variable = "speed";
this.createTextField("my_txt10",10,10,190,200,22);
my_txt10.variable = "lWeight";

//variables

var lvl:Number = lvl_txt.text;
var str:Number = str_txt.text;
var spt:Number = spt_txt.text;
var tal:Number = tal_txt.text;
var agi:Number = agi_txt.text;
var vit:Number = vit_txt.text;

parseInt(lvl_txt.text,Number);
parseInt(str_txt.text,Number);
parseInt(spt_txt.text,Number);
parseInt(tal_txt.text,Number);
parseInt(agi_txt.text,Number);
parseInt(vit_txt.text,Number);

var statBonusMin:Number;
var statBonusMax:Number;

var hp:Number;
var mp:Number;
var stm:Number;

var minDamage:Number;
var maxDamage:Number;
var atr:Number;
var def:Number;
var abs:Number;
var speed:Number;

var cWeight:Number;
var lWeight:Number;

var lGold:Number;
//Stats formules

//HP formule

//fighter, pikeman

if (hp == undefined, char=fs || ps) {
hp = lvl*2.1+str*0.8+vit*2.4-10;
}
//mechanican, kinght, atalanta                                                                

if (hp == undefined, char=ms || ks || ats) {
hp = lvl*2.1+str*0.6+vit*2.2-5;
}
//archer                                                                

if (hp == undefined, char=as) {
hp = lvl*1.8+str*0.3+vit*2.1;
}
//priestess                                                                

if (hp == undefined, char=prs) {
hp = lvl*1.5+vit*2.1;
}
//magician                                                                

if (hp == undefined, char=mgs) {
hp = lvl*1.5+vit*1.9;
}
//MP formule                                                                                                    

//fighter, pikeman, archer

if (mp == undefined, char=fs || ps || as) {
mp = lvl*0.6+spt*2.2;
}
//mechanican, knight, atalanta                                                                  

if (mp == undefined, char=ms || ks || ats) {
mp = lvl*0.9+spt*2.7;
}
//priestess, magician                                                                  

if (mp == undefined, char=prs || mgs) {
mp = lvl*1.2+spt*3.6;
}
//STM formule                                                                                              

if (stm == undefined) {
stm = (lvl*2.3)+(str*0.5)+(spt+tal*0.5)+(vit*1.4)+80;
stm = Math.round(stm);
}
//Damage bonus from stats                                                                                          

//melee weapons

if (weapon=melee) {
statBonusMin = str/130*wpnMin;
statBonusMax = str/130*wpnMax;
}
//ranged weapons                                                                           

if (weapon=range) {
statBonusMin = agi/130*wpnMin;
statBonusMax = agi/130*wpnMax;
}
//magic weapons (all but priestess)                                                                           

if (weapon=magic, char != prs) {
statBonusMin = spt/145*wpnMin;
statBonusMax = spt/145*wpnMax;
}
//magic weapons (for priestess)                                                                           

if (weapon=magic, char=prs) {
statBonusMin = spt/160*wpnMin;
statBonusMax = spt/160*wpnMax;
}
//Damage formule                                                                                           

//fighter, pikeman, knight

if (minDamage == undefined, char=fs || ps || ks) {
minDamage = 3+(tal+agi/40)+wpnMin+statBonusMin+choiceWeapon+specMin+force+buffMin+miscMin;
}
if (maxDamage == undefined, char=fs || ps || ks) {
maxDamage = 4+(tal+agi/35)+wpnMax+statBonusMax+choiceWeapon+specMax+force+buffMax+miscMax;
}
//mechanican, archer, atalanta, priestess, magician                                                                           

if (minDamage == undefined, char=ms || as || ats || prs || mgs) {
minDamage = 3+(tal+agi/50)+wpnMin+statBonusMin+choiceWeapon+specMin+force+buffMin+miscMin;
}
if (maxDamage == undefined, char=ms || as || ats || prs || mgs) {
maxDamage = 4+(tal+agi/45)+wpnMax+statBonusMax+choiceWeapon+specMax+force+buffMax+miscMax;
}
//Attack rating formule                                                      

atr = (lvl*1.9)+(agi*3.1)+(tal*1.5);
atr = Math.round(atr);

//Defense rating formule

def = (lvl*1.4)+(agi*0.5)+(tal*0.25);
def = Math.round(def);

//Absortion formule

abs = (def/100)+(str/40)+(tal/40)+(lvl/10)+1;
abs = Math.round(abs);

//Speed formule

speed = 1.4+(vit/150)+(tal/150);
if (cWeight>(lWeight*0.5)) {
speed = speed-1;
}
speed = Math.round(speed);
//Weight formule 

lWeight = (lvl*3)+(vit*2)+(str*2)+60;

//Gold limit

if (lvl>=10) {
lGold = 200000;
}
/***************************** Status Calc ********************************/ 

/*Damage Formule ^^ 

Start Damage : 3-4 (but don't forgot add talent + agility damage ! )

130 agility = 100% weapon damage boost ( of bows & javelins ) 

130 strengh = 100% weapon damage boost ( of axes & claws & maces & swords & pikes ) 

145 spirit = 100% weapon damage boost ( of wands & staffs => for mage) 

160 spirit = 100% weapon damage boost ( of wands & staffs => for prs)

Mechanician + Priestess + Archer + Magician + Atalanta

45 (talent + agility ) = +1max

50 (talent + agility ) = +1min 

Fighter + Knight + Pikeman

40 (talent + agility) = +1min

35 (talent + agility ) =+1max

WEAPON = 100% of damage of weapon (  ) 



Bonus. (damage look yellow) = ( if : mech use mech spec. item - ata use javeline - knight use sword - pike use pike - fighter use axe - prs or mgs use wand - archer use bow ) => ( then : lvl/6 = +1min +1max ) 



Spec. weapon lvl/x = +0min +(lvl/x) max 



(min weapon + max weapon )/16 => add to your min damage 



Absorbing Formule ^^ 

100 def = 1 abs 

40 strengh = 1 abs

40 talent = 1 abs ( and 40 talent = 10def = +0.1 abs) = 1.1 abs 

40 agility = 0 abs ( and 40 agility = 20def = +0.2 abs) = 0.2 abs 

10 lvl = 1 abs ( and 10 lvl = 14def = +0.14 abs) = 1.14 abs 

( *** : if you have 7.124 abs you will see 8 abs ) 



Atak rating Formule ^^ 

1 lvl = 1.9 atak. rating 

1 agility = 3.1 atak. rating 

1 talent = 1.5



Def rating Formule ^^ 

1 lvl = 1.4 def. rating 

1 agility = 0.5 def. rating 

1 talent = 0.25 def. rating 



Weight Formule ^^ 

limit weight = (lvl *3) + (strengh *2) + (health *2) + 60 

Gold Formule ^^ 

limit gold = lvl : 

01-10 = 200.000 

11-39 = 200.000 x (Lvl - 9)

40-60 = 50.000.000 (after quest tier 3) 

60-99 = 100.000.000 (quest tier 4) 



SPEED formule (for run ^^) 

1.4 + health/150 talent/150 + lvl/150 + boots speed. ( - current weight / limit weight => if full weight -> -1 speed ) 



HP formule ^^ 

Fighter, Pikeman :

(Level *2.1) + (Strengh *0.8) + (health *2.4) -10 

Mechanician, Knight, Atlanta :

(Level *2.1) + (Strengh *0.6) + (health *2.2) -5 

Archer :

(Level *1.8) + (Strengh *0.3) + (health *2.1) 

Priestress :

(Level *1.5) + (health *2.1) 

Mage :

(Level *1.5) + (health *1.9) 



MP formule ^^ 

Fighter, Pikeman, Archer :

(Level *0.6) + (spirits *2.2) + additional 

Mechanician, Knight, Atlanta :

(Level *0.9) + (spirits *2.7) + additional 

Priestress, Mages : 

(Level *1.2) + (spirits *3.6) + additional + mental mastery for mages 



STM formule ^^ 

Archer, Atlanta, Knight, Mages, Fighter, Priestress, Mechanician, Pikeman : 

(Level *2.3) + (Strengh *0.5) + (Spirit *1.0) + (Talent *0.5) + (Health *1.4) + 80*/

/******************************** About ***********************************/

/*

Flash PTcalc 0.4
By Skullkid

Original PTcalc (online)
By www.priston.be

*/

/********************************** End **********************************/

Share this post


Link to post
Share on other sites
SkullKid

If you hadnt noticed, its formula not formule :x

ah typo, thx, but you know something about AS? I need all the help I can get ._.

Share this post


Link to post
Share on other sites
SkullKid

Sorry, im only good at pointing out spelling mishaps :x

Actually this can be useful, since mispelled variables and calls can be a big nuisance and they are about being mistyped.  ;D

Share this post


Link to post
Share on other sites
Exelicer

Sorry, im only good at pointing out spelling mishaps :x

Actually this can be useful, since mispelled variables and calls can be a big nuisance and they are about being mistyped.  ;D

ewwww use an IDE and u wont do so many typos ;)

Share this post


Link to post
Share on other sites
mits4610

i don't know AS, but i know a little programming, so i could help when i can.

 

for this part

var lvl:Number = lvl_txt.text;
var str:Number = str_txt.text;
var spt:Number = spt_txt.text;
var tal:Number = tal_txt.text;
var agi:Number = agi_txt.text;
var vit:Number = vit_txt.text;

parseInt(lvl_txt.text,Number);
parseInt(str_txt.text,Number);
parseInt(spt_txt.text,Number);
parseInt(tal_txt.text,Number);
parseInt(agi_txt.text,Number);
parseInt(vit_txt.text,Number);

 

should the syntax be this?

var lvl:Number = parseInt(lvl_txt.text);
var str:Number = parseInt(str_txt.text);
var spt:Number = parseInt(spt_txt.text);
var tal:Number = parseInt(tal_txt.text);
var agi:Number = parseInt(agi_txt.text);
var vit:Number = parseInt(vit_txt.text);

 

if not then im just n00b and i won't be of any help.

Share this post


Link to post
Share on other sites
SkullKid

@Sheepco

 

hahaha, I was joking, the AS compiler will only check for code syntax errors, not grammar xD;

 

@Execiler

 

like said above, and I work on Flash's AS GUI;

 

@mits4610

 

Pretty the same one way or another, but the way I did is easier to read on AS GUI;

 

@ShK

 

I said my reasons to take so long to do it; >_>"

 

Thank you all for the help so far. x)

Share this post


Link to post
Share on other sites
Rkokie

I could help you but I only know the basics since its my first year in school I learn this shit :D

Share this post


Link to post
Share on other sites
SkullKid

I could help you but I only know the basics since its my first year in school I learn this shit :D

throw you wisdom here boy!

Share this post


Link to post
Share on other sites
Rkokie

I could help you but I only know the basics since its my first year in school I learn this shit :D

throw you wisdom here boy!

I'll look at it tomorrow or friday since I'm kinda tired to read that shitload of script :P

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

News and Updates

×
×
  • Create New...