Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Code Gallery
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-02-2013, 08:53 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
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.
__________________
~Delteria Support
~Playerworld Support
~PWA Chief
http://support.toonslab.com
[email protected]



Reply With Quote
  #2  
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
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 09:00 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.