Post Pacific

Post Pacific (https://postpacific.loc-online.com/index.php)
-   Темы без сохранившегося раздела (https://postpacific.loc-online.com/forumdisplay.php?f=10001)
-   -   [Request share] Npc Buffer (https://postpacific.loc-online.com/showthread.php?t=6391)

didu 09.12.2006 14:42

[Request share] Npc Buffer
 
Hi

Please could you share a npc buffer for c4 server ?

Thx loots

dirkr 09.12.2006 15:15

check the clanhall manager and you should get a good idea of how they work

didu 09.12.2006 15:36

I have see and my npc buffer not work can you take my your npc buffer please ?

FidoW 09.12.2006 17:07

Is more easy than the clan hall buffer, look at santa helper code... is ready to use... you can easy mod that to code without know a lot about AI, only add a new buffs or modify the way you select the buffs (with ask and reply parameters)... or.. i dont know... there are a lot of posible modifications.

didu 09.12.2006 17:29

can you share a npc buffer worker please ?? :D

invisible13 11.12.2006 20:35

deleted !! Fidow THE BEST !!!

FidoW 11.12.2006 23:24

Thats the fucking code i posted the other day and today i delete because.. no one reply, no one thanks... and like i see... some people leech it in silence.

Now i have a better one, with some extra checks, a delay between buffs... you can set an item for the buff... exactly this code... but this time ... not compiled code... only NASC, do it by yourself

Code:

class buffer_npc : default_npc {

parameter:
  string fnHi = "buffer_npc001.htm";
  string fnYouAreChaotic = "buffer_npc002.htm";
  string fnNotEnoughAdena = "buffer_npc003.htm";
  string fnWait = "buffer_npc004.htm";
  int ItemBuff = 57;
  int Amount = 1000;
  int Delay = 500;

handler:
  EventHandler CREATED() {
    myself.i_ai0 = 0;
  }

  EventHandler TALKED(talker) {
    if (talker.karma > 0) myself->ShowPage(talker,fnYouAreChaotic);
    else myself->ShowPage(talker,fnHi);
  }

  EventHandler MENU_SELECTED(talker,ask,reply) {
    if ( (ask == 1) && (myself->OwnItemCount(talker,ItemBuff) >= Amount) ) {
      if( myself.i_ai0 == 0 ) {
        myself.i_ai0 = 1;
        myself->DeleteItem1(talker,ItemBuff,Amount);
        myself->AddUseSkillDesire(talker,reply,1,1,1000000);
        myself->ShowPage(talker,fnHi);
        myself->AddTimerEx(1,Delay);
      }
      else myself->ShowPage(talker,fnWait);
    }
    else myself->ShowPage(talker,fnNotEnoughAdena);
  }

  EventHandler TIMER_FIRED_EX(timer_id) {
    if( timer_id == 1 ) myself.i_ai0 = 0;
  }

}


SnowDragon 12.12.2006 08:47

I have one question
myself->AddUseSkillDesire(talker,reply,1,1,1000000);
What means 3 last parameters

FidoW 12.12.2006 14:15

This is from C1 NPC Server, but most of them must be identical

Code:

//Functions

CreatePet                        (CSharedCreatureData* to, int nPetCollarClassID, int nPetNpcClassID)
DeleteRadar                        (CSharedCreatureData* to, int x, int y, int z)
ShowRadar                        (CSharedCreatureData* to, int x, int y, int z)
EnableTutorialEvent                (CSharedCreatureData* to, int EventSet)
CloseTutorialHTML                (CSharedCreatureData* to)
ShowQuestionMark2                (CSharedCreatureData* to, int id, int sec)
ShowQuestionMark                (CSharedCreatureData* to, int id)
ShowTutorialHTML2                (CSharedCreatureData* to, WCHAR* HTMLFileName, int nSec, WCHAR* SoundFile)
ShowTutorialHTML                (CSharedCreatureData* to, WCHar* HTMLFileName)
StrToInt                        (WCHAR *sTarget)
SubStr                                (WCHAR *sTarget, int nIndex, int nLen)
PledgeName                        (int nPledgeIndex)
PledgeLevelUp                        (int pledge_id)
DistFromTo                        (CSharedCreatureData* from, CSharedCreatureData* to)
InstantTeleportInMyTerritory        (int x, int y, int z, int range)
InMyTerritory                        (CSharedCreatureData* c)
EnableMakingSeeEvent                ()
Despawn                                ()
SoundEffect                        (CSharedCreatureData* c, WCHAR *SoundFile)
SetWeightPoint                        (CSharedCreatureData* c, int nWeightPoint)
IncrementParam                        (CSharedCreatureData* c, int nType, float value)
CreateOnePrivateEx                ()
Maker_FindNpcByKey                (int key)
Maker_GetNpcCount                ()
EnableTimeEvent                        (int time)
CreateOnePrivate                (int private_class_id, const WCHAR* pszAI, int private_weight_point)
CreatePrivates                        (WCHAR* privates)
UseCategoryItem                        (int nCateoryID)
UseItem                                (int nItemNameID)
UseCategorySkill                (CSharedCreatureData* c, int nCategoryID)
UseSkill                        (CSharedCreatureData* c, int nSkillNameID)
Skill_GetAttribute                (int nSkillNameID)
Skill_GetEffectPoint                (int nSkillNameID)
Skill_GetConsumeMP                (int nSkillNameID)
Skill_GetConsumeHP                (int nSkillNameID)
Skill_GetTargetType                (int nSkillNameID)
Castle_PostCropPurchase                (CSharedCreatureData* c, int itemID, int count)
Castle_DeleteCropDrop                (int itemID)
Castle_SetCropDrop                (int itemID, int delta, int price, int level)
Castle_SetCropPrice                (int itemID, int price)
Castle_GetTaxIncome                ()
Castle_GetCropIncome                ()
Castle_GetCropPrice                (int itemID)
Castle_GetCropRate                (int itemID)
ClassChange                        (CSharedCreatureData* c, int nOccupationClassID)
IsInCategory                        (int class_id, int category_id)
SkillQuest_GetQuestMessage        (SkillQuestList *SkillQuest, int SkillNameID)
SkillQuest_GetQuestItemID        (SkillQuestList *SkillQuest, int SkillNameID)
SkillQuest_GetQuestID                (SkillQuestList *SkillQuest, int SkillNameID)
ShowQuestSuggestion                (CSharedCreatureData* c, int skill_name_id, int quest_id, int quest_message)
GetRedirectMessage                (RedirectList* redirect, int skill_name_id)
IsRedirect                        (RedirectList* redirect, int skill_name_id)
ShowRedirectMessage                (CSharedCreatureData *c, int nMessage)
ShowGrowSkillMessage2                (CSharedCreatureData *c, int nSkillNameID, int nQuestID, int nQuestItemID, WCHAR* fnAfterGrow)
ShowGrowSkillMessage                (CSharedCreatureData *c, int nSkillNameID, WCHAR* fnAfterGrow)
ShowSkillList                        (CSharedCreatureData *c, WCHAR *fnByePage)
ShowChoicePage                        (CSharedCreatureData* to)
AddChoice                        (int code, WCHAR* msg)
Agit_SetMaster                        (CSharedCreatureData* to)
Castle_GetPledgeId                ()
Castle_GateOpenClose2                (WCHAR *sDoorName, int openclose)
Castle_IsUnderSiege2                (int nResidenceId)
Castle_GetRawSystemTime                ()
Castle_GetRawSiegeTime                ()
Castle_SetMPRegen                (int nMpRegen)
Castle_SetHPRegen                (int nHpRegen)
Castle_BanishOthers                ()
Castle_GetMPRegen                ()
Castle_GetHPRegen                ()
Castle_IsUnderSiege                ()
Castle_GetPledgeState                (CSharedCreatureData* pc)
Castle_GateOpenClose                (int openclose)
Castle_SetSiegeTime                (int sat_sun, int before_after_noon, int hour, int min)
Castle_IsGateOpen                ()
Castle_SetTaxRate                (int tax)
Castle_GetTaxRate                ()
Castle_GetSiegeTime                ()
Castle_GetOwnerName                ()
Castle_GetPledgeName                ()
IsMyLord                        (CSharedCreatureData* talker)
CheckSiege                        (CSharedCreatureData* talker)
ApproveBattle                        (CSharedCreatureData* talker, WCHAR* fnHi)
ViewSiegeList                        (CSharedCreatureData* talker, WCHAR* fnHi)
PrepareSiegeTime                (int sat_sun, int before_after_noon, int hour, int min)
ShowSetSiegeTime                //NO DATA
RegisterSiegeDefender                (CSharedCreatureData *talker)
RegisterSiege                        (CSharedCreatureData *talker)
GetPledgeSkillLevel                (CSharedCreatureData *talker)
MakeFString                        (int index, const WCHAR* s1, const WCHAR* s2, const WCHAR* s3, const WCHAR* s4,const WCHAR* s5)
ShowFHTML                        (CSharedCreatureData* talker, CFHTML *pFHTML)
FHTML_SetStr                        (CFHTML *pFHTML, WCHAR *pszVarName, WCHAR *pszStrData)
FHTML_SetFloat                        (CFHTML *pFHTML, WCHAR *pszVarName, float dFloatData)
FHTML_SetInt                        (CFHTML *pFHTML, WCHAR *pszVarName, int nIntData)
FHTML_SetFileName                (CFHTML *pFHTML, WCHAR *pszFileName)
GetLastAttacker                        ()
AtomicDelete3Give1Item                //NO DATA
OwnItemCount                        (CSharedCreatureData* c, int nItemClassID)
DeleteItem1                        (CSharedCreatureData* c, int nItemClassID1, int nCount1)
GiveItem3                        (CSharedCreatureData* c, int nItemClassID1, int nCount1, int nItemClassID2, int nCount2, int nItemClassID3, int nCount3)
GiveItem2                        (CSharedCreatureData* c, int nItemClassID1, int nCount1, int nItemClassID2, int nCount2)
GiveItem1                        (CSharedCreatureData* c, int nItemClassID1, int nCount1)
SetOneTimeQuestFlag                (CSharedCreatureData* c, int nQuestID, int bSW)
GetOneTimeQuestFlag                (CSharedCreatureData* c, int nQuestID)       
AttachJournalToMemo                (CSharedCreatureData* c, int nQuestID, int nDestID)
RemoveMemo                        (CSharedCreatureData* c, int nQuestID)
GetMemoState                        (CSharedCreatureData* c, int nQuestID)
SetMemoState                        (CSharedCreatureData* c, int nQuestID, int nState)
SetMemo                                (CSharedCreatureData* c, int nQuestID)
HaveMemo                        (CSharedCreatureData* c, int nQuestID)
GetMemoCount                        (CSharedCreatureData* c)
FloatToInt                        (float f)
IntToStr                        (int i)
Rand                                (int n)
GetWayPointDelay                ()
SetTimerPeriod                        (int nSec)
SetTimerPeriodByTick                (int nTick)
DistFromMe                        (CSharedCreatureData* c)
HPRatio                                (CSharedCreatureData* c)
IsAlive                                (CSharedCreatureData* c)
Sell                                (CSharedCreatureData* talker, BuySellList* buySellList, WCHAR* shopname, WCHAR* sellPage, WCHAR* underAdenaPage, WCHAR* fnUnableItemSell)
InstantTeleport                        (CSharedCreatureData* c, int x, int y, int z)
Teleport                        (CSharedCreatureData* talker, TelPosList* telposlist, WCHAR* shopname, WCHAR* byePage, WCHAR* clsMissMatchPage, WCHAR* underAdenaPage)
ShowPage                        (CSharedCreatureData* to, WCHAR* file)
Shout                                (WCHAR *script)
Talk                                (CSharedCreatureData* target, WCHAR *script)
EquipItem                        //NO DATA
SayFloat                        //NO DATA
SayInt                                //NO DATA
IsSpoiled                        ()
GetCreatureFromIndex                (int index)
GetIndexFromCreature                (CSharedCreature* spCreature)
AddTimerEx                        (int id, int msec)
GetCurrentTick                        ()
IsSameString                        (WCHAR *s1, WCHAR *s2)
GetLifeTime                        ()
GetTopDesireValue                ()
MakeAttackEvent                        (CSharedCreatureData* attacker, int damage)
RandomizeAttackDesire                ()
RemoveAttackDesire                (CSharedCreatureData*)
RemoveAllAttackDesire                ()
AddPetDefaultDesire_Follow        (float value)
AddEffectActionDesire                (CSharedCreatureData *target, int method, float value)
AddMoveToDesire                        (int x, int y, int z, float value)
AddUseSkillDesire                (CSharedCreatureData *target, int nSkillNameID, int skill_type, int action_move_type, float value)
AddMoveToWayPointDesire                (WayPointsType* pWayPoints, WayPointDelaysType* pWayPointDelays, int way_point, float value)
AddDecayingDesire                (float value)
AddFollowDesire                        (CSharedCreatureData *commander, float value)
AddFleeDesire                        (CSharedCreatureData *from, float value)
AddChaseDesire                        (CSharedCreatureData *target, float value)
AddGetItemDesire                (CSharedItemData* item, float value)
AddAttackDesire                        (CSharedCreatureData *target, int amt, float value)
AddDoNothingDesire                (int time, float value)
AddMoveAroundDesire                (int time, float value)

//Events

SAME_BLOODPLEDGE
SAME_PARTY
FRIEND
MS_SILENCE
MSTATE_BERSERK
MSTATE_NORMAL
PSTATE_PET_DEFAULT
PSTATE_EFFECT_ACTION
PSTATE_MOVE_TO
PSTATE_USE_SKILL
PSTATE_MOVE_TO_WAY_POINT
PSTATE_DECAYING
PSTATE_FOLLOW
PSTATE_GET_ITEM
PSTATE_FLEE
PSTATE_CHASE
PSTATE_ATTACK
PSTATE_DO_NOTHING
PSTATE_MOVE_AROUND
PSTATE_IDLE
MOVE_TO_INTERRUPTED
USE_SKILL_INTERRUPTED
MOVE_TO_WAY_POINT_INTERRUPTED
FOLLOW_INTERRUPTED
DECAYING_INTERRUPTED
GET_ITEM_INTERRUPTED
FLEE_INTERRUPTED
CHASE_INTERRUPTED
ATTACK_INTERRUPTED
MOVE_AROUND_INTERRUPTED
IDLE_INTRRUPTED
MOVE_TO_FINISHED
USE_SKILL_FINISHED
MOVE_TO_WAY_POINT_FINISHED
FOLLOW_FINISHED
DECAYING_FINISHED
GET_ITEM_FINISHED
FLEE_FINISHED
CHASE_FINISHED
ATTACK_FINISHED
MOVE_AROUND_FINISHED
IDLE_FINISHED
USER_CONNECTED
QUESTION_MARK_CLICKED
TUTORIAL_EVENT
CREATE_ALLIANCE
MANAGE_CASTLE_SIEGE
ATTACKED_BY_PLEDGE
LEVEL_UP_PLEDGE
REVIVE_PLEDGE
DISMISS_PLEDGE
CREATE_PLEDGE
GOD_BUY_GOODS
GOD_SELL_GOODS
GOD_SHOUT
CMD_ATTACK
CMD_FOLLOW_ME
CLASS_CHANGE_REQUESTED
SKILL_QUEST_ACCEPTED
ONE_SKILL_SELECTED
LEARN_SKILL_REQUESTED
QUEST_ACCEPTED
SELL_REQUESTED
BUY_REQUESTED
TELEPORT_REQUESTED
HOLYTHING_SPELLED
CLAN_SPELLED
CLAN_ATTACKED
FRIEND_ATTACKED
PARTY_DIED
PARTY_SPELLED
PARTY_ATTACKED
DESIRE_MANIPULATION
OUT_OF_TERRITORY
SEE_SPELL
SEE_ATTACK
TIME
CREATED
TIMER_FIRED_EX
TIMER_FIRED
MY_DYING
MASTER_ATTACK
DISAPPEAR_ITEM
SEE_ITEM
DISAPPEAR_CREATURE
SEE_CREATURE
TALK_SELECTED
TALKED
SPELLED
ATTACKED
NO_DESIRE

//Vars

question_id
event_id
time
next_way_point_index
way_point_index
friend
_friend
private
_private
occupation_name_id
skill_name_id
need_quest
_from_choice
_choiceN
_code
timer_id
skill_id
reply
quest_id
item
desire
pledge_index
success
weapon_class_id
state
script
creature
speller
target
commander
damage
victim
attacker
talker
myself

//Talker Vars

param3
param2
param1
dualgara2
dualgara1
meal
quest_last_reward_time
equiped_weapon_class_id
residence_id
attack_type
flag
target_index
clan_help_range
last_blow_weapon_class_id
karma
race
respawn_time
weight_point
class_id
boss_id
sp
occupation
pledge_id
is_pledge_master
name
max_hp
alive
level


SnowDragon 12.12.2006 14:38

big thx=))))))

invisible13 12.12.2006 17:55

I am grateful to you for your knowledge, I have completed html code.. Thanks you big, I is simple noob in this business!! I now am borrowed such and it is necessary to me, I would be grateful if you have given completely the worker

nish 13.12.2006 01:11

not sure if im doin it right but when i tried to compile yoru code i got this error any ideas ?

Code:

ERROR(67) : syntax error
Fail to compile, total error count = 1


RipperX 13.12.2006 06:34

FidoW will be great if you add the autor of that u posted.. later the leechers are the other ppl.

Original Code: https://postpacific.loc-online.com/f...ead.php?t=4086

Aikeleer 13.12.2006 07:15

Did the C4-NASC ever get out? Or is there a modded version for C4 out there?

FidoW 13.12.2006 07:21

Quote:

Originally Posted by RipperX (Post 73953)
FidoW will be great if you add the autor of that u posted.. later the leechers are the other ppl.

Original Code: https://postpacific.loc-online.com/f...ead.php?t=4086

Sorry RipperX, i have that in a text file in the recibed files folder of messenger since 3 or 4 months ago because someone send to me...

Quote:

Originally Posted by nish (Post 73951)
not sure if im doin it right but when i tried to compile yoru code i got this error any ideas ?

Code:

ERROR(67) : syntax error
Fail to compile, total error count = 1


You can't compile that with C1 NASC but trying deleting the myself-> thing, thats the most important different, but the code obtained with C1 compiler isnt compaible with the C4 one but maybe you can adapt it easily, bu t i prefer learn to code by the beggining.


Quote:

Originally Posted by Aikeleer (Post 73954)
Did the C4-NASC ever get out? Or is there a modded version for C4 out there?

I don't think so, i did it by hand.

invisible13 13.12.2006 08:15

FidoW you'r THE BEST !! I LOVE YOU (:

nish 13.12.2006 19:59

ahh no wonder thanks for the reply :)

Genes2 15.12.2006 03:00

where i found the compiler , what's name .

I not understand all , i speack english bad

thx you ^^

RipperX 15.12.2006 03:05

Quote:

Originally Posted by Genes2 (Post 74066)
where i found the compiler , what's name .

I not understand all , i speack english bad

thx you ^^

C4 Compiler, uhm I don't think that anyone here have it.. but, maybe someone can do a NASC Extender for compile C4 ^^

Genes2 15.12.2006 03:07

ok thx i will try.

Genes2 15.12.2006 03:16

have you a link for download ? i not found .

FidoW 15.12.2006 07:44

Quote:

Originally Posted by Genes2 (Post 74074)
have you a link for download ? i not found .

