Thread: Atlantis
View Single Post
  #24  
Old 01-04-2013, 10:09 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by MysticalDragon View Post
I fixed it, odd issue. But I think it's how stefan tweaked player.triggerclient. I added a null to the end of the triggerclient were it sends the data and it worked.
Must be the difference between v5 and v6 then. I should've said it in the first post: some things only work with v6, even though a fix for v5 would be quite simple. I didn't want to focus on old versions though. Also:

Quote:
Originally Posted by MysticalDragon View Post
it would be a lot easier and more modifiable if you would just make your own dropping system, imo. Atlantis has a great dropping system, check it out in the code gallery.
You reminded me of some awkward logic/math stuff I did there. Have a look (item class):
PHP Code:
function onCreated() {
  
// create a random item, wohoo!
  
if (this.dItem == NOTHING) {
    
temp.chances = { 0.40.510.510.510.610.660.680.780.830.85 };
    
temp.random(01);
    
    for (
temp.0<= chances.size(); i++) {
      if (
== && chances[0])
        
this.dItem 1;
      elseif (
== chances.size() && >= chances[1])
        
this.dItem chances.size() + 1;
      elseif (
>= chances[1] && chances[i])
        
this.dItem 1;
    }
  } 
Does that make sense? I wonder. It lacks some proper comments. Check the enumeration at the top of that class to see which items it'll distribute with which percentage, and keep in mind that subtracting the value of the n-1th array element from the value of the nth array element yields the chance for the n+1th item. Doesn't make sense? Sorry~
Reply With Quote