Log in

View Full Version : L2Extend Functions/Calls/Tokens/Questions


goodtimeshaxor
01.06.2009, 07:44
Can anyone answer any of these questions? Thanks in advance!


1. I'm looking for a skill token that has two arguments. How can I use it and what would it look like in CParserForSkill.cpp and CParserForSkill.h?


2. How does the Die() function work and how could I use it in a skill.


bool Die(CCreature *pEnemy)

{

typedef bool (__thiscall *_DIE) (CCreature *MySelf, CCreature *Enemy);

_DIE xDie = (_DIE)0x00511D70L;

return ( xDie(this, pEnemy) );

}

The above is from CCreature.h


Die(pTargetCreature);


The above is what I used in a skill but returns an error. I guess it should at least be pTargetCreature->Die()

pTargetCreature->Die(pTargetCreature); seemed to have worked but if it is used to kill an NPC/mob then the corpse of the mob never disapears. The body is left on the ground forever. How can I fix this.


3. I created a damaging skill but right now it only reduces a target's HP which does not kill them if they reach less than 0 HP. I wanted to use the Die() function to make them die if they were under 1 HP. Is there a better way to do this? Is there a damage function?

Версия форума 2009–2010. Восстановлено из публичного снимка Wayback Machine. Тема могла сохраниться частично. Время показано по часам снимка; часовой пояс не установлен. Дата в снимке: 06-01-2009, 07:44 AM. Открыть источник (https://web.archive.org/web/20100324123222id_/http://www.postpacific.com:80/archive/index.php/t-281.html).

DeXioN
01.06.2009, 09:50
2-Perhaps i am wrong but if you kill an NPC directly by CCreaturee::Die timer to despawn is not set.

Better use this function to kill NPC

bool CNPC::Die(CCreature *pEnemy)

{

typedef bool (__thiscall *_DIENPC) (CNPC *pMyself, CCreature *Enemy);

_DIENPC xDienpc = (_DIENPC)0x006C38B0L;

return ( xDienpc(this, pEnemy) );

}

Anyway don't have time to check

Use CNPC:: Die function it work (*Enemy can be *Myself if needed :p)

Версия форума 2009–2010. Восстановлено из публичного снимка Wayback Machine. Тема могла сохраниться частично. Время показано по часам снимка; часовой пояс не установлен. Дата в снимке: 06-01-2009, 09:50 AM. Открыть источник (https://web.archive.org/web/20100324123222id_/http://www.postpacific.com:80/archive/index.php/t-281.html).

goodtimeshaxor
01.06.2009, 11:27
2-Perhaps i am wrong but if you kill an NPC directly by CCreaturee::Die timer to despawn is not set.

Better use this function to kill NPC


bool CNPC::Die(CCreature *pEnemy)

{

typedef bool (__thiscall *_DIENPC) (CNPC *pMyself, CCreature *Enemy);

_DIENPC xDienpc = (_DIENPC)0x006C38B0L;

return ( xDienpc(this, pEnemy) );

}


Anyway don't have time to check

Use CNPC:: Die function it work (*Enemy can be *Myself if needed :p)


Well, this skill is primarily a PvP skill (target would be another PC) but it can be used against an NPC for exping purposes.

Версия форума 2009–2010. Восстановлено из публичного снимка Wayback Machine. Тема могла сохраниться частично. Время показано по часам снимка; часовой пояс не установлен. Дата в снимке: 06-01-2009, 11:27 AM. Открыть источник (https://web.archive.org/web/20100324123222id_/http://www.postpacific.com:80/archive/index.php/t-281.html).

goodtimeshaxor
01.06.2009, 21:31
In addition to the previous:


4. How do Pump skills work and is it possible to make a skill that gives the skillUser increased attack speed while they have a certain buff and while they are targeting the specific target?


Example: If I use skill "Focus Fire" on player A, then my attack speed will be increased as long as I am targetting him. I can target another player B but my attack speed will be normal, then I can retarget player A and my attack speed will be increased again as long as the buff did not wear out.


Is this kind of skill possible?

Версия форума 2009–2010. Восстановлено из публичного снимка Wayback Machine. Тема могла сохраниться частично. Время показано по часам снимка; часовой пояс не установлен. Дата в снимке: 06-01-2009, 09:31 PM. Открыть источник (https://web.archive.org/web/20100324123222id_/http://www.postpacific.com:80/archive/index.php/t-281.html).

mrmac
02.06.2009, 01:00
with packet control yes.

might be messy tho.

Версия форума 2009–2010. Восстановлено из публичного снимка Wayback Machine. Тема могла сохраниться частично. Время показано по часам снимка; часовой пояс не установлен. Дата в снимке: 06-02-2009, 01:00 AM. Открыть источник (https://web.archive.org/web/20100324123222id_/http://www.postpacific.com:80/archive/index.php/t-281.html).

Sdw
02.06.2009, 01:06
Hum stop me if I say something wrong :


1. store the target id somewhere

2. in pump condition just check if the targeted user is still the stored target

3. in pump skill just add attack speed if condition is true

Версия форума 2009–2010. Восстановлено из публичного снимка Wayback Machine. Тема могла сохраниться частично. Время показано по часам снимка; часовой пояс не установлен. Дата в снимке: 06-02-2009, 01:06 AM. Открыть источник (https://web.archive.org/web/20100324123222id_/http://www.postpacific.com:80/archive/index.php/t-281.html).

darkmenx
02.06.2009, 01:25
Can anyone answer any of these questions? Thanks in advance!


1. I'm looking for a skill token that has two arguments. How can I use it and what would it look like in CParserForSkill.cpp and CParserForSkill.h?


2. How does the Die() function work and how could I use it in a skill.


bool Die(CCreature *pEnemy)

{

typedef bool (__thiscall *_DIE) (CCreature *MySelf, CCreature *Enemy);

_DIE xDie = (_DIE)0x00511D70L;

return ( xDie(this, pEnemy) );

}

The above is from CCreature.h


Die(pTargetCreature);


The above is what I used in a skill but returns an error. I guess it should at least be pTargetCreature->Die()

pTargetCreature->Die(pTargetCreature); seemed to have worked but if it is used to kill an NPC/mob then the corpse of the mob never disapears. The body is left on the ground forever. How can I fix this.


3. I created a damaging skill but right now it only reduces a target's HP which does not kill them if they reach less than 0 HP. I wanted to use the Die() function to make them die if they were under 1 HP. Is there a better way to do this? Is there a damage function?


this needs 2 args:

typedef bool (__thiscall *_DIE) (CCreature *MySelf, CCreature *Enemy)


here you passed only 1:

Die(pTargetCreature);


even if its valid arg or not, its still just 1.

Версия форума 2009–2010. Восстановлено из публичного снимка Wayback Machine. Тема могла сохраниться частично. Время показано по часам снимка; часовой пояс не установлен. Дата в снимке: 06-02-2009, 01:25 AM. Открыть источник (https://web.archive.org/web/20100324123222id_/http://www.postpacific.com:80/archive/index.php/t-281.html).

FidoW
02.06.2009, 04:37
this needs 2 args:

typedef bool (__thiscall *_DIE) (CCreature *MySelf, CCreature *Enemy)


here you passed only 1:

Die(pTargetCreature);


even if its valid arg or not, its still just 1.


His new function only require 1 arg, inside the function as first arg of the function is sending the current ccreature since i guess Die is a CCreature function, isn't ?

Версия форума 2009–2010. Восстановлено из публичного снимка Wayback Machine. Тема могла сохраниться частично. Время показано по часам снимка; часовой пояс не установлен. Дата в снимке: 06-02-2009, 04:37 AM. Открыть источник (https://web.archive.org/web/20100324123222id_/http://www.postpacific.com:80/archive/index.php/t-281.html).

darkmenx
02.06.2009, 05:13
His new function only require 1 arg, inside the function as first arg of the function is sending the current ccreature since i guess Die is a CCreature function, isn't ?


liek u can see at the definition it requires 2, he passed 1, it should be liek source->die(target);

Версия форума 2009–2010. Восстановлено из публичного снимка Wayback Machine. Тема могла сохраниться частично. Время показано по часам снимка; часовой пояс не установлен. Дата в снимке: 06-02-2009, 05:13 AM. Открыть источник (https://web.archive.org/web/20100324123222id_/http://www.postpacific.com:80/archive/index.php/t-281.html).

FidoW
02.06.2009, 05:51
liek u can see at the definition it requires 2, he passed 1, it should be liek source->die(target);

Again, he create their own function, that call the l2server original one, as first parameter send the object itself as it is already a CCreature, the second one is passed in the first param of his new and custom function.

pTargetCreature->Die(pTargetCreature); seemed to have worked but if it is used to kill an NPC/mob then the corpse of the mob never disapears. The body is left on the ground forever. How can I fix this.

He is doing it ok as far as he is do something like he wrote, always sendind one arg to the function plus the object itself.

Версия форума 2009–2010. Восстановлено из публичного снимка Wayback Machine. Тема могла сохраниться частично. Время показано по часам снимка; часовой пояс не установлен. Дата в снимке: 06-02-2009, 05:51 AM. Открыть источник (https://web.archive.org/web/20100324123222id_/http://www.postpacific.com:80/archive/index.php/t-281.html).

goodtimeshaxor
02.06.2009, 07:07
Yea. The die function works correctly when tested with 1 argument. It should be:


CreatureWhoDies->Die(CreatureWhoDoesTheKilling)


Although, the biggest problem now is that this doesn't give PvP/PK points and neither does it get rid of the corpse.

Версия форума 2009–2010. Восстановлено из публичного снимка Wayback Machine. Тема могла сохраниться частично. Время показано по часам снимка; часовой пояс не установлен. Дата в снимке: 06-02-2009, 07:07 AM. Открыть источник (https://web.archive.org/web/20100324123222id_/http://www.postpacific.com:80/archive/index.php/t-281.html).

Skye
02.06.2009, 15:43
Maybe you have to be specific as in instead of ccreature, you use cnpc or user...

Версия форума 2009–2010. Восстановлено из публичного снимка Wayback Machine. Тема могла сохраниться частично. Время показано по часам снимка; часовой пояс не установлен. Дата в снимке: 06-02-2009, 03:43 PM. Открыть источник (https://web.archive.org/web/20100324123222id_/http://www.postpacific.com:80/archive/index.php/t-281.html).

Fyyre
02.06.2009, 15:57
//s_fucking_die

//


User *pUser = (User*)pSkillUser;

CCreature *pEnemy = (CCreature *)pTarget;


if((pUser->IsValidUser() && (pEnemy->IsValidCreature()))) {

pEnemy->Die(pEnemy); } //splat

Версия форума 2009–2010. Восстановлено из публичного снимка Wayback Machine. Тема могла сохраниться частично. Время показано по часам снимка; часовой пояс не установлен. Дата в снимке: 06-02-2009, 03:57 PM. Открыть источник (https://web.archive.org/web/20100324123222id_/http://www.postpacific.com:80/archive/index.php/t-281.html).

kold
02.06.2009, 16:51
splat

Версия форума 2009–2010. Восстановлено из публичного снимка Wayback Machine. Тема могла сохраниться частично. Время показано по часам снимка; часовой пояс не установлен. Дата в снимке: 06-02-2009, 04:51 PM. Открыть источник (https://web.archive.org/web/20100324123222id_/http://www.postpacific.com:80/archive/index.php/t-281.html).