PDA

View Full Version : [Share] NPC "PK Killer"


Fot@r@s
27.06.2007, 16:05
Hello Guyz,
I have made this npc to protect the players from spawnkilling.

Server Side:
npcdata.txt
npc_begin guard 18000 [pk_killer] level=80 acquire_exp_rate=0 acquire_sp=0 unsowing=1 clan={} ignore_clan_list={} clan_help_range=300 slot_chest=[] slot_rhand=[draconic_bow] slot_lhand=[] shield_defense_rate=0 shield_defense=0 skill_list={@s_race_undead;@s_full_magic_defence} npc_ai={[pk_killer];{[fnHi]=[pk_killer.htm]};{[MoveAroundSocial]=0};{[MoveAroundSocial1]=92};{[MoveAroundSocial2]=92}} category={} race=human sex=male undying=1 can_be_attacked=0 corpse_time=7 no_sleep_mode=0 agro_range=18000 ground_high={160;0;0} ground_low={50;0;0} exp=1 org_hp=5000000000 org_hp_regen=10 org_mp=5000000000.0 org_mp_regen=10 collision_radius={8;8} collision_height={24;24} str=99 int=99 dex=99 wit=99 con=99 men=99 base_attack_type=bow base_attack_range=60 base_damage_range={0;0;80;120} base_rand_dam=30 base_physical_attack=9xx.xx854 base_critical=50 physical_hit_modify=4.75 base_attack_speed=5000 base_reuse_delay=0 base_magic_attack=611 base_defend=99xx.xx base_magic_defend=9999.8 physical_avoid_modify=-6 soulshot_count=0 spiritshot_count=0 hit_time_factor=0.6 item_make_list={} corpse_make_list={} additional_make_list={} additional_make_multi_list={} hp_increase=0 mp_increase=0 safe_height=100 npc_end

htm:
<html><body>
PK killer:<br>
Please go Away!! I have work now....<br>
</body></html>
Ai: attached below
Client Side:

npcname-e.dat
18000 Maximus Elite Guard 3F 8B FE -1
npcgrp.dat
18000 LineageNPC.e_guard_MOrc LineageNPCs.e_guard_MOrc_m00 4 LineageNPCsTex.e_guard_MOrc_m00_t00_b00 LineageNPCsTex.e_guard_MOrc_m00_t00_b01 LineageNPCsTex.e_guard_MOrc_m00_t00_f LineageNPCsTex.e_guard_MOrc_m00_t00_h 0 1 0 2.00000000 0 3 ItemSound.fist_1 ItemSound.fist_2 ItemSound.fist_3 5 ItemSound.armor_metal_strong_1 ItemSound.armor_metal_strong_3 ItemSound.armor_metal_strong_7 ItemSound.armor_metal_alt_6 ItemSound.armor_metal_weak_2 3 ChrSound.MNpc_Giant_Dmg_1 ChrSound.MNpc_Giant_Dmg_2 ChrSound.MNpc_Giant_Dmg_3 0 0 0 0 LineageEffect.p_u002_a 0 xx.xx000000 2xx.xx000000 xx.xx000000 0 0

Maybe needs some corrections.

Вложения из исходного сообщения (сами файлы в копии отсутствуют):
ai.txt — 4896 байт

HF
27.06.2007, 16:14
It already realized in [moveguard_human] in C4 Retail pack.
Your guard do something new? Give some more information :)

HF
27.06.2007, 16:16
i dont understund. What PK must be killed here? And where spawned this PK_Killer

/************************************************** *************************
* Change Log
* ------------------
* xx.xx.2007
* Script Decompiled by SauDecompiler build 102306.2 (fix build 060707)
*
************************************************** *************************/

class pk_killer : guard_stand
{
handler:
EventHandler TALK_SELECTED(i0,talker)
{
if( _from_choice == 0 )
{
if( myself->HaveMemo(talker,104) )
{
_choiceN = ( _choiceN + 1 );
_code = 0;
myself->AddChoice(0,"Spirit of Mirrors (In Progress)");
}
if( _choiceN > 1 )
{
myself->ShowChoicePage(talker,1);
return;
}
}
if( _from_choice || _choiceN == 1 )
{
if( _code == 0 )
{
if( _from_choice == 0 || myself->HaveMemo(talker,104) )
{
myself->SetCurrentQuestID(104);
if( myself->GetInventoryInfo(talker,0) >= ( myself->GetInventoryInfo(talker,1) * 0.800000 ) || myself->GetInventoryInfo(talker,2) >= ( myself->GetInventoryInfo(talker,3) * 0.800000 ) )
{
myself->ShowSystemMessage(talker,1118);
return;
}
myself->ShowPage(talker,"johnson_q0104_01.htm");
i0 = myself->GetMemoStateEx(talker,104,1);
myself->SetMemoStateEx(talker,104,1,( i0 + 1 ));
if( myself->GetMemoStateEx(talker,104,1) == 110 )
{
myself->SetFlagJournal(talker,104,2);
}
}
}
return;
}
super;
}

}

TALK_SELECTED ? PK must be use "Quest" for self killing?

Morfey
27.06.2007, 16:51
:) nice. :P

madar
27.06.2007, 17:45
lolcopypaste

Fot@r@s
27.06.2007, 17:56
I don't know how to edit the AI and for that reason i copy&paste a regular AI guard ;). I don't think that is something fantastick or difucult to make. I just share it for tha lazys...

seway
27.06.2007, 18:27
HF i think it is to kill the players that pk on respaw, i use a peace respaw.

:)

FidoW
27.06.2007, 18:42
I don't know how to edit the AI and for that reason i copy&paste a regular AI guard ;). I don't think that is something fantastick or difucult to make. I just share it for tha lazys...

I cant stop laughing hahahahaha

He made a awesome NPC!! he copy & paste TALK_SELECTED handler from other NPC... that has nothing to do with PK... or whatever... this man have absolute no idea what he is doing...

First... that guard works because you are using a super class guard_stand, but in your code there is nothing at all.. so.. when you say.. "Maybe needs some corrections" ... there is nothing to change since isnt code...

This AI will have the same effect...
class 1 pk_killer : guard_stand
class_end

And second... are you going to spawn that npc in every single GK spawn ?... because there are more than 200. I have exactly 227, but i know some of them are too close... so.. like 200... but them... your guard is going to kill each single player appaers with karma in that place..

And the last thing... the handler in charge of attack PKs will be SEE_CREATURE.

Something like...

EventHandler SEE_CREATURE(creature)
{
if (creature.karma > 0)
{
AddAttackDesire(creature,1,1500);
}
}


But you will have a new problem... players that convert into PK in front of the guard will not be attacked, but in exchange, your guard will kill for example.. people comming from Clan Hall that want to low their karma...


NOTE: You dont need to create a new guard, you can simple spawn "bowman" NPC where you want.

smeli
28.06.2007, 05:06
this man needs something like antileech code so he just shared something in order to get it

funny man!