Register for your free account! | Forgot your password?

Go Back   elitepvpers › Other Online Games › Browsergames
You last visited: Today at 21:00

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Shakes & Fidget Private - Epic in Shop

Discussion on Shakes & Fidget Private - Epic in Shop within the Browsergames forum part of the Other Online Games category.

Reply
 
Old   #1
 
tulyita's Avatar
 
elite*gold: 0
Join Date: Mar 2014
Posts: 121
Received Thanks: 187
Shakes & Fidget Private - Epic in Shop

Tulyita's Shop Script - version 1.14 - last update: 11/04/2014

It's my own code, I made it! I hope you enjoy it

With this code:
-Epic items in the shop (stats: '3' or 'all') - it works
-Normal items in the shop (stats: '1' or '2') - it works
-Keys, potions in the shop - it works but you can't use the potions/keys

Step 1: Fix the "All Stat Epic" bug:

PHP Code:

//replace this:

class Char {
.
.
.
$itemStats = array_fill ( 0, 6, 0 );
        
foreach ( 
$this->items as $item ) {
    
$itemStats [$item ['atr_type_1']] += $item ['atr_val_1'];
    
$itemStats [$item ['atr_type_2']] += $item ['atr_val_2'];
    
$itemStats [$item ['atr_type_3']] += $item ['atr_val_3'];
}
$this->str += $itemStats [1];
$this->dex += $itemStats [2];
$this->int += $itemStats [3];
$this->wit += $itemStats [4];
$this->luck += $itemStats [5];
.
.
.
}

//with this:

class Char {
.
.
.
$itemStats = array_fill ( 0, 6, 0 );
        
foreach ( 
$this->items as $item ) {
    
$itemStats [$item ['atr_type_1']] += $item ['atr_val_1'];
    
$itemStats [$item ['atr_type_2']] += $item ['atr_val_2'];
    
$itemStats [$item ['atr_type_3']] += $item ['atr_val_3'];
}
$this->str += $itemStats [1] + $itemStats [6];
$this->dex += $itemStats [2] + $itemStats [6];
$this->int += $itemStats [3] + $itemStats [6];
$this->wit += $itemStats [4] + $itemStats [6];
$this->luck += $itemStats [5] + $itemStats [6];
.
.
.
} 
Step 2: Replace all the "function genItem($lvl, $class, $shop)" script with this:

