Server Clan Crushbone

Development forum for the EQ2Emulator Database project.

Moderator: Team Members

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Mon Apr 14, 2008 8:32 am

That could work, too. Applying a set of spells to a group. Or, what might be even better - to steal more concepts from EQemu heh - make a npc_spells table that you can then point the npc record to that, and the npc_spells table could hold custom configs of allowed spells, priorities, chance to cast, whatever. Unless all that is handled in the script itself...

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Mon Apr 14, 2008 2:25 pm

This stuff is totally separate from spells. This is meant to control certain aspects of spawns, such as movement and conversations and such. The npc_spells table is what will eventually be created to handle NPC spells.

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Tue Apr 15, 2008 1:13 pm

Do you guys want the quest stuff as separate files or should the spawn scripts also contain the quests? For quests I was thinking about having:

Code: Select all

function CheckQuestRequirements(Player) //verifies the player has met the requirements for the quest to be offered
function CheckQuestUpdate(Player) //checks if a player has a quest update
function GetQuestDetails() //returns information necessary to give the quest to the player

chrrox
Content Designer
Posts: 177
Joined: Wed Oct 17, 2007 8:12 pm

Post by chrrox » Tue Apr 15, 2008 2:13 pm

I think it would be simpler to have them as one file. Also I prefer to work this way. That sounds like a great way to handle quests.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Tue Apr 15, 2008 3:01 pm

Hmm. I could honestly take it either way. I like the idea that if I want to mess with a spell, I can go to the Spells folder and edit the file and it will only contain Spell information/routines. Then, if I need to edit a quest, I can go to a Quests folder and do the same. Segregated, simple, clear.
Or, I also kinda like it all-inclusive. But again, this is assuming there is 1 spell/quest lua per NPC or spawn? For instance, if I have one NPC ID (a rat) that cases SoW on itself (hehe) and also says "Squeak! I will give you hanta!" and attacks, and also handles some sort of quest to rid Qeynos of all humans so rats can run free... I can sorta see one single file for all this getting confusing and overwhelming. Plus, what if I want only "a_rat_01" to use "lua_script_01", but I want "a_rat_01" (same rat NPC) in a different zone to use lua_script_02"?
Maybe that'll be solved by binding the script to the spawn instead of npc... what do you think?

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Tue Apr 15, 2008 3:16 pm

John Adams wrote:Hmm. I could honestly take it either way. I like the idea that if I want to mess with a spell, I can go to the Spells folder and edit the file and it will only contain Spell information/routines. Then, if I need to edit a quest, I can go to a Quests folder and do the same. Segregated, simple, clear.
Or, I also kinda like it all-inclusive. But again, this is assuming there is 1 spell/quest lua per NPC or spawn? For instance, if I have one NPC ID (a rat) that cases SoW on itself (hehe) and also says "Squeak! I will give you hanta!" and attacks, and also handles some sort of quest to rid Qeynos of all humans so rats can run free... I can sorta see one single file for all this getting confusing and overwhelming. Plus, what if I want only "a_rat_01" to use "lua_script_01", but I want "a_rat_01" (same rat NPC) in a different zone to use lua_script_02"?
Maybe that'll be solved by binding the script to the spawn instead of npc... what do you think?
heh, I think you are still confused about the way I am implementing it. LUA spell scripts are generic enough to be used for several spells and are place in the Spells directory. The lua_script field in the spells table controls which script a particular spell will use.
LUA scripts for spawns are separate from spells and are stored in the SpawnScripts directory. The spawn_script field in the spawn_group table controls which script will be run for a particular spawn. Since it is tied to the spawn group, any spawn that uses the same spawn_group_id will use the same script. However, spawngroups are meant to be spawns that use the same x, y, z coords, etc so if you have a spawn script that is truly unique then you would only want to put that specific spawn in the spawngroup. I mentioned early about the possibility of putting quests inside of these SpawnScripts as well to simplify things (instead of having 3 separate script directories). That is the way I am planning unless there are any objections. In fact I have the Spawn Scripts implemented already, so if you have any objections mention them now :P

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Tue Apr 15, 2008 4:24 pm

