Post Pacific  

Go Back   Post Pacific > Восстановленный архив > Темы без сохранившегося раздела
FAQ Community Calendar Today's Posts Search

Notices

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 23.11.2005, 12:10   #1
lich
Архивный участник
 
Join Date: Jul 2005
Posts: 96
Default [Share] SP Scrolls

On official server you can buy a scrolls which gives you SP for an ancient adena from the Priests of Dawn/Dusk. There are no skill effects which modificate your characteristics, so we need to find another way to add SP

Basic idea took from this post of sPoter.
Idea is to spawn a summon which give you SP on it's creation and despawns.

So, here is implementation

itemdata.txt
Code:
item_begin	etcitem	5593	[sp_scroll1]	item_type=etcitem	slot_bit_type={none}	armor_type=none	etcitem_type=scroll	blessed=0	weight=30	default_action=action_skill_reduce	consume_type=consume_type_normal	initial_count=1	maximum_count=1	soulshot_count=0	spiritshot_count=0	immediate_effect=1	price=0	default_price=1800	item_skill=[s_scroll_of_sp1]	critical_attack_skill=[none]	material_type=paper	crystal_type=none	crystal_count=0	is_trade=1	is_drop=1	is_destruct=1	physical_damage=0	random_damage=0	weapon_type=none	can_penetrate=0	critical=0	hit_modify=0	avoid_modify=0	dual_fhit_rate=0	shield_defense=0	shield_defense_rate=0	attack_range=0	effective_range=0	damage_range={}	attack_speed=0	reuse_delay=0	mp_consume=0	magical_damage=0	durability=0	damaged=0	physical_defense=0	magical_defense=0	mp_bonus=0	category={}	enchanted=0	html=[item_default.htm]	equip_pet={0}	magic_weapon=0	item_end
item_begin	etcitem	5594	[sp_scroll2]	item_type=etcitem	slot_bit_type={none}	armor_type=none	etcitem_type=scroll	blessed=0	weight=30	default_action=action_skill_reduce	consume_type=consume_type_normal	initial_count=1	maximum_count=1	soulshot_count=0	spiritshot_count=0	immediate_effect=1	price=0	default_price=1800	item_skill=[s_scroll_of_sp2]	critical_attack_skill=[none]	material_type=paper	crystal_type=none	crystal_count=0	is_trade=1	is_drop=1	is_destruct=1	physical_damage=0	random_damage=0	weapon_type=none	can_penetrate=0	critical=0	hit_modify=0	avoid_modify=0	dual_fhit_rate=0	shield_defense=0	shield_defense_rate=0	attack_range=0	effective_range=0	damage_range={}	attack_speed=0	reuse_delay=0	mp_consume=0	magical_damage=0	durability=0	damaged=0	physical_defense=0	magical_defense=0	mp_bonus=0	category={}	enchanted=0	html=[item_default.htm]	equip_pet={0}	magic_weapon=0	item_end
item_begin	etcitem	5595	[sp_scroll3]	item_type=etcitem	slot_bit_type={none}	armor_type=none	etcitem_type=scroll	blessed=0	weight=30	default_action=action_skill_reduce	consume_type=consume_type_normal	initial_count=1	maximum_count=1	soulshot_count=0	spiritshot_count=0	immediate_effect=1	price=0	default_price=1800	item_skill=[s_scroll_of_sp3]	critical_attack_skill=[none]	material_type=paper	crystal_type=none	crystal_count=0	is_trade=1	is_drop=1	is_destruct=1	physical_damage=0	random_damage=0	weapon_type=none	can_penetrate=0	critical=0	hit_modify=0	avoid_modify=0	dual_fhit_rate=0	shield_defense=0	shield_defense_rate=0	attack_range=0	effective_range=0	damage_range={}	attack_speed=0	reuse_delay=0	mp_consume=0	magical_damage=0	durability=0	damaged=0	physical_defense=0	magical_defense=0	mp_bonus=0	category={}	enchanted=0	html=[item_default.htm]	equip_pet={0}	magic_weapon=0	item_end
item_pch.txt
Code:
[sp_scroll1] = 5593
[sp_scroll2] = 5594
[sp_scroll3] = 5595
skilldata.txt
Code:
skill_begin	skill_name = [s_scroll_of_sp1]	/* [c3 skill] */	skill_id = 2167	level = 1	operate_type = A1	magic_level = 20	effect = {{i_summon;[sp_500];70}}	operate_cond = {}	is_magic = 1	mp_consume2 = 0	mp_consume2 = 0 cast_range = -1	effective_range = -1	skill_hit_time = 0.2	skill_cool_time = 0	skill_hit_cancel_time = 0	reuse_delay = 1	attribute = attr_none	effect_point = 0	target_type = self	affect_scope = single	next_action = none	skill_end
skill_begin	skill_name = [s_scroll_of_sp2]	/* [c3 skill] */	skill_id = 2167	level = 2	operate_type = A1	magic_level = 25	effect = {{i_summon;[sp_5000];70}}	operate_cond = {}	is_magic = 1	mp_consume2 = 0	mp_consume2 = 0 cast_range = -1	effective_range = -1	skill_hit_time = 0.2	skill_cool_time = 0	skill_hit_cancel_time = 0	reuse_delay = 1	attribute = attr_none	effect_point = 0	target_type = self	affect_scope = single	next_action = none	skill_end
skill_begin	skill_name = [s_scroll_of_sp3]	/* [c3 skill] */	skill_id = 2167	level = 3	operate_type = A1	magic_level = 30	effect = {{i_summon;[sp_100000];70}}	operate_cond = {}	is_magic = 1	mp_consume2 = 0	mp_consume2 = 0 cast_range = -1	effective_range = -1	skill_hit_time = 0.2	skill_cool_time = 0	skill_hit_cancel_time = 0	reuse_delay = 1	attribute = attr_none	effect_point = 0	target_type = self	affect_scope = single	next_action = none	skill_end
skill_pch.txt
Code:
[s_scroll_of_sp1] = 554753
[s_scroll_of_sp2] = 554754
[s_scroll_of_sp3] = 554755
skill2_pch.txt
Code:
554753 -1 0 0 0 0 29 -1 0 1 1 1 -12345
554754 -1 0 0 0 0 29 -1 0 1 1 1 -12345
554755 -1 0 0 0 0 29 -1 0 1 1 1 -12345
npcdata.txt
Code:
npc_begin	summon	17001	[sp_500]	level=70	exp=4296345xx.xx5	acquire_exp_rate=0.133	undying=1	can_be_attacked=0	acquire_sp=775	race=human	sex=male	temper=100	safe_height=100	org_jump=15	skill_list={@s_full_magic_defence}	magic_list={}	max_item=50	item_make_list={}	corpse_make_list={}	additional_make_list={}	additional_make_multi_list={}	slot_chest=[]	slot_rhand=[]	slot_lhand=[]	base_attack_type=fist	base_can_penetrate=0	base_attack_range=43	base_damage_range={0;0;80;120}	base_rand_dam=30	str=40	int=21	dex=30	wit=20	con=43	men=10	hp_increase=40	mp_increase=7	org_hp_regen=7.5	org_mp_regen=2.7	ground_low={80;0;10}	ground_high={120;-30;30}	underwater_low={50;0;10}	underwater_high={0;0;30}	fly_low={0;0;10}	fly_high={0;-30;30}	float_low={0;0;10}	float_high={0;-30;30}	org_earshot=100	sight={0;0;2500;120;5}	agro_range=1000	org_hp=24xx.xx818899627	org_mp=1345.8	base_defend=2xx.xx597408024	base_magic_attack=4xx.xx4627426724	base_magic_defend=2xx.xx8467292763	base_physical_attack=6xx.xx3725587608	physical_hit_modify=4.75	physical_avoid_modify=0	base_attack_speed=253	base_reuse_delay=0	base_critical=4	magic_use_speed_modify=0	status={normal}	align=-4900	collision_radius=1	collision_height=1	category={}	clan={}	clan_help_range=300	guild={}	pledge={}	pledge_leader=0	alliance={}	alliance_leader=0	ignore_clan_list={}	ruler=0	ruling_domain={}	npc_ai={[sp_500]}	corpse_time=7	no_sleep_mode=0	npc_end	
npc_begin	summon	17002	[sp_5000]	level=70	exp=4296345xx.xx5	acquire_exp_rate=0.133	undying=1	can_be_attacked=0	acquire_sp=775	race=human	sex=male	temper=100	safe_height=100	org_jump=15	skill_list={@s_full_magic_defence}	magic_list={}	max_item=50	item_make_list={}	corpse_make_list={}	additional_make_list={}	additional_make_multi_list={}	slot_chest=[]	slot_rhand=[]	slot_lhand=[]	base_attack_type=fist	base_can_penetrate=0	base_attack_range=43	base_damage_range={0;0;80;120}	base_rand_dam=30	str=40	int=21	dex=30	wit=20	con=43	men=10	hp_increase=40	mp_increase=7	org_hp_regen=7.5	org_mp_regen=2.7	ground_low={80;0;10}	ground_high={120;-30;30}	underwater_low={50;0;10}	underwater_high={0;0;30}	fly_low={0;0;10}	fly_high={0;-30;30}	float_low={0;0;10}	float_high={0;-30;30}	org_earshot=100	sight={0;0;2500;120;5}	agro_range=1000	org_hp=24xx.xx818899627	org_mp=1345.8	base_defend=2xx.xx597408024	base_magic_attack=4xx.xx4627426724	base_magic_defend=2xx.xx8467292763	base_physical_attack=6xx.xx3725587608	physical_hit_modify=4.75	physical_avoid_modify=0	base_attack_speed=253	base_reuse_delay=0	base_critical=4	magic_use_speed_modify=0	status={normal}	align=-4900	collision_radius=1	collision_height=1	category={}	clan={}	clan_help_range=300	guild={}	pledge={}	pledge_leader=0	alliance={}	alliance_leader=0	ignore_clan_list={}	ruler=0	ruling_domain={}	npc_ai={[sp_5000]}	corpse_time=7	no_sleep_mode=0	npc_end	
npc_begin	summon	17003	[sp_100000]	level=70	exp=4296345xx.xx5	acquire_exp_rate=0.133	undying=1	can_be_attacked=0	acquire_sp=775	race=human	sex=male	temper=100	safe_height=100	org_jump=15	skill_list={@s_full_magic_defence}	magic_list={}	max_item=50	item_make_list={}	corpse_make_list={}	additional_make_list={}	additional_make_multi_list={}	slot_chest=[]	slot_rhand=[]	slot_lhand=[]	base_attack_type=fist	base_can_penetrate=0	base_attack_range=43	base_damage_range={0;0;80;120}	base_rand_dam=30	str=40	int=21	dex=30	wit=20	con=43	men=10	hp_increase=40	mp_increase=7	org_hp_regen=7.5	org_mp_regen=2.7	ground_low={80;0;10}	ground_high={120;-30;30}	underwater_low={50;0;10}	underwater_high={0;0;30}	fly_low={0;0;10}	fly_high={0;-30;30}	float_low={0;0;10}	float_high={0;-30;30}	org_earshot=100	sight={0;0;2500;120;5}	agro_range=1000	org_hp=24xx.xx818899627	org_mp=1345.8	base_defend=2xx.xx597408024	base_magic_attack=4xx.xx4627426724	base_magic_defend=2xx.xx8467292763	base_physical_attack=6xx.xx3725587608	physical_hit_modify=4.75	physical_avoid_modify=0	base_attack_speed=253	base_reuse_delay=0	base_critical=4	magic_use_speed_modify=0	status={normal}	align=-4900	collision_radius=1	collision_height=1	category={}	clan={}	clan_help_range=300	guild={}	pledge={}	pledge_leader=0	alliance={}	alliance_leader=0	ignore_clan_list={}	ruler=0	ruling_domain={}	npc_ai={[sp_100000]}	corpse_time=7	no_sleep_mode=0	npc_end
You can change parametrs of summon to everything you like, except npc_ai, it doesn't matter.