PHP Code:
function genItem($lvl, $class, $shop) {
    global 
$shakes_item_ids, $fidget_item_ids;
    
    if (
$shop == 0) {
        
$type = rand ( 1, 7 ); //weapon shop items
    
} else {
        
$type = rand ( 8, 12); //magic shop items: 11 is keys, 12 is potions


//Add this to the script, if you don't want keys in the shop!
//        if ($type == 11){
//        $type = rand ( 8, 10);
//        }


    
}
        
        
    
$statNumRand = rand(1, 7); //chance: normal items with 2 stats
    
    
if ($lvl < 10){ //if level < 10 then shop gives only small potions
    
$potionRand = rand (1, 5);
    } elseif (
$lvl < 25 and $lvl > 9) { //if level < 25 then shop gives small potions and medium potions
    
$potionRand = rand (1, 10);
    } elseif (
$lvl > 24) { //if level > 24 then shop gives small, medium and big potions + Potion of the Eternal Life
    
$potionRand = rand (1, 16);
    }
    
    
$epicRand = rand(1, 100); //chance: epic items
    
if ($epicRand == 1){
    
$itemMush = 15; //mushroom: epic items
    
} elseif ($statNumRand == 1 and $type < 11) {
    
$itemMush = 10; //mushroom: normal items with 2 stats
    
} elseif ($type == 12 and $potionRand == 16) {
    
$itemMush = 15; //mushroom: special potion
    
} else {
    
$itemMush = 0; //mushroom: normal item
    
}
    
$item = array (
            
"item_type" => "1",
            
"item_id" => "1005",
            
"dmg_min" => "1",
            
"dmg_max" => "0",
            
"atr_type_1" => "0",
            
"atr_type_2" => "0",
            
"atr_type_3" => "0",
            
"atr_val_1" => "0",
            
"atr_val_2" => "0",
            
"atr_val_3" => "0",
            
"gold" => rand($lvl * 100, $lvl * 10000),
            
"mush" => $itemMush,
            
"slot" => "0",
            
"owner_id" => "0" 
    
);
    
// $class = 2;
    
    
if ($shop == 0) {
        
$type = rand ( 1, 7 );
        while ( 
$class != 1 && $type == 2 )
            
$type = rand ( 1, 7 );
        
        
$item ['item_type'] = $type;
        
$random = rand ( 1, $shakes_item_ids [$class - 1] [$type - 1] );
        if (
$epicRand == 1){
            if (
$class == 3){
                if (
$type == 1 or $type == 2){
                
$item ['item_id'] = rand(2050, 2060);
                } else {
                
$item ['item_id'] = rand(2050, 2058);
                }
            }
            if (
$class == 2){
                if (
$type == 1 or $type == 2){
                
$item ['item_id'] = rand(1050, 1060);
                } else {
                
$item ['item_id'] = rand(1050, 1058);
                }
            }
            if (
$class == 1){
                if (
$type == 1 or $type == 2){
                
$item ['item_id'] = rand(50, 60);
                } else {
                
$item ['item_id'] = rand(50, 58);
                }
            }
        } else {
        
$item ['item_id'] = $random + (($class - 1) * 1000);
        }
        
        if (
$type == 1) {
            
$class_weap_multiplier = array (
                    
2,
                    
3,
                    
5 
            
);
            
            
$m = mt_rand ( 900, 1100 ) / 1000;
            
$avg = round($lvl * '1.3' * $class_weap_multiplier [$class - 1]);
            
            
$minmax_m = round(mt_rand(750, 1000) / 1000);
            
            
            
            
$item ['dmg_min'] = round($avg * $minmax_m);
            
$item ['dmg_max'] = round($avg * ($minmax_m + '0.25') + rand (1, 50));
        } else {
            if (
$type == 2){ //shield
                
if ($lvl < 10){
                
$shieldNumber = 5;
                }
                if (
$lvl < 100 and $lvl > 9){
                
$shieldNumber = 25;
                }
                if (
$lvl > 99){
                
$shieldNumber = 50;
                }
            
$item ['dmg_min'] = $shieldNumber;
            } else {
            
$item ['dmg_min'] = $lvl * 2 * rand(1.51, 1.74) + rand(1, 6);
            }
        }
    } else {
        
$item ['dmg_min'] = 0;
        
$item ['item_type'] = $type;
        if (
$epicRand == 1){
        
$item ['item_id'] = rand (50, 58);
        } else {
        
$item ['item_id'] = rand ( 1, $fidget_item_ids [$type - 8] );
        }
    }
    
    if (
$class == 1){
    
$classStat = 1;
    }
    if (
$class == 2){
    
$classStat = 3;
    }
    if (
$class == 3){
    
$classStat = 2;
    }
    if (
$epicRand == 1){ //epic item: chance for epic items with 'all' stats or '3' stats
        
if (rand(1, 2) == 1){ //epic item with 3 stats
            
$stat_type2 = 4;
            
$stat_type3 = 5;
            
$m = mt_rand ( 650, 1300 ) / rand(950, 1050) * 2;
            
$stat_val1 = round ( $lvl * $m );
            
$stat_val2 = round ( $lvl * $m );
            
$stat_val3 = round ( $lvl * $m );
            
            
$item ['atr_type_1'] = $classStat;
            
$item ['atr_val_1'] = $stat_val1;
            
$item ['atr_type_2'] = $stat_type2;
            
$item ['atr_val_2'] = $stat_val2;
            
$item ['atr_type_3'] = $stat_type3;
            
$item ['atr_val_3'] = $stat_val3;
        } else { 
//epic item with all stat
            
$stat_type = 6;
            
$m = mt_rand ( 650, 1300 ) / rand(950, 1050) * 2;
            
$stat_val = round ( $lvl * $m );
            
            
$item ['atr_type_1'] = $stat_type;
            
$item ['atr_val_1'] = $stat_val;
        }
    } else {
        if (
$statNumRand == 1){ //normal item with 2 stats
            
$stat_type1 = rand ( 1, 5 );
            
$stat_type2 = rand ( 1, 5 );
            if (
$stat_type2 == $stat_type1){
                if (
$stat_type1 < 2){
                    
$stat_type2 = $stat_type1 + 1;
                } else {
                    
$stat_type2 = $stat_type1 - 1;
                }
            }
            
$m1 = mt_rand ( 650, 1300 ) / rand(950, 1050);
            
$m2 = mt_rand ( 650, 1300 ) / rand(950, 1050);
            
$stat_val1 = round ( $lvl * 3 * $m1 );
            
$stat_val2 = round ( $lvl * 3 * $m2 );
            
            
$item ['atr_type_1'] = $stat_type1;
            
$item ['atr_val_1'] = $stat_val1;
            
$item ['atr_type_2'] = $stat_type2;
            
$item ['atr_val_2'] = $stat_val2;
        } else { 
//normal item with 1 stat
            
$stat_type = rand ( 1, 5 );
            
$m = mt_rand ( 650, 1300 ) / rand(950, 1050);
            
$stat_val = round ( $lvl * 3 * $m );
        
            
$item ['atr_type_1'] = $stat_type;
            
$item ['atr_val_1'] = $stat_val;
        }
    }
    
    if (
$type == 12){
    
$item ['item_id'] = $fidget_item_ids [$type - 8] + $potionRand;
    
    switch (
$potionRand) {
    case 
1:
        
$potionAtr_type = 1;
        
$potionAtr_val = 5;
        break;
    case 
2:
        
$potionAtr_type = 2;
        
$potionAtr_val = 5;
        break;
    case 
3:
        
$potionAtr_type = 3;
        
$potionAtr_val = 5;
        break;
    case 
4:
        
$potionAtr_type = 4;
        
$potionAtr_val = 5;
        break;
    case 
5:
        
$potionAtr_type = 5;
        
$potionAtr_val = 5;
        break;
    case 
6:
        
$potionAtr_type = 1;
        
$potionAtr_val = 15;
        break;
    case 
7:
        
$potionAtr_type = 2;
        
$potionAtr_val = 15;
        break;
    case 
8:
        
$potionAtr_type = 3;
        
$potionAtr_val = 15;
        break;
    case 
9:
        
$potionAtr_type = 4;
        
$potionAtr_val = 15;
        break;
    case 
10:
        
$potionAtr_type = 5;
        
$potionAtr_val = 15;
        break;
    case 
11:
        
$potionAtr_type = 1;
        
$potionAtr_val = 25;
        break;
    case 
12:
        
$potionAtr_type = 2;
        
$potionAtr_val = 25;
        break;
    case 
13:
        
$potionAtr_type = 3;
        
$potionAtr_val = 25;
        break;
    case 
14:
        
$potionAtr_type = 4;
        
$potionAtr_val = 25;
        break;
    case 
15:
        
$potionAtr_type = 5;
        
$potionAtr_val = 25;
        break;
    case 
16:
        
$potionAtr_type = 4;
        
$potionAtr_val = 25;
        break;
    }
    
$item ['atr_type_1'] = $potionAtr_type;
    
$item ['atr_val_1'] = $potionAtr_val;
    
$item ['dmg_min'] = 0;
    
$item ['atr_type_2'] = 0;
    
$item ['atr_val_2'] = 0;
    
$item ['atr_type_3'] = 0;
    
$item ['atr_val_3'] = 0;
    }
    if (
$type == 11){ //if key then
    
$item ['item_id'] = rand (1, 10);
    
$item ['dmg_min'] = 0;
    
$item ['atr_type_1'] = 0;
    
$item ['atr_val_1'] = 0;
    
$item ['atr_type_2'] = 0;
    
$item ['atr_val_2'] = 0;
    
$item ['atr_type_3'] = 0;
    
$item ['atr_val_3'] = 0;
    }
    
    return 
$item;
} 


Ps.: Check my another thread,
tulyita is offline  
Thanks
3 Users
Old   #2
 
elite*gold: 0
Join Date: Dec 2013
Posts: 95
Received Thanks: 13
why with this scritp so much lags in shop ?
MaYeX159 is offline  
Old   #3
 
tulyita's Avatar
 
elite*gold: 0
Join Date: Mar 2014
Posts: 121
Received Thanks: 187
Quote:
Originally Posted by MaYeX159 View Post
why with this scritp so much lags in shop ?
It works fine in my server without lag... I click on the "new items" and It gives back new items around 0.2 secons.
tulyita is offline  
Old   #4
 
elite*gold: 0
Join Date: Dec 2013
Posts: 95
Received Thanks: 13
Quote:
Originally Posted by tulyita View Post
It works fine in my server without lag... I click on the "new items" and It gives back new items around 0.2 secons.
from who have you server files ?
MaYeX159 is offline  
Old   #5
 
elite*gold: 0
Join Date: Mar 2014
Posts: 5
Received Thanks: 1
how to add it for my request.php?i am doesn't know please help me
because when i'm add this code i am going to restart the server's page and doesn't loading only the login screen up
pitbulldrift is offline  
Old   #6
 
tulyita's Avatar
 
elite*gold: 0
Join Date: Mar 2014
Posts: 121
Received Thanks: 187
Quote:
Originally Posted by pitbulldrift View Post
how to add it for my request.php?i am doesn't know please help me
because when i'm add this code i am going to restart the server's page and doesn't loading only the login screen up
Search for "function genItem($lvl, $class, $shop)".

