My suggestion:
One database NPC named, say, Swords, formatted like so:
PHP Code:
function onInitialized() {
this.trigger("created"); // re-add values on start incase they were removed
}
function onCreated() {
this.sword.clearVars(); // empty variables so strays aren't left over to cause problems
// Super Sword
this.sword.supersword.swordName = "Super Sword";
this.sword.supersword.attackSpeed = 0.2;
this.sword.supersword.damage = 20;
// ****ty Sword
this.sword.****tysword.swordName = "****ty Sword";
this.sword.****tysword.attackSpeed = 1.2;
this.sword.****tysword.damage = 1;
}
public function getSword(swordID) {
return this.sword.(@ swordID).link();
}
then have a single weapon, named something like -Swords, that controls equipping of swords (have the inventory trigger it when the player equips a new sword)
PHP Code:
function onSwordEquipped(swordID) {
temp.sword = Swords.getSword(swordID);
player.clientr.sword.swordName = sword.swordName;
player.clientr.sword.attackSpeed = sword.attackSpeed;
// etc..
}
Then in the clientside of -Swords you can read from the clientr variables.
(anyone ever realize what a weird word "sword" is?)