View Single Post
  #10  
Old 08-16-2013, 09:07 PM
MysticalDragon MysticalDragon is offline
Global Administration
MysticalDragon's Avatar
Join Date: Oct 2002
Location: Lynn Ma
Posts: 883
MysticalDragon is a jewel in the roughMysticalDragon is a jewel in the rough
Send a message via AIM to MysticalDragon Send a message via MSN to MysticalDragon
To answer your question, it has to be completely redone. The code is terrible, and your abusing schduleevent as if it was a timeout :/. I might release delterias Baddie system on the forums soon. You could probably at least learn from it.

PHP Code:
//Can be Used for Baddies
public function addMobExperience(temp.mob_leveltemp.mob_base_exp) {
  
// Find XP multiplier
  
temp.curr_level this._get("pve_level");  //Player Level (clientr.pve_level)
  
temp.level_difference temp.mob_level temp.curr_level//Mob Level
  
temp.difference max(-5min(temp.level_difference5)); //Difference
  
temp.multiplier = (temp.difference/5); //Multiplier

  // Add experience  
  
addExperience(temp.mob_base_exp temp.multiplier);
}

//Can be used for Quests etc
public function addExperience(temp.amount) {
  
temp.amount *= 1;  //Incase you have events like double EXP
  
temp.curr_exp this._get("pve_exp");  //clientr.pve_exp
  
temp.curr_exp += temp.amount;
  
// Check if we reached a new level
  
if (temp.curr_exp >= this._get("pve_nextlevelexp")) {
  
/* Only used on Delteria
    // Add enchantment point when leveling up
    temp.enchantment_points = this._get("enchantment_points");
    this._set("enchantment_points", temp.enchantment_points + 1);
  */
    
temp.new_level this._get("pve_level") + 1//clientr.pve_level + 1;
   /* If you want them to still gain EXP for extra things like CMD Points after     max level (25)
    if (temp.new_level >= 26) {
      // reset experience points so they can get more enchantment points
      this._set("pve_exp", 0);
      return;
    }
  */
    
this._set("pve_level"temp.new_level); //clientr.pve_level = temp.new_level;
    
this._set("pve_exp"0); //clientr.pve_exp = 0;
    
this._set("pve_nextlevelexp"1000 temp.new_level); //clientr.pve_nextlevelexp = 1000 * temp.new_level

    //Floating Text to Display player leveling up
    
this.triggerclient("weapon""Player/DamageDisplay""text2",
      
player.random(01),
      
player.random( -.51),
      
"Level Up! (" SPC clientr.pve_level SPC ")",
      
25512800"blue"
    
);
    
this.updateProperties(); //Updat properties (only used on Delteria)
  
} else {
    
this._set("pve_exp"temp.curr_exp);
    
this.sendNotification("You gained" SPC  temp.amount SPC "experience!"1"expicon.png""");//Iphone Notification
  
}

__________________
~Delteria Support
~Playerworld Support
~PWA Chief
http://support.toonslab.com
[email protected]




Last edited by MysticalDragon; 08-16-2013 at 09:19 PM..
Reply With Quote