Replace all the "genItem" script with the script above.

.

.

.

Bump, added "all stat" epic items, and "2 stat" normal items, like in the real sfgame
tulyita is offline  
Thanks
1 User
Old   #7
 
MisterPr0's Avatar
 
elite*gold: 0
Join Date: May 2012
Posts: 39
Received Thanks: 16
Good job, tulyita!!!
MisterPr0 is offline  
Thanks
1 User
Old   #8
 
elite*gold: 0
Join Date: Mar 2014
Posts: 24
Received Thanks: 2
when you have a finite tower?
barteklorek123 is offline  
Old   #9
 
elite*gold: 0
Join Date: Nov 2015
Posts: 3
Received Thanks: 0
Can you send the "request.php" with that? plzz
jisnk is offline  
Reply


Similar Threads Similar Threads
[Selling] Shakes and Fidget- Lvl 229 Kundschafter Full Epic
12/05/2013 - elite*gold Trading - 10 Replies
Biete hier einen shakes and fidget charakter - lvl 229 Full Epic ist im Rangbereich von 400-500. Hat noch ne menge Gold und 2 Pilze (Spendbar 20k Wert: 800€). Er ist auf dem Server 24 ! Suche dafür Gebote ! Was ich nehme ? Google Play Card, E*G (Kurs 1:53) Davon ein Screenshot: http://abload.de/img/unbenanntyvj7z.png
Suche Shakes & Fidget Account mit Epic Waffe
05/24/2013 - Browsergames Trading - 1 Replies
Hallo Leute suche einen Account mit Epic Waffe. Level ist Egal. Am besten Kundschafter. Biete 375 e*Gold. Bei Interesse hier im Thread oder per PN bei mir melden. Gruß
Auktion Shakes & Fidget Acc. Level 125 Full Epic
10/20/2012 - elite*gold Trading - 1 Replies
Ich verkaufe einen SFgame acc. level 125 er ist full epic bis auf die waffe. und befindet sich auf dem deutschen server 2 Jeder bieter verpflichtet sich zum kauf! Anfangsgebot: 100 e Gold. Auktions ende: 20.10.2012 18:00
Shakes and Fidget Acc. Full Epic
09/28/2012 - Browsergames Trading - 0 Replies
Hallo, Ich verkaufe hier einen shakes and fidget acc. level 123 auf dem deutschen server 2. Er ist full epic bis auf die waffe. Und er ist Kundi, nur eine 25€ paysafecard.
[V] Shakes & Fidget s3 EPIC ACCOUNT [S] Psc
01/13/2012 - Browsergames Trading - 9 Replies
Hey beite diesen Account auf s3 http://s14.directupload.net/images/111224/mzsc4kn u.jpg - VIEL GOLD! - GENÜGEND PILZE - GUT GESTATTED - GUTER NAME Suche PaySAfeCard oder tausche auch..



All times are GMT +2. The time now is 21:01.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.