![]() |
|
|
#3 |
|
Архивный участник
Join Date: Sep 2005
Posts: 1,014
|
In the past we use AI to implement some skills like "Summon Arrows" or unpack soulshots ... or "Scroll of Escape for towns"...
Thats is because with C1 skilldata was imposible to get an item through an skill so... with AI, summoning a pet who give an item to master and later despawn... in the case of the SOE towns is a similar idea, pet teleport master to the required location and later despawn... some examples... C1 NASC... my own code... Decompressing packs... Code:
class default_npc { }
class summon_item : default_npc {
parameter:
int item = 1;
int cantidad = 1;
handler:
EventHandler CREATED() {
GiveItem1(myself.master, item, cantidad);
AddTimerEx(30001, 100);
}
EventHandler TIMER_FIRED_EX(timer_id) {
if (timer_id == 30001) Despawn();
}
}
// Soulshot
class soulshot_decompressor_n : summon_item {
parameter:
int item = 1835;
int cantidad = 300;
}
Code:
class default_npc { }
class summon_item_random : default_npc {
parameter:
int item = 1;
int cantidad_fija = 1;
int cantidad_random = 1;
handler:
EventHandler CREATED() {
GiveItem1(myself.master, item, cantidad_fija+Rand(cantidad_random));
AddTimerEx(30001, 100);
}
EventHandler TIMER_FIRED_EX(timer_id) {
if (timer_id == 30001) Despawn();
}
}
class summon_mithril_arrow : summon_item_random {
parameter:
int item = 1344; // @mithril_arrow
int cantidad_fija = 450;
int cantidad_random = 1350;
}
Code:
class default_npc { }
class scroll_of_escape_town : default_npc {
parameter:
int x = 0;
int y = 0;
int z = 0;
int castle = 0;
string fnYouAreChaotic = "tcm.htm";
handler:
EventHandler CREATED() {
if (myself.master.karma > 0) {
ShowPage(myself.master, fnYouAreChaotic);
Despawn();
}
else if (castle > 0) && (Castle_IsUnderSiege2(castle))
{
ShowSystemMessage(myself.master, 707); // No puedes teletransportarte a un pueblo que este en asedio
Despawn();
}
else {
AddTimerEx(50000, 100);
InstantTeleport(myself.master, x, y, z);
}
}
EventHandler TIMER_FIRED_EX(timer_id) {
if (timer_id == 50000) Despawn();
}
}
class summon_soe_talking : scroll_of_escape_town {
parameter:
int x = -83900;
int y = 242700;
int z = -3700;
int castle = 0;
}
|
|
|
|
|