Example of spawn scripts:
http://eq2emulator.net/ScreenShots/SpawnScripts.jpg
Script used to generate the screenshot:

Code: Select all

function spawn(NPC)
	Say(NPC, "I am spawning!!")
end
function respawn(NPC)
	Say(NPC, "I am respawning!!")
end
function attacked(NPC, Spawn)
	Say(NPC, "Attack me will you?!?!")
end
function targeted(NPC, Spawn)
	FaceTarget(NPC, Spawn)
	Say(NPC, "You feeling lucky, punk?!?  Well do you..?")
end
function hailed(NPC, Spawn)
	FaceTarget(NPC, Spawn)
	Emote(NPC, "glares at you.")
	Say(NPC, "Yes, Hail to you as well.")
end
function death(NPC, Spawn)
	Say(NPC, "Alas, I am dead. :(")
end
function killed(NPC, Spawn)
	Say(NPC, "Haha, I killed j00.  I am leet!")
end
function aggro(NPC, Spawn)
	Say(NPC, "You have ruined your own lands.  You shall not ruin mine!!")
end
function healthchanged(NPC)
	Say(NPC, "Oh no, I am getting low on health.")
end
Note that aggro and healthchanged aren't implemented yet, but the other types are.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Tue Apr 15, 2008 4:42 pm

Naw, I am not too confused, just being difficult. Tell you what, I'll wait til you get it 95% implemented, then start complaining about how it works. That is up to par with my being a QA guy IRL, right? ;)

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Tue Apr 15, 2008 4:47 pm

lol, yup. And then say "No, no, no, back to the drawing board! I liked it the way you had it before the changes."

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Post by Scatman » Wed Apr 16, 2008 5:49 am

chrrox,
I was just curious. Do you have your ranger spells min and max damage being modified by the caster's current strength? I looked at your Searing Shot combat art that you gave out and I noticed you had a definite description of 11-19 heat damage or whatever the values were. Scout CA's min and max damage are modified by the caster's strength and wasn't sure if you had that calculation in there or planned on putting it in there.

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Wed Apr 16, 2008 6:32 am

The randomchat function might need to be handled by the zone instead of with LUA scripts simply because it doesn't make a lot of sense to call a LUA function that does nothing more than call the Say function with what we passed it. Unless of course you want to keep the chat inside of the function and you randomly determine what to say based off of the text inside of the function. If this is the case, then there is not need for a Message parameter on the function.

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Wed Apr 16, 2008 4:31 pm

NPC walking movements will be handled in a loop with each waypoint having a different stop delay. The following is the LUA script code needed to make Paula Marx walk to various locations before returning to her starting location. She starts walking as soon as she spawns. Note that the delays could be off by as much as 10 seconds since I only check for updates every 10 seconds to reduce processing time.

Code: Select all

function spawn(NPC)
	--Syntax is NPC, x, y, z, speed, delay (in seconds)
	MovementLoopAddLocation(NPC, 22.19, -6.86, 183.95, 2, 30)
	MovementLoopAddLocation(NPC, 30.76, -6.33, 196.28, 2, 30)
	MovementLoopAddLocation(NPC, 20.70, -6.85, 206.43, 2, 30)
	MovementLoopAddLocation(NPC, -.90, -5.47, 212.14, 2, 30)
	MovementLoopAddLocation(NPC, 2.35, -4.73, 196.93, 2, 30)
end
I'll open my server up for people to check it out.

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Sun Apr 20, 2008 6:55 pm

I am about to check my changes in. For spawn scripts, be sure that you copy the SpawnScripts directory to your working directory and change the spawn_script field in the spawngroup table to the correct script. Two scripts are included that detail some of the abilities. Like I mentioned earlier, aggro and healthchanged do nothing right now.
If you have any problems, let me know.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Mon Apr 21, 2008 9:29 am

LE, in regards to NPC movement... is there going to be some function to tell whether or not they are walking, or running? Thinking of some NPCs (Orc Runners, oddly enough) that ... run. I know there are animations for this, but they seem to be running in slow-motion (in place atm).

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Mon Apr 21, 2008 2:35 pm

Your speed value must be wrong. Try a higher speed.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests