Post Pacific  

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

Notices

 
 
Thread Tools Search this Thread Display Modes
Old 03.07.2006, 06:20   #1
Frozen
Архивный участник
 
Join Date: Sep 2005
Posts: 53
Default [Share]Global Teleporter

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 байт
Frozen is offline  
Old 03.07.2006, 07:23   #2
HF
Архивный участник
 
Join Date: Aug 2005
Posts: 1,531
Default

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);
			}
		}
to

Code:
        if (ask == 1 && reply == 5) 
                  { //Talking Island
			if (i1 == 0) 
                           {
				DeleteItem1(talker, @adena, 2000);
                           }

			InstantTeleport(talker, -84318, 244579, -3730);
		}
HF is offline  
Old 03.07.2006, 08:16   #3
zcold
Архивный участник
 
Join Date: Nov 2005
Posts: 146
Default

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
}
}

}

}
I hope you got idea
zcold is offline  
Old 03.07.2006, 09:01   #4
Frozen
Архивный участник
 
Join Date: Sep 2005
Posts: 53
Default

Well like I said.. first big project like that, still learnin NASC. Thanks for the help guys
Frozen is offline  
Old 03.07.2006, 10:23   #5
RetaL
Архивный участник
 
Join Date: Mar 2006
Posts: 53
Default

I've tested it,mainland places doesn't work O.o
RetaL is offline  
Old 03.07.2006, 10:50   #6
HF
Архивный участник
 
Join Date: Aug 2005
Posts: 1,531
Default

Quote:
Originally Posted by RetaL
I've tested it,mainland places doesn't work O.o
Ah, what to mountain.
HF is offline  
Old 03.07.2006, 20:07   #7
Frozen
Архивный участник
 
Join Date: Sep 2005
Posts: 53
Default

Ooh yeah, gotta resave the mainland.htm into unicode.. sorry bout that one :X
Frozen is offline  
Old 04.07.2006, 16:48   #8
LoVeRSaMa
Архивный участник
 
Join Date: Jun 2006
Posts: 111
Default

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 ^^
LoVeRSaMa is offline  
Old 06.07.2006, 20:34   #9
silence_
Архивный участник
 
Join Date: Apr 2006
Posts: 40
Default

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)
silence_ 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 18:35.