Post Pacific

Post Pacific (https://postpacific.loc-online.com/index.php)
-   Темы без сохранившегося раздела (https://postpacific.loc-online.com/forumdisplay.php?f=10001)
-   -   [SHARE] Public Wyvern (https://postpacific.loc-online.com/showthread.php?t=7434)

FidoW 25.04.2007 02:42

[SHARE] Public Wyvern
 
Thats isnt retail, of course, but maybe someone will find it interesting, i do it after read this thread -> https://postpacific.loc-online.com/f...ead.php?t=7432

You can ride a Wyvern if you have a strider of level 55 at least for the price you wish, by default is setted to 1kk of Adena.

NASC code
Code:

class public_wyvern : default_npc {

parameter:
  string fnHi = "public_wyvern001.htm";
  string fnYouAreChaotic = "public_wyvern003.htm";
  string fnRideWyvern = "public_wyvern004.htm";
  string fnNotEnoughAdena = "public_wyvern005.htm";
  string fnStriderNotReady = "public_wyvern006.htm";
  int Item = 57;
  int Amount = 1000000;
  int ride_wyvern_level = 55;

handler:
  EventHandler TALKED(talker) {
    if (talker.karma > 0) myself->ShowPage(talker,fnYouAreChaotic);
    else myself->ShowPage(talker,fnHi);
  }

  EventHandler MENU_SELECTED(talker,ask,reply) {
    if (ask == -202) {
      if ((talker.yongma_type == 1) && (talker.strider_level >= ride_wyvern_level)) {
        if (myself->OwnItemCount(talker,Item) >= Amount) {
          myself->DeleteItem1(talker,Item,Amount);
          myself->RideWyvern(talker,1012621);
          myself->ShowPage(talker,fnRideWyvern);
        }
        else myself->ShowPage(talker,fnNotEnoughAdena);
      }
      else myself->ShowPage(talker,fnStriderNotReady);
    }
  }

}

Compiled code
Code:

class 1 public_wyvern : default_npc
parameter_define_begin
        string fnHi "public_wyvern001.htm"
        string fnYouAreChaotic "public_wyvern003.htm"
        string fnRideWyvern "public_wyvern004.htm"
        string fnNotEnoughAdena "public_wyvern005.htm"
        string fnStriderNotReady "public_wyvern006.htm"
        int Item 57
        int Amount 1000000
        int ride_wyvern_level 55
parameter_define_end

handler 3 38        //  TALKED
        variable_begin
                "talker"
                "myself"
                "_choiceN"
                "_code"
                "_from_choice"
        variable_end

        push_event        //  talker
        push_const 40
        add
        fetch_i        //  karma
        push_const 468
        add
        fetch_i4
        push_const 0
        greater
        branch_false L2
L1
        push_event        //  myself
        push_const 704
        add
        fetch_i
        push_event        //  talker
        push_const 40
        add
        fetch_i
        push_parameter fnYouAreChaotic
        func_call 184680516        //  func[ShowPage]
        shift_sp -2
        shift_sp -1
        jump L3
L2
        push_event        //  myself
        push_const 704
        add
        fetch_i
        push_event        //  talker
        push_const 40
        add
        fetch_i
        push_parameter fnHi
        func_call 184680516        //  func[ShowPage]
        shift_sp -2
        shift_sp -1
L3
handler_end

handler 32 118        //  MENU_SELECTED
        variable_begin
                "talker"
                "ask"
                "reply"
                "myself"
                "_choiceN"
                "_code"
                "_from_choice"
        variable_end
       
        push_event        //  ask
        push_const 160
        add
        fetch_i4
        push_const 202
        negate
        equal       
        branch_false L5
L4
        push_event        //  talker
        push_const 40
        add
        fetch_i        //  yongma_type
        push_const 836
        add
        fetch_i4
        push_const 1
        equal
        push_reg_sp
        fetch_i
        branch_false L6
        push_event        //  talker
        push_const 40
        add
        fetch_i        //  strider_level
        push_const 2080
        add
        fetch_i4
        push_parameter ride_wyvern_level
        greater_equal
        and
L6
        branch_false L7
L8
        push_event        //  myself
        push_const 704
        add
        fetch_i
        push_event        //  talker
        push_const 40
        add
        fetch_i
        push_parameter Item
        func_call 184680579        //  func[OwnItemCount]
        shift_sp -2
        push_parameter Amount
        greater_equal
        branch_false L10
L9
        push_event        //  myself
        push_const 704
        add
        fetch_i
        push_event        //  talker
        push_const 40
        add
        fetch_i
        push_parameter Item
        push_parameter Amount
        func_call 184746114        //  func[DeleteItem1]
        shift_sp -3
        shift_sp -1
        push_event        //  myself
        push_const 704
        add
        fetch_i
        push_event        //  talker
        push_const 40
        add
        fetch_i
        push_const 1012621
        func_call 184680717        //  func[RideWyvern]
        shift_sp -2
        shift_sp -1
        push_event        //  myself
        push_const 704
        add
        fetch_i
        push_event        //  talker
        push_const 40
        add
        fetch_i
        push_parameter fnRideWyvern
        func_call 184680516        //  func[ShowPage]
        shift_sp -2
        shift_sp -1
        jump L12
L10
        push_event        //  myself
        push_const 704
        add
        fetch_i
        push_event        //  talker
        push_const 40
        add
        fetch_i
        push_parameter fnNotEnoughAdena
        func_call 184680516        //  func[ShowPage]
        shift_sp -2
        shift_sp -1
L12
        jump L13
L7
        push_event        //  myself
        push_const 704
        add
        fetch_i
        push_event        //  talker
        push_const 40
        add
        fetch_i
        push_parameter fnStriderNotReady
        func_call 184680516        //  func[ShowPage]
        shift_sp -2
        shift_sp -1
L5
L11
L13
handler_end

class_end

npcdata.txt
Code:

npc_begin        citizen        15106        [public_wyvern]        level=70        acquire_exp_rate=0        acquire_sp=0        unsowing=1        clan={}        ignore_clan_list={}        clan_help_range=300        slot_chest=[]        slot_rhand=[]        slot_lhand=[]        shield_defense_rate=0        shield_defense=0        skill_list={@s_full_magic_defence}        npc_ai={[public_wyvern];{[fnHi]=[public_wyvern001.htm]};{[fnYouAreChaotic]=[public_wyvern003.htm]};{[fnRideWyvern]=[public_wyvern004.htm]};{[fnNotEnoughAdena]=[public_wyvern005.htm]};{[fnStriderNotReady]=[public_wyvern006.htm]};{[Item]=@adena};{[Amount]=1000000}}        category={}        race=human        sex=female        undying=1        can_be_attacked=0        corpse_time=1        no_sleep_mode=0        agro_range=0        ground_high={120;0;0}        ground_low={50;0;0}        exp=429634528        org_hp=2444.5        org_hp_regen=7.5        org_mp=1345.8        org_mp_regen=2.7        collision_radius={8;8}        collision_height={25;25}        str=40        int=21        dex=30        wit=20        con=43        men=10        base_attack_type=sword        base_attack_range=40        base_damage_range={0;0;80;120}        base_rand_dam=30        base_physical_attack=6xx.xx373        base_critical=4        physical_hit_modify=4.75        base_attack_speed=253        base_reuse_delay=0        base_magic_attack=470.4        base_defend=2xx.xx        base_magic_defend=2xx.xx        physical_avoid_modify=0        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
npc_pch.txt
Code:

[public_wyvern]        =        1015106
And now examples of the htmls, you can make your owns...

public_wyvern001.htm
Code:

<html><body>
Public Wyvern:<br>
<br>
<a action="link public_wyvern002.htm">[Ride Wyvern]</a>
</body></html>

public_wyvern002.htm
Code:

<html><body>
Public Wyvern:<br>
Are you sure?, you will need 1kk of Adena in order to ride an Wyvern<br>
<br>
<a action="bypass -h menu_select?ask=-202">[Yes, ride Wyvern]</a>
</body></html>

public_wyvern003.htm
Code:

<html><body>
Public Wyvern:<br>
<br>
I have nothing to say to a scoundrel like you! Get out of my sight, or I'll give you a taste of my fist.
</body></html>

public_wyvern004.htm
Code:

<html><body>
Public Wyvern:<br>
<br>
You have ridden the wyvern! Please remember to keep it well-fed.
</body></html>

public_wyvern005.htm
Code:

<html><body>
Public Wyvern:<br>
<br>
Not enough <font color="LEVEL">Adena</font>!
</body></html>

public_wyvern006.htm
Code:

<html><body>
Public Wyvern:<br>
<br>
To transform a Strider into a Wyvern, ride a <font color="LEVEL">Strider of at least level 55</font> and have <font color="LEVEL">1kk Adena</font>.
</body></html>


And now yes, client side is missing in this share... make your own... or you will see gigant and demonic rabbits.

Aikeleer 25.04.2007 14:17

Wow, you took the effort to compile the code and share that huge part of work. Thanks for your share! :)

FidoW 25.04.2007 14:53

Take me less than an hour yesterday :D im starting to do it faster and faster each time...

tpuNIsher 25.04.2007 15:19

haha, nice fidow =p
i like the idea tbh :p
tho..it would mean in a sense everyone would have wyvern in the server ..but still sounds pretty good =p giving me another idea =p

Jarohe 25.04.2007 17:33

Thanks Fidow

rodier 30.04.2007 05:37

thanks a lot. It is possible to modify how long wyvern stay?

seungmo 30.04.2007 06:15

Fidow nice~~~
Thanks~~

blackman 11.05.2007 10:10

I have this error
[last-send]:public_wivern002.htm][recived menu_select?ask=-202] : INVALID LINK
plz help

citruz 21.05.2007 15:38

Quote:

Originally Posted by blackman (Post 85822)
I have this error
[last-send]:public_wivern002.htm][recived menu_select?ask=-202] : INVALID LINK
plz help

Isn't "public_wyvern..." ??? x)

blackman 25.05.2007 09:59

oh, yes, public_wyvern... but do not working anyway (((
[recived menu_select?ask=-202] : INVALID LINK

Xakep 26.05.2007 11:18

where NPC???? oO

Ra1n0 27.05.2007 22:51

Quote:

where NPC???? oO
make your own npcpos

Xakep 03.07.2007 07:54

Empty window when you press NPC><

What to do?


All times are GMT. The time now is 15:09.