Topics for assignment:
Events
http://forums.graalonline.com/forums/showpost.php?p=1494270&postcount=1
http://wiki.graal.us/CategoryFunctionEvent
Variables
http://gs2.graalstudios.com/?page=variables
Style
Practice your formatting. When something is between brackets, it should be indented to the proper level. See below for an example
Assignments
1.Format this script:
Hint: Look at the example above. Notice that there are semicolons or brackets at the start or end of a line, now look for those.
2. Using Variables, create a script that creates changes players attributes.
3. Take the script you created above and make it check to see if a player is a classic or gold account WHEN GRABBED. If a player is Gold have it do hat13. If the player is Classic hat 2.png.
Hint: the grab function is not built in, you have to set it up with a script.
4. Using your script in part 2, create a simple hat setter so that a player can say "/sethat hat12.png".
Events
http://forums.graalonline.com/forums/showpost.php?p=1494270&postcount=1
http://wiki.graal.us/CategoryFunctionEvent
Variables
http://gs2.graalstudios.com/?page=variables
Style
Practice your formatting. When something is between brackets, it should be indented to the proper level. See below for an example
- Code:
function onCreated()
{
this.name = "Twinny";
this.age = 19;
this.band = "The Smashing Pumpkins";
echo("My name is" SPC this.name @". I am" SPC this.age SPC "and my favourite band is" SPC this.band);
}
Assignments
1.Format this script:
- Code:
for(i = 0; i < passedeffects.tokenize(",").size(); i ++){temp.effect = passedeffects.tokenize(",")[i].tokenize(":"); temp.effectroll = random(0,100); if(effectroll <= effect[0] && effect[1] == "cause"){BuffSystem.addbuff(effect[2],effect[3],effect[4],effect[5],effect[6]); }}
Hint: Look at the example above. Notice that there are semicolons or brackets at the start or end of a line, now look for those.
2. Using Variables, create a script that creates changes players attributes.
3. Take the script you created above and make it check to see if a player is a classic or gold account WHEN GRABBED. If a player is Gold have it do hat13. If the player is Classic hat 2.png.
Hint: the grab function is not built in, you have to set it up with a script.
4. Using your script in part 2, create a simple hat setter so that a player can say "/sethat hat12.png".