/ja Ready

Beastmaster
Post Reply
Delaide
Posts: 472
Joined: Sat Jun 14, 2014 8:58 am

/ja Ready

Post by Delaide » Sun Jul 05, 2015 9:35 pm

So, I have noticed, sic seems to work, SMN bloodpacks work, but the ready ability always shows nothing, even when the jug pet should have abilities.
I would like to look into creating this, but I need to understand more of how the pet abilities work.
Can anyone explain to me where to find the smn pet abilities?
I know the actual smn abilities are scripted here: https://github.com/DarkstarProject/dark ... ities/pets

But I am more curious where the info is that says "x pet has y ability". Then I can see if I can recreate this for the ready ja.

aizenmyou
Posts: 13
Joined: Fri May 10, 2013 4:16 pm

Re: /ja Ready

Post by aizenmyou » Sat Oct 24, 2015 8:02 pm

Delaide wrote:So, I have noticed, sic seems to work, SMN bloodpacks work, but the ready ability always shows nothing, even when the jug pet should have abilities.
I would like to look into creating this, but I need to understand more of how the pet abilities work.
Can anyone explain to me where to find the smn pet abilities?
I know the actual smn abilities are scripted here: https://github.com/DarkstarProject/dark ... ities/pets

But I am more curious where the info is that says "x pet has y ability". Then I can see if I can recreate this for the ready ja.
Ready would be so nice to have working. I just don't have the time with real life stuff to go through it. :(

Metalfiiish
Developer
Posts: 176
Joined: Tue Jul 31, 2012 7:21 am

Re: /ja Ready

Post by Metalfiiish » Tue Jan 19, 2016 5:34 am

If I'm with you, your looking for how the smn pet abilities work?

Seems like the core of what is calling those scripts is built in luautils.cpp:
https://github.com/DarkstarProject/dark ... autils.cpp

From Line 3284:
int32 OnPetAbility(CBaseEntity* PTarget, CBaseEntity* PMob, CMobSkill* PMobSkill, CBaseEntity* PMobMaster)
{
lua_prepscript("scripts/globals/abilities/pets/%s.lua", PMobSkill->getName());

If your looking for the checks to ensure the player/pet can use the ability, I am 98% sure it is all handled client side. closet thing I see if a query to database to get pet skill list:

https://github.com/DarkstarProject/dark ... tutils.cpp
Pet->m_MobSkillList = (uint16)Sql_GetUIntData(SqlHandle, 40);


There is another example for automations attachments:

Line 1911:
int32 OnManeuverGain(CBattleEntity* PEntity, CItemPuppet* attachment, uint8 maneuvers)


Both of these are what is exposing the entities from C to Lua. The lua is setting the proper directory for pets in line 3225:

int32 OnAbilityCheck(CBaseEntity* PChar, CBaseEntity* PTarget, CAbility* PAbility, CBaseEntity** PMsgTarget)

.....
if (PAbility->isAvatarAbility())
{
memcpy(filePath, "scripts/globals/abilities/pets/%s.lua", 38);
}

lua_prepscript(filePath, PAbility->getName());

if (prepFile(File, "onAbilityCheck"))
{
return 87;
}

hope this helps. I noticed the ability ready already has an id located in ability.h, so it likely needs only the ready.lua file to be made in srcipts/abilities/:
https://github.com/DarkstarProject/dark ... /ability.h.

The above file also lists all smn pet abilities at around ID number 246 + , it also appears to list all the pet jug abilities that ready could provoke (saw a few around ID 719).

User avatar
demolish
Developer
Posts: 262
Joined: Thu Jul 26, 2012 7:12 am

Re: /ja Ready

Post by demolish » Tue Jan 19, 2016 7:06 am

Metalfiiish wrote:If I'm with you, your looking for how the smn pet abilities work?

Seems like the core of what is calling those scripts is built in luautils.cpp:
https://github.com/DarkstarProject/dark ... autils.cpp

From Line 3284:
int32 OnPetAbility(CBaseEntity* PTarget, CBaseEntity* PMob, CMobSkill* PMobSkill, CBaseEntity* PMobMaster)
{
lua_prepscript("scripts/globals/abilities/pets/%s.lua", PMobSkill->getName());

If your looking for the checks to ensure the player/pet can use the ability, I am 98% sure it is all handled client side. closet thing I see if a query to database to get pet skill list:

https://github.com/DarkstarProject/dark ... tutils.cpp
Pet->m_MobSkillList = (uint16)Sql_GetUIntData(SqlHandle, 40);


There is another example for automations attachments:

Line 1911:
int32 OnManeuverGain(CBattleEntity* PEntity, CItemPuppet* attachment, uint8 maneuvers)


Both of these are what is exposing the entities from C to Lua. The lua is setting the proper directory for pets in line 3225:

int32 OnAbilityCheck(CBaseEntity* PChar, CBaseEntity* PTarget, CAbility* PAbility, CBaseEntity** PMsgTarget)

.....
if (PAbility->isAvatarAbility())
{
memcpy(filePath, "scripts/globals/abilities/pets/%s.lua", 38);
}

lua_prepscript(filePath, PAbility->getName());

if (prepFile(File, "onAbilityCheck"))
{
return 87;
}

hope this helps. I noticed the ability ready already has an id located in ability.h, so it likely needs only the ready.lua file to be made in srcipts/abilities/:
https://github.com/DarkstarProject/dark ... /ability.h.

The above file also lists all smn pet abilities at around ID number 246 + , it also appears to list all the pet jug abilities that ready could provoke (saw a few around ID 719).
click line number when viewing on github and copy from address bar/right click line number and copy/paste the link, github auto scrolls to that line number :)
<Giblet[NewBrain]> kj with this first step would be fine on my shit
Click here for a guide on scripting missions.

Post Reply