Lots of folks have had quest related questions lately, so I wanted to post a list of commands here that's up-to-date:
TRIGGERS
TRIGGER_ATTACK - When the NPC attacks
TRIGGER_DEATH - For when the NPC dies
TRIGGER_KILLED - For when the NPC kills someone
TRIGGER_FLAGS - Triggers a set of npc flags and resets them to 0
TRIGGER_ITEM - Works when an item is turned in
TRIGGER_TEXT - Works by either hailing, or saying a specific text
SCRIPT COMMANDS
%CHARNAME% - Says the characters name
%CHARLEVEL% - Says the characters level
%CHARRACE% - Says the characters race
%CHARCLASS% - Says the characters class
FACTION_CHECK - Checks faction, can assign values of 1-6
SAY - NPC will say text
EMOTE - NPC will emote(does NOT do an animation), you can also tie text into this as one line instead of making a seperate say
TEXT - Text will show up after the trigger when this is used
SHOUT - NPC will shout
ADD_HATELIST - NPC will aggro the person triggering when this is used
DEPOP - Causes the NPC to depop
SPAWN_NPC - Spawns an npc, format is SPAWN_NPC npcid
LEVEL_CHECK - Checks the persons level that is triggering
CUMULATIVE FLAG - Works in coalation with TRIGGER_FLAGS
NPC_FLAG - For item turn-ins, format is NPC_FLAG flag# flagvalue
PLAYER_FLAG - Works much like NPC_FLAG in how you assign the flag
EXP - Gives the player exp, format is EXP expvalue
LEVEL - Raises the player to a certain level, format is LEVEL levelvalue
SAFEMOVE - Moves the player to the safepoint of the zone
RAIN - Turns rain on
SNOW - Turns snow on
GIVE_CASH - Gives the player coin in copper amounts, format is GIVE_CASH coinvalue
GIVE_ITEM - Summons the player a specific item, format is GIVE_ITEM itemid itemcharges(for item charges, it's how many of the item you want summoned)
CAST_SPELL - Causes the npc to cast a spell, format is CAST_SPELL spellid
PVP - Changes the players pvp flag, format is PVP ON
CHANGEFACTION - Changes faction, format is CHANGEFACTION factionid factionvalue
DO_ANIMATION - Causes npc to do an animation
FLAG_CHECK - Checks for flags set by the PLAYER_FLAG function
CHANCE - Sets a chance value, so the script only has a chance of running
Some examples:
Code:
TRIGGER_TEXT:Hail:{
PLAYER_FLAG 1 1
EMOTE:smiles, 'Greetings %CHARNAME%. If you are interested, I have some [work] for young %CHARCLASS%'s such as yourself.
}
TRIGGER_TEXT:work:{
FLAG_CHECK 1
SAY:Please go out and collect any rat fur you might find. Return to me when you have four, and I will reward you.
}
TRIGGER_ITEM:2341:{
CUMULATIVE_FLAG
}
TRIGGER_FLAGS 50 4 {
SAY:Excellent job! Here is your reward.
EXP 400
GIVE_ITEM 1193 10
}
END_FILE
That was an example of quite a few of the triggers and commands. The item id's were just whatever popped into my head, so this may or may not work on your server. :P But it's to simulate giving a player a stack of 10 food in return for them collecting rat fur for this NPC.
Code:
TRIGGER_ATTACK {
SAY:Argh, that was a dumb thing to do!
}
TRIGGER_DEATH {
SAY:You've won this time, but perhaps not the next!
}
TRIGGER_KILL {
EMOTE:laughs, 'You were hardly a worthy adversary
}
END_FILE
That was an example of giving an npc things to say when they're in combat, etc.
Code:
TRIGGER_TEXT:Hail:{
SAY:Hello there, would you be [interested] in helping me?
}
TRIGGER_TEXT:interested:{
SAY:That's great to hear! I've lost a few items that might pop up on creatures in the area, they seem to have stolen them. Please bring them back if you can; they're a Cloth Cap, a Cloth Tunic, Cloth Leggings, and Cloth Gloves
}
TRIGGER_ITEM:1001:{
NPC_FLAG 1 1
}
TRIGGER_ITEM:1002:{
NPC_FLAG 2 1
}
TRIGGER_ITEM:1003:{
NPC_FLAG 3 1
}
TRIGGER_ITEM:1004:{
NPC_FLAG 4 1
}
TRIGGER_FLAGS 1 2 3 4 {
SAY:Thank you, %CHARNAME%! Here is your reward.
EXP 250
GIVE_CASH 120
}
END_FILE
That's an example of multiple item types being needed. I still haven't figured out how to use CUMULATIVE_FLAG and NPC_FLAG in conjunction.