LUA Functions Request
Moderator: Team Members
-
LethalEncounter
- Team: Zombie
- Posts: 2717
- Joined: Wed Jul 25, 2007 10:10 pm
I just added the following LUA functions:
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.
I am not done with the SpawnSet function yet. I am trying to decide the best way to implement it. Because of the way that EQ2 handles spawn updates, it is going to be difficult to see players different updates for the same spawn.
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.
I am not done with the SpawnSet function yet. I am trying to decide the best way to implement it. Because of the way that EQ2 handles spawn updates, it is going to be difficult to see players different updates for the same spawn.
- Scatman
- Retired
- Posts: 1688
- Joined: Wed Apr 16, 2008 5:44 am
- EQ2Emu Server: Scatman's Word
- Characters: Scatman
- Location: New Jersey
LE, when using GetZone(), is the parameter for that allowed to take a Spawn?
This works in a quest
But this doesn't in a spawnscript
Another thing,
I am trying to add an ObtainItem quest step but it does not appear to be updating. I tried buying the item off a merchant and also just using /summonitem to spawn it. I looked at the source and I appear to be passing in the parameters correctly. Here's the line:
Lol, don't ask about the quest step =D
This works in a quest
Code: Select all
Spawn(GetZone(Player), 2530174, false, GetX(Player), GetY(Player), GetZ(Player))Code: Select all
Spawn(GetZone(Spawn), 2530174, false, GetX(NPC), GetY(NPC), GetZ(NPC))I am trying to add an ObtainItem quest step but it does not appear to be updating. I tried buying the item off a merchant and also just using /summonitem to spawn it. I looked at the source and I appear to be passing in the parameters correctly. Here's the line:
Code: Select all
AddQuestStepObtainItem(Quest, 5, "I must buy an external hard drive for the programmer. Hanna Deeppockets should have one.", 1, 100, "I must buy an external hard drive for the programmer so he can back up his work in a safe place. He says Hanna Deeppockets sells them. I can find her to the west of Murrar Shar.", 15069)-
LethalEncounter
- Team: Zombie
- Posts: 2717
- Joined: Wed Jul 25, 2007 10:10 pm
Can you paste the full function that you are using that in?Scatman wrote:LE, when using GetZone(), is the parameter for that allowed to take a Spawn?
This works in a questBut this doesn't in a spawnscriptCode: Select all
Spawn(GetZone(Player), 2530174, false, GetX(Player), GetY(Player), GetZ(Player))Code: Select all
Spawn(GetZone(Spawn), 2530174, false, GetX(NPC), GetY(NPC), GetZ(NPC))
heh, currently the only way to update the quest is through looting. However, I'll change it to allow any method of item retrieval.Scatman wrote: Another thing,
I am trying to add an ObtainItem quest step but it does not appear to be updating. I tried buying the item off a merchant and also just using /summonitem to spawn it. I looked at the source and I appear to be passing in the parameters correctly. Here's the line:Lol, don't ask about the quest step =DCode: Select all
AddQuestStepObtainItem(Quest, 5, "I must buy an external hard drive for the programmer. Hanna Deeppockets should have one.", 1, 100, "I must buy an external hard drive for the programmer so he can back up his work in a safe place. He says Hanna Deeppockets sells them. I can find her to the west of Murrar Shar.", 15069)
- Scatman
- Retired
- Posts: 1688
- Joined: Wed Apr 16, 2008 5:44 am
- EQ2Emu Server: Scatman's Word
- Characters: Scatman
- Location: New Jersey
Code: Select all
function SpawnGoblin(NPC, Spawn)
Spawn(GetZone(Spawn), 8, false, GetX(NPC), GetY(NPC), GetZ(NPC))
if GetQuestStep(Spawn, 47) == 2 then
SetStepComplete(Spawn, 47, 2)
end
Say(NPC, "He stole my code! " .. GetName(Spawn) .. ", get him!")
endOk, no rush on the item update, just making sure I was getting it right. Thanks.
-
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
Spawn is being passed correctly because in the Say() function, my name is being said in the text when I comment out the Spawn() function. I did try using NPC as well and it didn't work. I also tried using Spawn in the getters for location and that didn't work either.
If you want to see the whole quest I can send it to ya or it's on John's DB editor. It's a spawn script for "The Disgruntled Programmer" in Queen's Colony.
If you want to see the whole quest I can send it to ya or it's on John's DB editor. It's a spawn script for "The Disgruntled Programmer" in Queen's Colony.
-
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
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
- Scatman
- Retired
- Posts: 1688
- Joined: Wed Apr 16, 2008 5:44 am
- EQ2Emu Server: Scatman's Word
- Characters: Scatman
- Location: New Jersey
I did a little more testing and found two things. One is that if I pass in a Player reference to the GetZone() function for the Spawn() function, it works. The mob spawns as it should.
The second thing, is if I give the Spawn() function a spawn id that doesn't have a zonespawnentry for that zone, it doesn't spawn. If I do, it works.
So when I satisfy both those two things it works. I've taking one out and leaving the other in and it does not work.
*edit*
Well we added a spawngroup to the goblin we're trying to spawn and restarted the server but it still didn't work so I guess it doesn't need to have a spawngroup to spawn. Trying to figure out why one spawn will work but another won't...
The second thing, is if I give the Spawn() function a spawn id that doesn't have a zonespawnentry for that zone, it doesn't spawn. If I do, it works.
So when I satisfy both those two things it works. I've taking one out and leaving the other in and it does not work.
*edit*
Well we added a spawngroup to the goblin we're trying to spawn and restarted the server but it still didn't work so I guess it doesn't need to have a spawngroup to spawn. Trying to figure out why one spawn will work but another won't...
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
We'll need the ability to hide ProvidesQuest() for certain races. Ie., a Dwarf should not be able to get the Half-Elf mentor quest. I just tried adding a Spawn reference to spawn(NPC, Spawn) and putting an "if GetRace(Spawn) == 14 then ProvidesQuest(..) end". No workie 
I didn't think it would work, but I wanted to try. So eventually we'll need to expand on either ProvidesQuest() with a raceID or ALL param, or allow function spawn() to use the Player reference.
I didn't think it would work, but I wanted to try. So eventually we'll need to expand on either ProvidesQuest() with a raceID or ALL param, or allow function spawn() to use the Player reference.
Who is online
Users browsing this forum: No registered users and 0 guests