New LUA Functions: IsEpic, ProcDamage

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

Moderator: Team Members

Post Reply
Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

New LUA Functions: IsEpic, ProcDamage

Post by Jabantiz » Fri Dec 06, 2013 4:59 pm


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:

Re: New LUA Functions: IsEpic, ProcDamage

Post by John Adams » Fri Dec 06, 2013 5:15 pm

Code: Select all

Say(NPC, "I am epic!")
I find myself saying this all the time.

User avatar
Zcoretri
Team Member
Posts: 1642
Joined: Fri Jul 27, 2007 12:55 pm
Location: SoCal

Re: New LUA Functions: IsEpic, ProcDamage

Post by Zcoretri » Fri Dec 06, 2013 5:31 pm

John Adams wrote:

Code: Select all

Say(NPC, "I am epic!")
I find myself saying this all the time.
LMAO :mrgreen:
Jabantiz wrote:IsEpic
ProcDamage
Guess I don't have to ask for a LUA function to test for Epic like I was gonna do when I got home.

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:

Re: New LUA Functions: IsEpic, ProcDamage

Post by John Adams » Sat Dec 21, 2013 11:58 am

11:50:41 E LUA : Error loading Spells/Scout/CheapShot.lua:11: ')' expected near ',' (file name: 'Spells/Scout/CheapShot.lua')

Code: Select all

function precast(Caster, Target)
    -- Does not affect Epic targets
    return (not IsEpic(Target), 43)
end
I fixed the what I thought was a missing paren, but LUA engine still complaining about this line.


side note: I don't think LUA:Precast made it to the wiki, as I cannot seem to search for it.

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: New LUA Functions: IsEpic, ProcDamage

Post by Jabantiz » Sat Dec 21, 2013 12:56 pm

That is my mistake sorry, should have been

Code: Select all

return (not IsEpic(Target)), 43
And I never put precast on the wiki, will look into making a page for it and other new functions like this (equip, unequip, combat_reset, and so on) this weekend

EDIT: Just fixed the error on the editor

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:

Re: New LUA Functions: IsEpic, ProcDamage

Post by John Adams » Sat Dec 21, 2013 1:06 pm

Let me ask this, since I tend to not understand double and triple negatives == true ;)

Doesn't precast() just return true/false (and your new error code)? So why do you need a (not (check-if-true)) double dip? Can't it just be IsEpic or not?


Edit: Oh, is this precast a check that if it is NOT IsEpic, then it's True? lol... my god, how does this make sense to you? haha

Edit2: So it could more practically be

Code: Select all

if IsEpic(Target) then
  return false;
else
  return true;
end
???

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: New LUA Functions: IsEpic, ProcDamage

Post by Jabantiz » Sat Dec 21, 2013 5:06 pm

Yes it is checking to make sure the target is not epic

And yes your code is the same result.

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: New LUA Functions: IsEpic, ProcDamage

Post by Jabantiz » Fri Dec 27, 2013 5:41 pm

Jabantiz wrote:And I never put precast on the wiki, will look into making a page for it and other new functions like this (equip, unequip, combat_reset, and so on) this weekend
Later then I intended but I put precast on the spell scripts wiki page, haven't put the others up yet as there is no pages for item, zone, quest, or spawn scripts. I will work on these but it will take some time.

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: New LUA Functions: IsEpic, ProcDamage

Post by Jabantiz » Fri Dec 27, 2013 11:25 pm

Worked on the wiki pages and added basic info

Spawn scripts
Quest Scripts
Item Scripts
Zone scripts

I had planned to add a lot more and basically make them like tutorials but the more I think of it it might be better to leave them like this as a reference and detailed info on how to use them in a tutorial page. Thoughts?

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests