![]() |
|
|
|
|
#1 |
|
Архивный участник
Join Date: Sep 2005
Posts: 53
|
Not sure if many people would find this usefull, it's my first "big" project in AI. I don't think I don't need to go over it much.. It's just a global gk that charges 2k adena for each port. And if you have a certain item, it lets your teleport free. Also checks if your a GM to use the GM teleports. And there is a Karma Check, if you have any karma, you can't teleport. I'm sure you can tweak it a bit to how you like it.
~Frozen Edit : I'd also like to thanks Fabian and Kenster for helping me get started with NASC. Thanks again guys ^^ Вложения из исходного сообщения (сами файлы в копии отсутствуют): global_teleporter_108.rar — 12628 байт |
|
|
|
|
#2 |
|
Архивный участник
Join Date: Aug 2005
Posts: 1,531
|
interested, but... where it can use? GM use bookmarks or not have access to summon this npc. Add this to standart class?
class teleporter : globalteleporter ? next. Your code very bigger. You must find way for optimise this. Example, first sample Code:
if (ask == 1 && reply == 5) { //Talking Island
if (i1 > 0) {
InstantTeleport(talker, -84318, 244579, -3730);
}
else if (i1 == 0) {
DeleteItem1(talker, @adena, 2000);
InstantTeleport(talker, -84318, 244579, -3730);
}
}
Code:
if (ask == 1 && reply == 5)
{ //Talking Island
if (i1 == 0)
{
DeleteItem1(talker, @adena, 2000);
}
InstantTeleport(talker, -84318, 244579, -3730);
}
|
|
|
|
|
#3 |
|
Архивный участник
Join Date: Nov 2005
Posts: 146
|
I think this code need "heavy" optimization
![]() Look, you take 2k adena every time for teleports, if player haven't item @chrono_campana. And you check every time for that item, if player haven't that item - you delete 2k adena and teleport him. 1. You haven't check, if player have 2k adena. You just delete it. 2. You have check for item @chrono_campana in every teleport. More optimized will be: Code:
EventHandler MENU_SELECTED(ask, reply, talker, i0, i1) {
i1 = OwnItemCount(talker, @chrono_campana);
if (ask == 1 && reply > 0)
{
if (OwnItemCount(talker, @adena)<2000 && i1==0)
ShowPage(talker, "not_enough_adena.htm");
else
{
if (i1 == 0)
DeleteItem1(talker, @adena, 2000);
select(reply)
{
case 1 :
{
InstantTeleport(talker, 46934, 51467, -2977);
break;
}
case 2 :
{
InstantTeleport(talker, 9745, 15606, -4574);
break;
}
case 3 :
{
InstantTeleport(talker, -44836, -112524, -235);
break;
}
..........................and so on
}
}
}
}
|
|
|
|
|
#4 |
|
Архивный участник
Join Date: Sep 2005
Posts: 53
|
Well like I said.. first big project like that, still learnin NASC. Thanks for the help guys
|
|
|
|
|
#5 |
|
Архивный участник
Join Date: Mar 2006
Posts: 53
|
I've tested it,mainland places doesn't work O.o
|
|
|
|
|
#6 | |
|
Архивный участник
Join Date: Aug 2005
Posts: 1,531
|
Quote:
|
|
|
|
|
|
#7 |
|
Архивный участник
Join Date: Sep 2005
Posts: 53
|
Ooh yeah, gotta resave the mainland.htm into unicode.. sorry bout that one :X
|
|
|
|
|
#8 |
|
Архивный участник
Join Date: Jun 2006
Posts: 111
|
Not bad work Frozen
![]() I kinda sead befor that i wanted 2 try make a VIP/Hero type of gatekeeper and shop :P pleassse Share some shops >.< <3 ^^ |
|
|
|
|
#9 |
|
Архивный участник
Join Date: Apr 2006
Posts: 40
|
Good job thanks a lot man.. Even compiled AI. gg
Btw, has any of you compiled the subclass.txt from the attachments file? (subclass_663.rar)
|
|
|
| Thread Tools | Search this Thread |
| Display Modes | |
|
|