//Sets
SetCurrentHP(Spawn, value)
SetMaxHP(Spawn, value)
SetCurrentPower(Spawn, value)
SetMaxPower(Spawn, value)
SetHeading(Spawn, value)
SetRaceType(Spawn, value)
SetSpeed(Spawn, value)
SetPosition(Spawn, x, y, z)
SetInt(Spawn, value)
SetWis(Spawn, value)
SetSta(Spawn, value)
SetStr(Spawn, value)
SetAgi(Spawn, value)
SetLootCoin(Spawn, amount)
SetMount(Spawn, mount_mode_type (int))
SetMountColor(Spawn, horse_color_red (int), horse_color_green (int), horse_color_blue (int), horse_color_saddle_red (int), horse_color_saddle_green (int), horse_color_saddle_blue (int))
//Gets
GetCurrentHP(Spawn)
GetMaxHP(Spawn)
GetCurrentPower(Spawn)
GetName(Spawn)
GetLeve(Spawn)
GetMaxPower(Spawn)
GetDistance(Spawn, Spawn)
GetX(Spawn)
GetY(Spawn)
GetZ(Spawn)
GetHeading(Spawn)
GetRaceType(Spawn)
GetRace(Spawn)
GetClass(Spawn)
GetSpeed(Spawn)
HasMoved(Spawn)
GetInt(Spawn)
GetWis(Spawn)
GetSta(Spawn)
GetStr(Spawn)
GetAgi(Spawn)
GetLootCoin(Spawn)
GetZone(ZoneId)
GetMount(Spawn)
//Misc
ModifyPower(Spawn, value)
ModifyHP(Spawn, value)
ModifyMaxPower(Spawn, value)
ModifyMaxHP(Spawn, value)
SpellDamage(Target, type, damage)
FaceTarget(Spawn, Target)
MoveToLocation(Spawn, x, y, z) - should be used to make an NPC run to a given spot
Say(Spawn, message)
Shout(Spawn, message)
SayOOC(Spawn, message)
Emote(Spawn, message)
IsPlayer(Spawn)
MovementLoopAddLocation(Spawn, x, y, z, speed, delay, function) - used to add movements to a spawn
function: this is a LUA function defined in the spawnscript that is called once the NPC reaches the x,y,z specified
GetCurrentZoneSafeLocation(Spawn)
PlayFlavor(Spawn, mp3_filename, text, emote, mp3_key1, mp3_key2) - this allows you to play a voice file, display chat, and do an emote all at once
PlaySound(Spawn, sound_filename, x, y, z)
PlayVoice(Spawn, mp3_filename, mp3_key1, mp3_key2)
AddLootItem(spawn, item_id)
RemoveLootItem(spawn, item_id)
AddLootCoin(spawn, amount)
CreateConversation(Spawn, value) - Used to create a new Conversation. This is necessary before you can set them
AddConversationOption(Conversation, Text option, Function) - The given function is called when the user selects this text option.
StartConversation(Conversation, NPC, Spawn, Text) - This initiates the conversation and displays what the NPC says (text) and the options that were added using the AddConversationOption function.
SummonItem(Spawn, ItemId)
HasItem(Spawn, ItemId, IncludeBank)
IncludeBank: 1 to include bank items, 0 not to
SpawnMob(Zone, SpawnID, restricted, x, y, z, heading)
Zone: Z reference to the zone. use GetZone(Spawn) to get this.
restricted: A 0 or 1 to determine if this spawn can only be seen by the player (usually quest related).
Zone(Zone, Spawn, x, y, z, heading)
Zone: A reference to the zone to zone the spawn into. Use GetZone(Spawn) to get this.
SetPlayerProximityFunction(NPC, distance, in range function name, out of range function name (optional) )
This will call the 'in range function' name when the player's distance to the NPC is less than the distance given in the function. Also if the 'out of range function' name is given, that is called when the player leaves the range.
GetSpawn(Spawn, spawn_id) - Returns the closest Spawn to the Spawn argument that matches the spawn_id. The value returned as well as the first argument can be a NPC, Widget, Sign, Object and in the case of the argument even a Player.
GetZoneID(Zone) - Returns the zone id for the zone. Pass in a Zone object retrieved with the GetZone function.
GetZoneName(Zone) - Returns the zone name for the zone. Pass in a Zone object retrieved with the GetZone function.
GetNPC(Spawn, spawn id) - returns the closest NPC of that spawn id to the given Spawn.
SpawnSet(Spawn, variable, value)
variable: certain var like "show_hand_icon"
value: must be a string
SpawnSetByDistance(Spawn, radius, variable, value)
variable: certain var like "show_hand_icon"
value: must be a string
KillSpawn(Dead, Killer, send death packet (0 or 1))
send death packet: 1 to send kill message to chat
KillSpawnByDistance(Killer, distance around, include players, send death packet)
include players: 1 to kill players also
send death packet: 1 to send kill message to chat
Despawn(Spawn, delay)
delay: optional
IsAlive(Spawn)
SendMessage(Player, Message, [Color])
Color is optional and defaults to white. Other possibilities are "red" and "yellow".
//Quest Stuff
RegisterQuest(Quest, Quest Name, Quest Type, Quest Zone, Quest level, Description) - REQUIRED
OfferQuest(NPC, Spawn, Quest ID) - Offers the quest to the Spawn (Player)
SetQuestPrereqLevel(Quest, Level)
AddQuestPrereqQuest(Quest, Quest ID)
AddQuestPrereqItem(Quest, Item ID, Quantity)
AddQuestPrereqFaction(Quest, Faction ID, Faction Amount Lower, Faction Amount Upper)
AddQuestPrereqRace(Quest, race id)
AddQuestPrereqClass(Quest, class id)
AddQuestPrereqTradeskillLevel (not used yet)
AddQuestPrereqTradeskillClass (not used yet)
AddQuestRewardItem(Quest, Item ID, Quantity)
AddQuestSelectableRewardItem(Quest, item id, quantity)
AddQuestRewardCoin(Quest, Copper, Silver, Gold, Plat)
AddQuestRewardFaction(Quest, Faction ID, Amount)
SetQuestRewardStatus(Quest, Amount)
SetQuestRewardComment(Quest, Text)
SetQuestRewardExp(Quest, Amount)
AddQuestStep(Quest, StepID, StepText, Quantity, Percentage, TaskGroupText, Icon)
AddQuestStepKill(Quest, StepID, StepText, Quantity, Percentage,TaskGroupText, Icon, NPC ID(s))
AddQuestStepChat(Quest, StepID, StepText, Quantity, TaskGroupText, Icon, NPC ID(s))
AddQuestStepObtainItem(Quest, StepID, StepText, Quantity, Percentage, TaskGroupText, Icon, Item ID(s))
AddQuestStepLocation(Quest, StepID, StepText, MaxVariation, TaskGroupText, Icon, x1, y1, z1, ...)
AddQuestStepSpell(Quest, StepID, StepText, Quantity, Percentage, TaskgroupText, Icon, Spell ID(s))
AddQuestStepCompleteAction(Quest, Step ID, Function Name)
SetQuestCompleteAction(Quest, Function Name) - Sets the LUA function name that should be called once the player completes all steps.
GiveQuestReward(Quest, Player)
SetStepComplete(Spawn, QuestID, StepID)
AddStepProgress(Spawn, QuestID, StepID, ProgressAmount)
GetQuestStep(Spawn, QuestId) - returns the first non-completed quest step
UpdateQuestStepDescription(Quest, Step ID, Description)
UpdateQuestZone(Quest, ZoneName)
GetTaskGroupStep(Spawn, QuestId)
UpdateQuestTaskGroupDescription(Quest, TaskGroupId, Text, DisplayBullets)
DisplayBullets: a boolean whether or not to display the quest steps assigned to this taskgroup. Defaults to false
UpdateQuestDescription()
SetCompletedDescription(Quest, Description)
ProvidesQuest(Quest ID)
HasQuest(Spawn, Quest ID) - returns true or false
HasCompletedQuest(Spawn, Quest ID) - returns true or false
QuestIsComplete(Spawn, Quest ID) - returns true if the player has the quest, has not turned it in, and it is completed
QuestStepIsComplete(Spawn, QuestID, StepID)
QuestReturnNPC(Quest, Spawn ID) - Sets the spawn id of the spawn that the player needs to turn the quest into.
GetQuest(Spawn, Quest ID) - Retrieves the existing active quest for the player. Returns 0 if the player doesn't have the current quest or it is completed.
SetRequiredQuest(NPC, QuestID, [StepID])
AddTimer(Spawn, time, function, max_count, player)
//Quest Functions
function Accepted(Quest, QuestGiver, Player)
NOTE: This function is called when a player accepts the quest
function Declined(Quest, QuestGiver, Player)
NOTE: This function is called when a player declines the quest
function Reload(Quest, QuestGiver, Player, Step)
Note: This function is called when a player zones or logs back in. Step is set to the last completed step for that quest.
For every step, you must tell Reload which function to complete.
//Spawn Script Functions
spawn(NPC)
NOTE: Called when the spawn is spawned
respawn(NPC)
NOTE: Called when the spawn is respawned
attacked(NPC, Spawn)
NOTE: Called when the spawn is attacked
targeted(NPC, Spawn)
NOTE: Called when the spawn is targeted
aggro(NPC, Spawn)
NOTE: Called when the spawn is aggro'd
hailed(NPC, Spawn)
NOTE: Called when the spawn is hailed
healthchanged(NPC, Spawn)
NOTE: Called when the spawn's health is changed
hailed_busy(NPC, Spawn)
NOTE: Called when the spawn is hailed and is busy (in combat, etc)
killed(NPC, Spawn)
NOTE: Called when the spawn kills something
death(NPC, Spawn)
NOTE: Called when the spawn is is killed
casted_on(NPC, Spawn, SpellName)
NOTE: Called when the spawn is casted on by a spell (command)
LUA Functions Sticky
Moderator: Team Members
-
LethalEncounter
- Team: Zombie
- Posts: 2717
- Joined: Wed Jul 25, 2007 10:10 pm
LUA Functions Sticky
Here is a list of all the LUA functions that can currently be used (or will be added within a day or two):
Last edited by LethalEncounter on Sat Sep 20, 2008 7:39 am, edited 2 times in total.
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
Re: LUA Functions Sticky
WooOOoOooooOO!!! yummy!LethalEncounter wrote:PlayFlavor(Spawn, mp3_filename, text, emote, mp3_key1, mp3_key2) - this allows you to play a voice file, display chat, and do an emote all at once
PlaySound(Spawn, sound_filename, x, y, z)
PlayVoice(Spawn, mp3_filename, mp3_key1, mp3_key2)
-
LethalEncounter
- Team: Zombie
- Posts: 2717
- Joined: Wed Jul 25, 2007 10:10 pm
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
Not to start another tirade about the parser (grin), but there is something still wrong with how it is parsing older vs newer logs. As you might have noticed on my server right now using the newest parser (as of a month ago anyway), the toons lack any appearance color - thus are all very dark. Yet some are ok. Doing comparisons of the rawdata between the rev 13 parser and the newer (21?) parser, the newer one clearly does not seem to find appearance info in logs taken back in Nov '07. Maybe this is expected? I was using the older structs, until the newer parser XML changed and I stopped using "OLDWorldStruct.xml" or whatever.
Also, Items parsing never works for me on any log. Always spits garbage to the screen in gigs (heh) and usually ends in throwing an exception. This is on any of our stored logs, and the dozen or so I collected back in Nov.
So yes, I am still complaining about the parser - though when it does find all the data it needs, it is truly amazing with the vis_states and stuff. So it's going in the right direction anyway.
Let me know when I can play with a newer one... I will re-parse all the logs and update the SVN again.
Also, Items parsing never works for me on any log. Always spits garbage to the screen in gigs (heh) and usually ends in throwing an exception. This is on any of our stored logs, and the dozen or so I collected back in Nov.
So yes, I am still complaining about the parser - though when it does find all the data it needs, it is truly amazing with the vis_states and stuff. So it's going in the right direction anyway.
-
LethalEncounter
- Team: Zombie
- Posts: 2717
- Joined: Wed Jul 25, 2007 10:10 pm
NPC appearances - could you upload a packetlog that you are having issues with to SVN and let me know where you put it.
Items - I havent messed with items lately, so the structs are probably way outdated. Since we don't need items much at this point I have ignored it, but once I start working on things that require items again I'll fix the parser in this regard.
Spawns - other than collecting the chat from NPCs, and possibly collecting movements anything else that you would like parser to do regarding spawns?
Items - I havent messed with items lately, so the structs are probably way outdated. Since we don't need items much at this point I have ignored it, but once I start working on things that require items again I'll fix the parser in this regard.
Spawns - other than collecting the chat from NPCs, and possibly collecting movements anything else that you would like parser to do regarding spawns?
-
LethalEncounter
- Team: Zombie
- Posts: 2717
- Joined: Wed Jul 25, 2007 10:10 pm
- Zcoretri
- Team Member
- Posts: 1642
- Joined: Fri Jul 27, 2007 12:55 pm
- Location: SoCal
-
LethalEncounter
- Team: Zombie
- Posts: 2717
- Joined: Wed Jul 25, 2007 10:10 pm
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
LE, sorry for the delay. The logs which are showing up with no appearance are on Alfa's FTP (I can put one on SVN if you need me to). But grab the one specifically for the isle of refuge - good side. When I parsed that using Rev 21, all the toons were black. They lacked their appearance values.
But before you spend time doing that, let me re-re-recheck my raw data. I am getting suspicious of my own scripting.
But before you spend time doing that, let me re-re-recheck my raw data. I am getting suspicious of my own scripting.
-
link2009
- Retired
- Posts: 390
- Joined: Fri Aug 10, 2007 5:59 pm
- Location: POrTal
- Contact:
-
LethalEncounter
- Team: Zombie
- Posts: 2717
- Joined: Wed Jul 25, 2007 10:10 pm
-
link2009
- Retired
- Posts: 390
- Joined: Fri Aug 10, 2007 5:59 pm
- Location: POrTal
- Contact:
-
LethalEncounter
- Team: Zombie
- Posts: 2717
- Joined: Wed Jul 25, 2007 10:10 pm
http://www.eq2emulator.net/Parser.zipZcoretri wrote:Well I am interested...I have some extra time on my hands and would like to give some help, and to generally fool around with stuff on my server, hehe.
I have been helping chrrox out by gathering spell icon data for him.
The readme is a little outdated, just extract all those files to a folder, edit the parser_db.ini file and source the Parser DB.sql into your database. Then you should be able to parse spawns using the -spawns option and populate a database using the -populate option. This is mainly for the db team as it isnt a finished product, but it is available for anyone who wants to play around with it.
- Zcoretri
- Team Member
- Posts: 1642
- Joined: Fri Jul 27, 2007 12:55 pm
- Location: SoCal
Since this is about lua functions I thought I would add it to this thread instead of starting a new one.
I have a couple of questions regarding the lua scripts.
After playing with the lua scripts for the past few days I have done straight damage spells no problem. The problem I am having is trying to create self buffs/group buff type spells dealing with STR, AGI type stats. I don't see any change to the values in the persona window.
I have also successfully made a healing spell, but the only problem is you have to actually target yourself to get the heal. You should be able to heal yourself if you have no target, or when solo and targeting the mob.
Another thing I have noticed is that if you disengage the mob and stop attacking, the mobs health and or power does not reset, it just stays at whatever you brought it down to.
I have a couple of questions regarding the lua scripts.
After playing with the lua scripts for the past few days I have done straight damage spells no problem. The problem I am having is trying to create self buffs/group buff type spells dealing with STR, AGI type stats. I don't see any change to the values in the persona window.
I have also successfully made a healing spell, but the only problem is you have to actually target yourself to get the heal. You should be able to heal yourself if you have no target, or when solo and targeting the mob.
Another thing I have noticed is that if you disengage the mob and stop attacking, the mobs health and or power does not reset, it just stays at whatever you brought it down to.
Who is online
Users browsing this forum: No registered users and 0 guests

