Jump to content

Emistry

Forum Moderator
  • Posts

    9,746
  • Joined

  • Days Won

    305

Posts posted by Emistry

  1. //================================================Name======================================================
                                        // Goblin Invasion NPC (Official Release Name)
    //===============================================Version====================================================
    //                                                  1.2 
    //===============================================Author=====================================================
    //                     ____ _____  ______  __ __   __  _______    __   _____ __   __  _______
    //                    |  __ \ _  \|  __  \|  |  \ |  |/  ___  \  |  | /  /  |  \ |  |/  ___  \
    //                    | |__| | \  \ |__|  |  |   \|  |  |  _\_/  |  |/  /|  |   \|  |  |  _\_/
    //                    |   __/   | |      /|  |       |  | |_  \  |     | |  |    |  |  | |_  \
    //                    |  |\  \_/  /  |\  \|  |  |\   |   \_/  |  |  |\  \|  |  |\   |   \_/  |
    //                    |__| \_____/|__| \__\__|__| \__|\______/   |__| \__\__|__| \__|\______/
    //----------------------------------------Script Last Update 2020-------------------------------------------
    //==============================================Changelog===================================================
                                        // 1.0 *
                                        //        - Initial Release
                                        // 1.1
                                        //        - Added Host Event by GMAccess
                                        // 1.2
                                        //        - Remove all error from Latest rAthena
                                        //        - Maximize script
                                        //        - Fix some dialog of NPC
                                        //        - Added Mapflag for the Event Map 
    //==========================================================================================================
    prontera,155,185,6    script    Invasion NPC    459,{
    
    set .gm,50;//GM Level to access the GM Menu. Default: 50
    
        // GM menu 
        //It allows GMs Level 50 or more to Start and Stop invasions.
        if (getgmlevel()>.gm) {
            if (.mobs_left) {
                mes "[Invasion]";
                mes "An invasion is in progress..";
                mes "Location: " + .Map$;
                mes "^FF0000"+.mobs_left+"^000000 Goblins left";
                mes " ";
                mes "Stop invasion?";
                if(select("No:Yes")==1) close;
                donpcevent "Invasion NPC::OnTimer1805000";
                mes "Invasion stopped";
                announce "The Invasion has been stopped by "+strcharinfo(0),bc_all;
                close;
            }
            mes "[Invasion]";
            mes "Please customize the Invasion event before starting it.";
            mes "Note - The Goblin Leader drops x5 of the prize.";
            Main:
            next;
            mes "[Invasion]";
                switch(select("Item [" + getitemname(.ItemID) + "]:Start Event")) {
            case 1:
                mes "Which item would you like the Goblin Leader to drop?";
                mes "Please input the item ID:";
                input .ItemID;
                goto Main;
            case 2:
                mes "Starting the event now...";
                close2;
                goto OnStart;
        }
        
        // If a player clicks the NPC, it displays:
        
        mes "[Invasion]";
        mes .mobs_left+" have invaded "+.Map$[.rand_map]+"!";
        close;
        
                /////////////////////////
                //The actual NPC Script//
                /////////////////////////
    OnMinute50: // Change this to your liking
    OnStart:
            set .mobs_left, 1;
            sleep 1000;
            set [email protected], rand(1,6);
            if ([email protected] == 6) set .Map$,"guild_vs3";
            if ([email protected] == 5) set .Map$,"guild_vs3";
            if ([email protected] == 4) set .Map$,"guild_vs3";
            if ([email protected] == 3) set .Map$,"guild_vs3";
            if ([email protected] == 2) set .Map$,"guild_vs3";
            if ([email protected] == 1) set .Map$,"guild_vs3";
            sleep 1000;
            announce "[ Rune-Midgard Guard ]: We have trouble here in the town " + .Map$ + "!", bc_all;
            sleep 5000;
            announce "[ Rune-Midgard Guard ]: Everyone, we need your help to get rid of these Goblins!", bc_all;
            monster .Map$,0,0,"Goblin",1258,10,"Invasion NPC::OnMyMobDead";
            monster .Map$,0,0,"Goblin",1299,1,"Invasion NPC::OnMyMobDead";
            set .mobs_left, 11;
            end;
        
        
    OnTimer1805000:    // 30 minutes later, kills all the mobs.
                    killmonster .Map$,"Invasion NPC::OnMyMobDead";
                    set .mobs_left, 0;
    
    OnStop://When the event is stopped by a GM, or all monsters dead.
                killmonster .Map$,"Invasion NPC::OnMyMobDead";
                killmonster .Map$,"Invasion NPC::OnSpecialMobDead";
                end;
    
    OnMyMobDead: //When a Goblin is killed
                set .mobs_left, .mobs_left-1;
                if (.mobs_left==0) {
                    announce "[ Rune-Midgard Guard ]: Everyone, thankyou for helping to get rid of these Goblins!", bc_all;
                    getitem .ItemID,20; //Change the [5] to the amount you wish to hand out.
                    donpcevent "Invasion NPC::OnStop";
                    //announce "[Invasion NPC]: "+strcharinfo(0)+" has killed the last "+.mobname$+".",bc_all;
    				announce "It seems that "+strcharinfo(0)+" has ended the Invasion!",bc_all;
    
                } else {
                    //announce "["+.mobs_left+"/200] Goblins left.",bc_map;
                    //announce "["+.mobs_left+"-"+200+"="+.mobs_left+"] Goblins left.",bc_map;
                    //announce "[("+.mobs_left+")-(200)="+.mobs_left+"] Goblins left.",bc_map;
                    
                    announce "[ "+strcharinfo(0)+" ] has killed a Goblin. There are now "+.mobs_left+" Goblin left.",bc_map;
                }
                end;
                }
                end;
    }

     

    • Like 1
  2. prontera,155,181,5	script	Sample	757,{
    	if (BaseLevel < 99) {
    		mes "You need to be at least level 99.";
    	}
    	else if (select("Reset", "cancel") == 1) {
    		resetlvl 1;
    		RESET_COUNT++;
    		StatusPoint += (RESET_COUNT * 10); // free 10 status point per reset.
    		
    		if (RESET_COUNT && RESET_COUNT % 10 == 0) {
    			getitem 512, 10; // every 10 reset get apple.
    		}
    	}
    	close;
    }

     

    • Upvote 1
  3. What is the point of create a npc just to preview an item that already exists in your inventory? You can just right away equip the item that exists in your inventory to preview it.

    Preview feature should be implemented for something that currently doesn't exists.

  4.   

    getskilllist();
    for ([email protected] = 0; [email protected] < @skilllist_count; [email protected]++) {
    	if (@skilllist_lv[[email protected]] > 0 && (@skilllist_flag[] == SKILL_PERM || @skilllist_flag[] == SKILL_PERM_GRANT) 
    		[email protected]$ = [email protected]$ + "skill_id ["[email protected]_id[[email protected]]+"] lv = "+ @skilllist_lv[[email protected]];
    	[email protected]$ = [email protected]$ + ":";
    }
    [email protected] = select([email protected]$) - 1;
    addtoskill @skilllist_id[[email protected]], [email protected]_lv[[email protected]];
    SkillPoint += @skilllist_lv[[email protected]];

    however, this is not advised to use at server that doesn't allow to bypass skill tree

    if you want to display the skill name, either create a src mod to retrieve the skill name from db/skill_db (or search forum)

    or store it in an array and retrieve it.

     

  5. change into these if you want to keep the random item bonus.

    *getitem3 <item id>,<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>{,<account ID>};
    *getitem3 "<item name>",<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<RandomIDArray>,<RandomValueArray>,<RandomParamArray>{,<account ID>};

     

  6. using the left/right shift operators to binary mathematical operations as they have two important qualities: Left-shifting a bitmask once multiplies by two. Right-shifting once divides by two.

    assuming the following scenario

    1 = map_1
    2 = map_2
    4 = map_3
    8 = map_4
    16 = map_5
    32 = map_6
    64 = map_7

    when you sum up the value for 1 + 2 + 4 + 8 = 15 (you have access to map1 , map2, map3, map4)

    when you sum up the value for 4 + 16 + 64 = 84 (you have access to map3, map5, map7)

    when you sum up all the values , then you have access to all map above.

    you could only store up to total value of 2147483647

  7. you can try something like this.

    OnPCLoadMapEvent:
    	if (inarray(.Maps$, strcharinfo(3)) != -1 && @current_map$ != strcharinfo(3)) {
    		//sc_end sc_spirit;
    		sc_end sc_gospel;
    		sc_end SC_POEMBRAGI;
    		sc_end SC_APPLEIDUN;
    		sc_end SC_ASSNCROS;
    		sc_end SC_WHISTLE;
    		//sc_end 37; // holy weapon
    		//sc_end 38; // holy armor
    		sc_end 187; // increase all stat
    		sc_end 194; // increase hit
    		sc_end 196; // increase flee
    		sc_end 198; // max hp increase
    		sc_end 199; // max sp increase
    		sc_end 200; // attach strength
    		sc_end 202; // increase def	
    		sc_end 214; // SC_SCRESIST
    		sc_end 175; // POEMBRAGI
    		sc_end 181; // SERVICE4U
    		//specialeffect2 235;
    		
    		@current_map$ = strcharinfo(3);
    		addtimer 3000, strnpcinfo(3)+"::OnCheck";
    	}
    	end;
    	
    OnCheck:
    	if (@current_map$ != "") {
    		if (@current_map$ == strcharinfo(3))
    			addtimer 3000, strnpcinfo(3)+"::OnCheck";
    		else 
    			@current_map$ = "";
    	}
    	end;
    	

     

    • Upvote 1
  8. -	script	Sample	-1,{
    	OnPCLoginEvent:
    	OnPCBaseLvUpEvent:
    		if (@fakename_enabled)
    			atcommand("@fakename");
    		atcommand("@fakename "+ strcharinfo(0)+" (Lv. "+BaseLevel+")");
    		@fakename_enabled = 1;
    		end;
    }

     

  9. 	addrid(2,0,getcharid(1));
    	dispbottom "[Monster of the Day]: Experience Gained Base:"+strmobinfo(6,.mobid)+" Job:"+strmobinfo(7,.mobid)+"";
    	set BaseExp,(BaseExp+strmobinfo(6,.mobid));
    	set JobExp,(JobExp+strmobinfo(7,.mobid));
    	end;

    change into

    	getpartymember getcharid(1), 2;
    	[email protected]_bexp = (getmonsterinfo(killedrid, MOB_BASEEXP) / [email protected]);
    	[email protected]_jexp = (getmonsterinfo(killedrid, MOB_JOBEXP) / [email protected]);
    	[email protected]_level = BaseLevel;
    	for ([email protected] = 0; [email protected] < [email protected]; [email protected]++) {
    		if (attachrid([email protected][[email protected]])) {
    			[email protected] = (BaseLevel - [email protected]_level);
    			if ([email protected] >= -15 && [email protected] <= 15) {
    				dispbottom "[Monster of the Day]: Experience Gained Base:"+F_InsertComma([email protected]_bexp)+" Job:"+F_InsertComma([email protected]_jexp)+"";
    				BaseExp += [email protected]_bexp;
    				JobExp += [email protected]_jexp;
    			}
    			detachrid;
    		}
    	}
    	end;

     

  10. prontera,114,154,5    script    Poring Race    568,{
    	if (getgmlevel() >= 99) {
    		mes "Would you like to "++" the event?";
    		if (select("continue", (.access_Prace) ? "Stop Event" : "Start Event") == 2) {
    			if (.access_Prace) {
    				donpcevent strnpcinfo(3)+"::OnPraceEnd";
    				mes "event stopped.";
    			}
    			else {
    				donpcevent strnpcinfo(3)+"::OnPraceStart";
    				mes "event started.";
    			}
    			close;
    		}
    	}
        if( .access_Prace == 0 ) {
            mes "[Event Employee: Poring Race]";
            mes "Poring Race has ended.";
            close;
        }
        mes "[Event Employee: Poring Race]";
        mes "Do you want to participate on Poring Race?";
        if( select( "Yes","No" ) -1 ) {
            next;
            mes "[Event Employee: Poring Race]";
            mes "See you again next time!";
            close;
        }
        if( .access_Prace == 0 ) {
            next;
            mes "[Event Employee: Poring Race]";
            mes "...";
            mes "...";
            mes "Cheater!!~~";
            close;
        }
        close2;
        @prace_winner$ = "";
        warp "p_track01",52,41;
        end;
    // OnInit:
    OnClock1434:
        if( gettime(3)%2 ) end;
    OnPraceStart:
        set .access_Prace, 1;
        announce "Event Employee [Poring Race]: Poring Race is about to begin. To participate kindly approach me at Event Room or use @event",0;
        setnpctimer 100000,"Bidder#prace0";
        startnpctimer "Bidder#prace0";
        end;
    OnPraceEnd:
        set .access_Prace, 0;
        announce "Event Employee [Poring Race]: Poring Race is over! Thank you for participating.",0;
        end;
    }

    try

  11. prontera,155,181,5	script	Sample	757,{
    	if (getcharid(2) && #GUILD_PACK_CD != gettime(DT_YYYYMMDD)) {
    		#GUILD_PACK_CD = gettime(DT_YYYYMMDD);
    		getitem 30005, 1;
    	}
    	end;
    	
    	OnInit:
    	OnHour00:
    		if (gettime(DT_DAYOFWEEK) != TUESDAY
    			&& gettime(DT_DAYOFWEEK) != THURSDAY
    			&& gettime(DT_DAYOFWEEK) != SUNDAY
    		) {
    			hideonnpc strnpcinfo(3);
    		}
    		end;
    }
      - Id: 30005
        AegisName: G-Pack
        Script: |
          rentitem 1201, 86400;
          rentitem 1202, 86400;
          rentitem 1203, 86400;

     

    • Love 1
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.