npc_pch.txt
Code:
[sp_1000] = 1017001
[sp_10000] = 1017002
[sp_100000] = 1017003
Add at the end of ai.obj
Code:
class sp_500 : (null) 
handler 13 // CREATED 
variable_begin 
"myself" 
"_choiceN" 
"_code" 
"_from_choice" 
variable_end 

shift_sp 1 
push_event // myself 
push_const 28 
add 
fetch_i // master 
push_const 2404 
add 
fetch_i
push_const 1
push_const 500	//give 500 sp
func_call 171	//  func[IncrementParam]
shift_sp -3
shift_sp -1

shift_sp 1 
push_const 300001 
push_const 100	//set despawn timer on 100ms
func_call 28 // func[AddTimerEx] 
shift_sp -2 
shift_sp -1 
handler_end 

handler 12 // TIMER_FIRED_EX 
variable_begin 
"timer_id" 
"myself" 
"_choiceN" 
"_code" 
"_from_choice" 
variable_end 

push_event // timer_id 
push_const 176 
add 
fetch_i 
push_const 300001 
equal 
branch_false L134656 
L134655 
shift_sp 1 
func_call 175 // func[Despawn] 
shift_sp -1 
L134656 
handler_end 

class_end

class sp_5000 : (null) 
handler 13 // CREATED 
variable_begin 
"myself" 
"_choiceN" 
"_code" 
"_from_choice" 
variable_end 

shift_sp 1 
push_event // myself 
push_const 28 
add 
fetch_i // master 
push_const 2404 
add 
fetch_i
push_const 1
push_const 5000	//give 5000 sp
func_call 171	//  func[IncrementParam]
shift_sp -3
shift_sp -1

shift_sp 1 
push_const 300001 
push_const 100	//set despawn timer on 100ms
func_call 28 // func[AddTimerEx] 
shift_sp -2 
shift_sp -1 
handler_end 

handler 12 // TIMER_FIRED_EX 
variable_begin 
"timer_id" 
"myself" 
"_choiceN" 
"_code" 
"_from_choice" 
variable_end 

push_event // timer_id 
push_const 176 
add 
fetch_i 
push_const 300001 
equal 
branch_false L134658 
L134657 
shift_sp 1 
func_call 175 // func[Despawn] 
shift_sp -1 
L134658 
handler_end 

class_end

class sp_100000 : (null) 
handler 13 // CREATED 
variable_begin 
"myself" 
"_choiceN" 
"_code" 
"_from_choice" 
variable_end 

shift_sp 1 
push_event // myself 
push_const 28 
add 
fetch_i // master 
push_const 2404 
add 
fetch_i
push_const 1
push_const 100000	//give 10000 sp
func_call 171	//  func[IncrementParam]
shift_sp -3
shift_sp -1

shift_sp 1 
push_const 300001 
push_const 100	//set despawn timer on 100ms
func_call 28 // func[AddTimerEx] 
shift_sp -2 
shift_sp -1 
handler_end 

handler 12 // TIMER_FIRED_EX 
variable_begin 
"timer_id" 
"myself" 
"_choiceN" 
"_code" 
"_from_choice" 
variable_end 

push_event // timer_id 
push_const 176 
add 
fetch_i 
push_const 300001 
equal 
branch_false L134660 
L134659 
shift_sp 1 
func_call 175 // func[Despawn] 
shift_sp -1 
L134660 
handler_end 

class_end
All is quite simple and, I think , don't need a futher explanation.

Side effect is spawn of big white rabbit I think it can be remove by editing client files, by defining a mesh for a npc, and setting it's size to very small. And seems that you have to wait for a complete loading of npc server, it's really a problem. But I can't see another way of realization.
lich is offline  
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 16:06.