You dont found it because decompiler doesnt exits, please, buy a dictionary... people answer to you like 3 times not exists and you say "THX, I WILL TRY IT" and ... again you ask the same.

Genes2 15.12.2006 08:48

xD sorry i speack very bad english
so can you explain why i can't open the file "npcgrp" with L2 fileedit ? The program said me file "not found" so what i see the file ?

Genes2 15.12.2006 10:40

hehe iy's good now but i see again a rabit so what i have wright all

npcname-e.dat:
14003 Buffer NPC 9C E8 A9 -1

npcgrp.dat:
14003 LineageNPC.a_buffer_npc_MHuman
LineageNPCs.a_buffer_npc_MHuman_m00 2 LineageNPCsTex.a_buffer_npc_MHuman_m00_t00_b00 LineageNPCsTex.a_buffer_npc_MHuman_m00_t00_b01 0 1 0 1.20000005 0 3 ItemSound.fist_1 ItemSound.fist_2 ItemSound.fist_3 5 ItemSound.armor_underwear_1 ItemSound.armor_underwear_2 ItemSound.armor_underwear_3 ItemSound.armor_leather_1 ItemSound.armor_leather_3 3 ChrSound.MNpc_Old_Dmg_2 ChrSound.MNpc_Fighter_Dmg_2 ChrSound.MNpc_Fighter_Dmg_3 1 1 13 76 80 LineageEffect.p_u002_a 0 xx.xx000000 2xx.xx000000 xx.xx000000 1 0


All times are GMT. The time now is 15:11.