LUA Functions Request
Moderator: Team Members
- Astal
- Posts: 96
- Joined: Tue Dec 09, 2008 1:35 pm
Re: LUA Functions Request
I just figured id throw this out there.
Ive been workin with spells a bit and found we are lacking a lot of functions from the regular game.
I was wondering if anyone was thinking of adding some functions like these below
Setting the melee critical chance
Setting the attack speed
Setting the attack damage (directly)
Setting the attack rating (chance to hit)
Ive been workin with spells a bit and found we are lacking a lot of functions from the regular game.
I was wondering if anyone was thinking of adding some functions like these below
Setting the melee critical chance
Setting the attack speed
Setting the attack damage (directly)
Setting the attack rating (chance to hit)
I DIE FREE!!
- 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 Request
Scat, can you whip me up a quick LUA that will move a Player (not an NPC or Spawn) like the MovementLoopAddLocation() does? Only, not a LOOP. I'd like it to just begin, have waypoints, and an end.
I was trying to fake a griffon ride tonight and realized the code doesn't work on Player, even if you pass it a player param. Here's the simple script I tried, standing in QC on the dock by the traders outpost. I expected to shoot out over the sand:
I even tried taking out the IsNPC() check, and adding another if IsPlayer, still doesn't work - so I am crying for help.
Does not work:
Thanks!
edit: in a desperate attempt to make you proud, I even tried writing a new LUA function myself
It compiles, so it must work!! Nah, it doesn't. I still have no movement.
Code:
Hey, I'm tryin....
I was trying to fake a griffon ride tonight and realized the code doesn't work on Player, even if you pass it a player param. Here's the simple script I tried, standing in QC on the dock by the traders outpost. I expected to shoot out over the sand:
Code: Select all
function hailed(NPC, Player)
FaceTarget(NPC, Player)
Say(NPC, "Off you go!")
MoveToLocation(Player, -56.02, -6.35, 57.01)
MoveToLocation(Player, -65.47, -6.35, 58.06)
endDoes not work:
Code: Select all
if(spawn){
if(spawn->IsNPC())
((NPC*)spawn)->RunToLocation(x, y, z);
else if(spawn->IsPlayer())
((Player*)spawn)->RunToLocation(x, y, z);
}edit: in a desperate attempt to make you proud, I even tried writing a new LUA function myself
Code:
Code: Select all
int EQ2Emu_lua_MovePlayerToLocation(lua_State* state){
if(!lua_interface)
return 0;
Spawn* player = lua_interface->GetSpawn(state);
float x = lua_interface->GetFloatValue(state, 2);
float y = lua_interface->GetFloatValue(state, 3);
float z = lua_interface->GetFloatValue(state, 4);
if(player){
if(player->IsPlayer())
((Player*)player)->RunToLocation(x, y, z);
}
lua_interface->ResetFunctionStack(state);
return 0;
}- Scatman
- Retired
- Posts: 1688
- Joined: Wed Apr 16, 2008 5:44 am
- EQ2Emu Server: Scatman's Word
- Characters: Scatman
- Location: New Jersey
Re: LUA Functions Request
Sure. I believe there is something wrong with the MoveToLocation LUA function anyway. I'm going to start looking at the movement loop stuff so while I'm in there I'll do this too. One thing though, how exactly is this going to work? What if a player is being moved and then presses an arrow key?
- ZexisStryfe
- Posts: 1026
- Joined: Thu Jul 26, 2007 6:39 am
- EQ2Emu Server: Sytherian Legends
- Location: Connecticut
- Contact:
Re: LUA Functions Request
Arrow keys shouldn't break the movement, however the jump key should.
- 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 Request
You saying I can jump off my griffon?
- ZexisStryfe
- Posts: 1026
- Joined: Thu Jul 26, 2007 6:39 am
- EQ2Emu Server: Sytherian Legends
- Location: Connecticut
- Contact:
Re: LUA Functions Request
that is exactly what i am saying... 
- 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 Request
When has that ever been allowed? mid ride between towers, I can jump off my griffon and land on some gnolls? I do not believe you.
- ZexisStryfe
- Posts: 1026
- Joined: Thu Jul 26, 2007 6:39 am
- EQ2Emu Server: Sytherian Legends
- Location: Connecticut
- Contact:
Re: LUA Functions Request
It has always been allowed. The only zone that doesn't allow it is Timorous Deep, because it would be insta-death so it is disabled.
- 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 Request
I think you're lying, just so I'll try it and fall to my death!
- Scatman
- Retired
- Posts: 1688
- Joined: Wed Apr 16, 2008 5:44 am
- EQ2Emu Server: Scatman's Word
- Characters: Scatman
- Location: New Jersey
Re: LUA Functions Request
It hasn't always been allowed. Wayyy back when you could not jump off your griffon in antonica. What I meant by the how to handle player movement is that LE thought there was a specific packet(s) needed to be sent while using a controller mount. This packet would disable all movement data sent to server so it couldnt be processed. Since this is not the real thing and just a mimic of the controlled mount, did we want to try to ignore all player-initiated movement? It may be easier just to implement the real system imo.
- 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 Request
Yes.Scatman wrote:It may be easier just to implement the real system imo.
- Scatman
- Retired
- Posts: 1688
- Joined: Wed Apr 16, 2008 5:44 am
- EQ2Emu Server: Scatman's Word
- Characters: Scatman
- Location: New Jersey
Re: LUA Functions Request
After I fix the last issue with spawn movement I think I'll look into flight and see what the system is like. I need a break from these bugs. They're bugging me *cheesy drum roll*
Who is online
Users browsing this forum: No registered users and 0 guests


