LUA Functions Request

Discussions on development of both the EQ2Emulator LUA Script Engine and Script specifications

Moderator: Team Members

Post Reply
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 » Sun Sep 21, 2008 10:59 am

Hmm I haven't done that quest yet. I guess it does stay, or maybe for just a certain duration lol? Won't be hard to code once we can interact with objects "harvesting" like that.

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 » Thu Sep 25, 2008 2:08 pm

After getting another similar quest where I am to go out and "harvest" some stuff, I noticed that the spawn items I am to gather were usually already in place on the ground, just marked as targetable=0, show_name=0. We may need a lua function that sets those items as targetable/show_name for the harvest, just for that individual client.
A way around it would be to re-spawn the same spawn type, just with different params.
Another function that I think we talked about but I cannot find now... one NPC "signaling" another to respond. When youa are doing "The Fume and Fire Ceremony" in Big Bend, one NPC leads off in a ritual speech honoring Rallos Zek. When you click his Option to continue, the second NPC near him takes over and continues the speech, back and forth til the ceremony is complete. Cheesey, but effective.
Each Option click needs to send the next step of the conversation back to the partner NPC. Have we requested this complex functionality yet? :)

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

Post by LethalEncounter » Thu Sep 25, 2008 4:58 pm

Sounds like you just need a way of getting a reference to an NPC that is already spawned. I'll add GetNPC(Spawn, spawn id) that returns the closest NPC of that spawn id to the given Spawn.
Example:
NPC2 = GetNPC(Spawn, 12345)
Again, as I mentioned before "Spawn" just refers to a Spawn object, so NPC, Player, Spawn, etc will work as the first argument.

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 » Thu Sep 25, 2008 5:09 pm

Cool. :) How do you think we can handle the first one though? I know what John means I've seen those quests before. For example, one quests requires you to go and destroy bushes (not the harvestable ones). Before you have the quest, you can see the bushes, they are clearly spawned but you cannot interact with them. As John said, their show_name and targetable = 0. But once you get the quest, they become targetable and show name just for the player who has the quest.

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

Post by LethalEncounter » Thu Sep 25, 2008 5:21 pm

Yah, how about SpawnSet(spawn id, Spawn Set Variable, Spawn Set Value, Player (optional) )
The Spawn Set Variable/Values would be the same arguments you would use in a /spawn set command. The optional Player argument on the end would allow you to only send the changes to the specified Player.
Examples:
SpawnSet(12345, "show_name", 1, Player)
SpawnSet(12345, "targetable", 1, Player)

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 » Thu Sep 25, 2008 5:25 pm

Perfect! Thanks :)

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 » Thu Sep 25, 2008 11:17 pm

As long as this is only changing the values in memory, and not the Database, sounds great.

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 » Sat Sep 27, 2008 12:37 pm

Referring back to GetZone(Spawn) for a moment. I know this creates a "reference" to the Spawn zone, but how can I do a comparison that if I am in zone_id 235, script it different?
Use case: I am in Graystone Yard, and I ring the portal bell to go somewhere else within Qeynos. I obviously do not want to go to Graystone since I am already there... I am trying to use GetZone() to ID that whatever zone_id I am currently in, do not display that option. So far, no luck. I am sure this is not the function of GetZone(). Is there another way?
Btw, this is a short-term solution to the non-working mariner bells, using a Conversation with custom NPCs. It'll do for now, but something to consider down the road.

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

Post by LethalEncounter » Sat Sep 27, 2008 3:26 pm

I can actually get the mariner bells working without too much trouble. I already have most of the code in place to do it. I'll take a look at it tomorrow if I have time (heading to lake to do boat maintenance). As far as the GetZone() function - yah it only returns a pointer to a Zone. I could add GetZoneID(Zone) and GetZoneName(Zone) functions if you wish. If you think of any others 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 » Sat Sep 27, 2008 4:04 pm

Sure, I'll take mariner bells, GetZoneID() and GetZoneName() =) Haha. Hey, since you offered...
Psst, don't forget to put your truck in Park.

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 » Sat Sep 27, 2008 7:19 pm

I do not think this is an added LUA function necessary, but I noticed on Live when you interrupt an NPC's "PlayFlavor()", the sound fades and stops playing almost immediately. Ours just keeps yapping and yapping until we're out of ear shot. =)

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 » Sat Sep 27, 2008 7:57 pm

Need a way to send an entity_command to an object, like a door, to "use" (open) based on proximity. Not sure if we already have that? I don't think Use is an emote =)
Example is the doors in Tradeskill instances that swing open when you get within 5' of them (or so).

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 » Sat Oct 04, 2008 11:03 pm

Thinking of another LUA function we could use for initial character creation. Noticed that when you make a new toon, soon as you move a step you are offered a quest "The Great Challenge" or something like that, to reach level 20 in 14 days. So, LUA function based on movement from the current location perhaps.
Also, can we track from the time a player gets a quest til a "timeout" such as this great challenge? in 14 /played days, if you are not yet level 20, the quest expires, etc.

User avatar
ZexisStryfe
Posts: 1026
Joined: Thu Jul 26, 2007 6:39 am
EQ2Emu Server: Sytherian Legends
Location: Connecticut
Contact:

Post by ZexisStryfe » Sun Oct 05, 2008 7:23 am

That quest is only for new accounts and is part of the Living Legacy initiative. Not everyone gets it when they make a new char (like me).
~ EQ2 Emulator Project Manager

Image
Image
Image
"Zexis, from this day forth, you shall be known as... '3 of 6'" - John Adams

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 » Sun Oct 05, 2008 11:05 am

Right, but I am asking for it nonetheless because Live supports that type of a quest. An example is that a server admin may want to host a special event, where the next time their players log in, they move a step and get a quest offered (once). They either accept or decline, and it is never heard from again. The quest could be a race through Norrath, a Best of the Best competition, finding a particular treasure to gain a title, etc.
Rather than make everyone seek out an NPC to get the special event quest, they just get it upon logging in. That's what I am thinking this Great Challenge quest is like.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests