Could this be used as well with no "using" cpu hit?
Code:
PackItem(new Daat99MasterLooterSystem.MasterLooterBackpack());
Tested and it seems to be working.
This will work, let me explain:
Code:
Daat99MasterLooterSystem.MasterLooterBackpack looter = new Daat99MasterLooterSystem.MasterLooterBackpack();
First we declare a type of the item we want:
Daat99MasterLooterSystem.MasterLooterBackpack looter = new Daat99MasterLooterSystem.MasterLooterBackpack();
Then we create a variable of that type and give it a name:
Daat99MasterLooterSystem.MasterLooterBackpack looter = new Daat99MasterLooterSystem.MasterLooterBackpack();
After that we tell the compiler that we want to assign something to it:
Daat99MasterLooterSystem.MasterLooterBackpack looter = new Daat99MasterLooterSystem.MasterLooterBackpack();
We also tell the compiler that we want to create a new object:
Daat99MasterLooterSystem.MasterLooterBackpack looter = new Daat99MasterLooterSystem.MasterLooterBackpack();
We tell the compiler the type of the object we want to create:
Daat99MasterLooterSystem.MasterLooterBackpack looter = new Daat99MasterLooterSystem.MasterLooterBackpack();
And last we tell the compiler to create it without any special "information" (parameters):
Daat99MasterLooterSystem.MasterLooterBackpack looter = new Daat99MasterLooterSystem.MasterLooterBackpack();
At this point we have a Master Looter Backpack object stored in a variable called "
looter" and we can use it like this:
Code:
looter.GoldLedger = false;
looter.Name = "I'm a new looter and I won't hold gold for my owner";
PackItem( looter );
Using the code you posted is the same thing except you can't do anything with the looter because you don't know what it is.
In my code the owner can change stuff on the looter based on the new player settings (gargoyles get GoldLedger, Humans and elves can't... etc).