Can anyone help me with this

Basically here is my code, what it is supposed to do in a game I am coding is when I right click on the NPC "Ayla it should start talking to her and start the Quest/ Mission.. But nothing happpens when I click on her so I assume there is a fault with the code somewhere, If you can spot it or know what i've done wrong please let me know, I have wrote the code here and I will give you the guide I get with the code.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
 Main
{
        questname   "Test"
        version  1.0
}
 
 
State Begin
{
        desc        "Talk With Ayla"
 
        action     AddNpcText(1, "My Life is ruined The Goats are destroying everything");
        action     AddNpcText(1, "Will you please Kill them all");
        action     AddNpcInput(1, 1, "Of course I will! I hate Goats anyway");
        action     AddNpcInput(1, 2, "Kill your own goats.");
        rule         InputNpc(1) goto HelpAyla
        rule         InputNpc(2) goto Coward
}
 
State Coward
{
        desc        "Talk With Ayla"
 
        action     AddNpcText(1, "MY FAMILY WILL STARVE");
        rule         TalkedToNpc(1) goto EndReset
}
 
State HelpAyla
{
        desc        "Kill 30 Goats"
 
        action     AddNpcText(1, "Please kill 30 Goats for me! They will never come back!");
        action     AddNpcInput(1, 1, "Easy");
        action     AddNpcInput(1, 2, "Can't be bothered");
        rule         InputNpc(1) goto KillGoats
        rule         InputNpc(2) goto Coward2
}
 
State Coward2
{
        desc        "TalktoAyla"
 
        action     AddNpcText(1, "That sucks.");
        rule         TalkedToNpc(1) goto EndReset
}
 
State KillGoats
{
        desc        "Kill 30 Goats"
 
        action     AddNpcText(1, "Thank you so much for helping! I will reward you");
        rule         KilledNpcs(7, 30) goto ReturnToAyla
}
 
State ReturnToAyla
{
        desc        "ReturnToAyla"
 
        action     ShowHint("You Finished the Quest! Talk to Ayla");
        action     AddNpcText(1, "YOU FINISHED! You have helped my whole family!");
        rule         TalkedToNpc(1) goto Reward
}
 
State Reward
{
        desc        "Complete"
 
        action     ShowHint("Ayla Gives you 5000xp and 5000Gold");
        action     GiveEXP(5000);
        action     GiveItem(1, 5000);
        action     End();
}
 
State EndReset
{
        desc        "Complete"
 
        action     Reset();
}



And this is the Guide I get before making the quest.

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Example quest:

main
{
   questname  "Sheep Hunt"
   version      1.0
}
state begin
{
   desc         "Talk to the Hunter"
   
   action       AddNpcText(1, "Good morning, [name]! How have you been?");
   action       AddNpcText(1, "Could you help me, getting rid of these sheeps?");
   
   action       AddNpcInput(1, 1, "Yes of course!");
   action       AddNpcInput(1, 2, "No thank you.");
   
   rule         InputNpc( 1 ) goto Hunt
   rule         InputNpc( 2 ) goto Reset
}
state Hunt
{
   desc         "Kill Sheeps"
   
   action       AddNpcText(1, "Thank you so much, [name]! I appreciate it.");
   action       AddNpcText(1, "Please kill 20 sheeps and return to me once you're done.");
   
   rule         KilledNpcs(170,20) goto Return
}
state Return
{
   desc         "Talk to the Hunter"
   action       AddNpcText(1, "Thank you so much for helping me out, that was pretty quick, I surely underestimated you.");
   action       AddNpcText(1, "I would like to give you this as gratitude for your help, please accept it!");

   rule         TalkedToNpc(1) goto Reward
}
state Reward
{
	action  ShowHint("You have been rewarded!");

    	if Class(1) GiveItem(4,10);
	elseif Class(2) GiveItem(5,10);
	else GiveItem(1,5000);

    	action  End();
}
state  Reset
{
        action   AddNpcText(1, "That's unfortunate!");
        action   Reset();
}

Explanation:

When the player talks to the Sheep Hunter (quest ID 1 required) then
the hunter will ask the player to kill 20 sheeps, if he accepts it
he'll get to the next state and will have to kill 20 sheeps to get rewarded.

By using: "If", "Elseif" and "Else" you can decide the action by checking a rule.
Then the last thing that'll be called is action End() to make sure the quest won't be repeatable.

Quests should be saved as 00001.eqf etc.


actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
action SetState("Argument");
action partyWarp(m,x,y);
action Reset();
action End();
action GivePartyItem(id, amount);
action GivePartyEXP(id);
action StartQuest(id, "State");
action ResetQuest(id);
action SetQuestState(id, "State");
action AddNpcText(id, "Argument");
action AddNpcChat(id, "Argument");
action addNpcInput(Questid, InputId, "Argument");
action AddNpcPM(id, "Argument");
action ShowHint("Argument");
action Quake(id);
action QuakeWorld(id);
action SetCoord(m,x,y);
action ReturnHome();
action PlaySound(id);
action PlayEffect(id);
action NewAchievement("Argument");
action GiveEXP(id);
action GiveItem(id, amount);
action RemoveItem(id, amount);
action SetClass(id);
action SetRace(id);
action RemoveKarma(id);
action GiveKarma(id);
action SpawnNPC(id, amount);
action SetTitle("Argument");
action SetFiance("Argument");
action SetPartner("Argument");
action SetHome("Argument");
action SetStat("Stat", id);
action GiveStat("Stat", id);
action RemoveStat("Stat", id);

Note: "Argument" is a string!, id is an integer. Integers don't need "" quotes 


Rules
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
rule InputNpc(id) goto State
rule TalkedToNpc(id) goto State
rule Always() goto State
rule EnterMap(id) goto State
rule EnterCoord(m,x,y) goto State
rule LeaveMap(id) goto State
rule LeaveCoord(m,x,y) goto State
rule IsLeader() goto State
rule InParty() goto State
rule Class(id) goto State
rule LostClass(id) goto State
rule KilledNpcs(id, amount) goto State
rule KilledPlayers(id) goto State
rule ArenaKills(id) goto State
rule ArenaWins(id) goto State
rule GotItems(id, amount) goto State
rule LostItems(id, amount) goto State
rule UsedItem(id, amount) goto State
rule IsGender(id) goto State
rule IsLevel(id) goto State
rule IsRebirth(id) goto State
rule IsParty(id) goto State
rule IsRace(id) goto State
rule IsWearing(id) goto State
rule IsQuestState(quest, state) goto State
rule GotSpell(id, SpellLevel) goto State
rule LostSpell(id) goto State
rule UsedSpell(id, amount) goto State
rule CitizenOf("Argument") goto State
rule StatBetween(StatName, minAmount, maxAmount) goto State
rule StatGreater(StatName, amount) goto State
rule StatIs(StatName, amount) goto State
rule StatLess(StatName, amount) goto State
rule StatNot(StatName, amount) goto State
rule StatRpn(amount) goto State

Note: "Argument" is a string!, id is an integer. Integers don't need "" quotes 
None of this looks like C or C++. It looks similar, but it's not. Are you sure you're on the right forums?
Topic archived. No new replies allowed.