summaryrefslogblamecommitdiff
path: root/npc/003-13/arnea.txt
blob: 9b2329a4ef78f4f33c64252712cee0f8aa81c1fe (plain) (tree)
1
2
3
4
5
6
7
8
9






                                             
                                                   
            



                      
 























                                                                 
                                                                                                                                   















                                                                                 


                                           

















                                                            

                    
                              












                                                    





















                                                                                           
// TMW2 Scripts
// Author:
//    4144
//    Jesusalva
// Description:
//    Arena for Duels and PVP (temporary map)

003-13,29,29,0	script	Arnea#003-13	NPC_ELF_F,{
    // FIXIT
    if (!is_staff()) {
        hello;
        end;
    }

    mes "npc name: " + .name$;
    mes "npc ext name: " + .extname$;
    mes "npc id: " + .id;
    mes "npc parent id: " + .parent;
    mes "npc src id: " + .srcId;
    mes "char id 3: " + getcharid(3);
    mes "instance id: " + instance_id();
    mes "Map ID: " + instance_mapname("003-13");
    if (instance_id() >= 0)
    {
        mes "npc in instance named: " + instance_npcname(.name$);
        next;
        goto L_Manage;
    }
    else
    {
        mes "npc not in instance";
    }
    close;

L_Manage:
    mesn;
    switch (select(
                "warp back",
                rif(getcharid(3) == $@ARENA_INSTANCES[replacestr(instance_mapname("003-13"), "003-13@a", "")] || is_gm(),"delete"),
                "cancel"))
    {
        case 1:
            warp "003-5", 33, 40;
            break;
        case 2:
            if (instance_id() < 0)
            {
                mes "Error: not in an instance";
                break;
            }
            .@ArenaToFree=replacestr(instance_mapname("003-13"), "003-13@a", "");
            //mes .@ArenaToFree;
            //next;
            $@ARENA_INSTANCES[.@ArenaToFree]=-1;
            warp "003-5", 33, 40;
            DESTROY_ME=1;
            DESTROY_MY_ID=instance_id();
            //instance_detachmap("003-13");
            //instance_destroy(instance_id()); // TODO FIXME
            break;
        case 3:
            break;
    }
    close;
OnInit:
    .@npcId = getnpcid(0, .name$);
    setunitdata(.@npcId, UDT_HEADTOP, 2907);
    setunitdata(.@npcId, UDT_HEADMIDDLE, 1305);
    setunitdata(.@npcId, UDT_HEADBOTTOM, 2204);
    setunitdata(.@npcId, UDT_WEAPON, 3509);
    setunitdata(.@npcId, UDT_HAIRSTYLE, 14);
    setunitdata(.@npcId, UDT_HAIRCOLOR, 18);

    .sex = G_FEMALE;
    .distance = 9;
    // test instance id

    // Temporary fix
    disablenpc "Arnea#003-13";
    end;

OnInstanceInit:
    .@npcId = getnpcid(0, instance_npcname(.name$));
    setunitdata(.@npcId, UDT_HEADTOP, 2907);
    setunitdata(.@npcId, UDT_HEADMIDDLE, 1305);
    setunitdata(.@npcId, UDT_HEADBOTTOM, 2204);
    setunitdata(.@npcId, UDT_WEAPON, 3509);
    setunitdata(.@npcId, UDT_HAIRSTYLE, 14);
    setunitdata(.@npcId, UDT_HAIRCOLOR, 18);
    end;

}


/*
        .@ID=getcharid(0);
        .@MUNDANE_INSTID = instance_create("001-3-0@a"+(.@ID), 0, IOT_NONE);
        //debugmes "You are "+str(.@ID);

        //if (.@MUNDANE_INSTID < 0) debugmes "Error: No instance ID";
        //debugmes "new instance id: " + str(.@MUNDANE_INSTID);

        .@instanceMapName$ = instance_attachmap("001-3-0", .@MUNDANE_INSTID, 0, str(.@ID));

        //if (.@instanceMapName$ == "") debugmes "Error: Map 001-3-0 X failed";
        //debugmes "Created map: "+ str(.@instanceMapName$);

        instance_set_timeout(300000, 300000, .@MUNDANE_INSTID);
        instance_init(.@MUNDANE_INSTID);

        warp str(.@ID), 161,59;
        close;

*/