Server Clan Crushbone
Moderator: Team Members
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
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
-
LethalEncounter
- Team: Zombie
- Posts: 2717
- Joined: Wed Jul 25, 2007 10:10 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- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
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?
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
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.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?
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
-
LethalEncounter
- Team: Zombie
- Posts: 2717
- Joined: Wed Jul 25, 2007 10:10 pm
Example of spawn scripts:
http://eq2emulator.net/ScreenShots/SpawnScripts.jpg
Script used to generate the screenshot:
Note that aggro and healthchanged aren't implemented yet, but the other types are.
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- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
-
LethalEncounter
- Team: Zombie
- Posts: 2717
- Joined: Wed Jul 25, 2007 10:10 pm
- Scatman
- Retired
- Posts: 1688
- Joined: Wed Apr 16, 2008 5:44 am
- EQ2Emu Server: Scatman's Word
- Characters: Scatman
- Location: New Jersey
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.
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
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
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.
I'll open my server up for people to check it out.
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-
LethalEncounter
- Team: Zombie
- Posts: 2717
- Joined: Wed Jul 25, 2007 10:10 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.
If you have any problems, let me know.
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
-
LethalEncounter
- Team: Zombie
- Posts: 2717
- Joined: Wed Jul 25, 2007 10:10 pm
Who is online
Users browsing this forum: No registered users and 0 guests